Skip to content

Commit

Permalink
Merged PR 11134: Replace package manifest for C# definition
Browse files Browse the repository at this point in the history
Replace package manifest for C# definition
  • Loading branch information
D-Inventor committed Dec 19, 2023
1 parent 59bbd19 commit 8150587
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 84 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core.PropertyEditors.Validators;
using Umbraco.Cms.Core.Services;

namespace Infocaster.Umbraco.IcomoonPicker.PropertyValueConverters
{
[DataEditor(
alias: "Infocaster.IcomoonPicker",
name: "Icomoon icon picker",
view: "~/App_Plugins/Infocaster.Umbraco.IcomoonPicker/editor/editor.html",
ValueType = ValueTypes.String)]
public class IcomoonPickerDataType : DataEditor
{
private readonly IIOHelper _ioHelper;
private readonly IEditorConfigurationParser _editorConfigurationParser;
private readonly ILocalizedTextService _textService;

public IcomoonPickerDataType(
IDataValueEditorFactory dataValueEditorFactory,
IIOHelper ioHelper,
IEditorConfigurationParser editorConfigurationParser,
ILocalizedTextService textService)
: base(dataValueEditorFactory)
{
_ioHelper = ioHelper;
_editorConfigurationParser = editorConfigurationParser;
_textService = textService;
}

protected override IConfigurationEditor CreateConfigurationEditor()
{
return new IcomoonPickerConfigurationEditor(_ioHelper, _editorConfigurationParser, _textService);
}
}

public class IcomoonPickerConfigurationEditor
: ConfigurationEditor<IcomoonPickerConfiguration>
{
public IcomoonPickerConfigurationEditor(IIOHelper ioHelper, IEditorConfigurationParser editorConfigurationParser, ILocalizedTextService textService)
: base(ioHelper, editorConfigurationParser)
{
Field(nameof(IcomoonPickerConfiguration.ProjectName)).Validators.Add(new RequiredValidator(textService));
Field(nameof(IcomoonPickerConfiguration.ProjectCode)).Validators.Add(new RequiredValidator(textService));
}
}

public class IcomoonPickerConfiguration
{
[ConfigurationField("projectName", "Project name", "requiredfield", Description = "The name of the project in icomoon")]
public string ProjectName { get; set; }

[ConfigurationField("projectCode", "Project code", "requiredfield", Description = "The code that is associated with this project in icomoon")]
public string ProjectCode { get; set; }
}
}

This file was deleted.

0 comments on commit 8150587

Please sign in to comment.