Example #1
0
        protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
        {
            base.RegisterEditorDescriptors(editorDescriptorsFactory);
            string callBackHandler = null;

            var references = new [] { typeof(ProgressBarViewItemBase).Assembly.Location, typeof(ViewItem).Assembly.Location };

            if (Application != null && Application.GetPlatform() == Platform.Web)
            {
                callBackHandler = ",DevExpress.ExpressApp.Web.Templates.IXafCallbackHandler";
                var xafWebAssembly = AppDomain.CurrentDomain.GetAssemblies().First(assembly => assembly.FullName.StartsWith("DevExpress.ExpressApp.Web"));
                references = references.Concat(xafWebAssembly.Location.YieldItem()).ToArray();
            }
            else
            {
                var location = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(assembly => assembly.FullName.StartsWith("System.Private.CoreLib"))?.Location;
                if (location != null)
                {
                    references = references.Concat(location.YieldItem()).ToArray();
                }
            }
            string code = $@"
namespace {GetType().Namespace}{{
    public class ProgressBarViewItem:{typeof(ProgressBarViewItemBase).FullName}{callBackHandler}{{
        public ProgressBarViewItem({typeof(IModelProgressBarViewItem).FullName} info, System.Type classType) : base(info, classType){{
        }}
    }}
}}
";

            using var memoryStream = CSharpSyntaxTree.ParseText(code).Compile(references);
            var type = AppDomain.CurrentDomain.LoadAssembly(memoryStream).Types().First(_ => !_.IsAbstract && typeof(ProgressBarViewItemBase).IsAssignableFrom(_));

            editorDescriptorsFactory.List.Add(new ViewItemDescriptor(new ViewItemRegistration(typeof(IModelProgressBarViewItem), type, true)));
        }
Example #2
0
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.List.Add(
         new PropertyEditorDescriptor(new AliasRegistration(EditorAliases.CSCodePropertyEditor, typeof(string),
                                                            false)));
 }
        /// <summary>
        /// Uses the web view URI property editor.
        /// </summary>
        /// <param name="editorDescriptorsFactory">The editor descriptors factory.</param>
        /// <returns>EditorDescriptorsFactory.</returns>
        /// <exception cref="ArgumentNullException">editorDescriptorsFactory</exception>
        /// <autogeneratedoc />
        public static EditorDescriptorsFactory UseWebViewUriPropertyEditor(this EditorDescriptorsFactory editorDescriptorsFactory)
        {
            _ = editorDescriptorsFactory ?? throw new ArgumentNullException(nameof(editorDescriptorsFactory));

            editorDescriptorsFactory.RegisterPropertyEditorAlias(
                Xenial.Framework.WebView.PubTernal.WebViewEditorAliases.WebViewUriPropertyEditor,
                typeof(Uri),
                true
                );

            return(editorDescriptorsFactory);
        }
        /// <summary>
        /// Uses the token objects property editor.
        /// </summary>
        /// <param name="editorDescriptorsFactory">The editor descriptors factory.</param>
        /// <returns>EditorDescriptorsFactory.</returns>
        /// <exception cref="System.ArgumentNullException">editorDescriptorsFactory</exception>
        /// <autogeneratedoc />
        public static EditorDescriptorsFactory UseStepProgressEnumPropertyEditors(this EditorDescriptorsFactory editorDescriptorsFactory)
        {
            _ = editorDescriptorsFactory ?? throw new ArgumentNullException(nameof(editorDescriptorsFactory));

            editorDescriptorsFactory.RegisterPropertyEditorAlias(
                Xenial.Framework.StepProgressEditors.PubTernal.StepProgressEditorAliases.StepProgressEnumPropertyEditor,
                typeof(Enum),
                true
                );

            return(editorDescriptorsFactory);
        }
        /// <summary>
        /// Uses the token objects property editor.
        /// </summary>
        /// <param name="editorDescriptorsFactory">The editor descriptors factory.</param>
        /// <returns>EditorDescriptorsFactory.</returns>
        /// <exception cref="System.ArgumentNullException">editorDescriptorsFactory</exception>
        /// <autogeneratedoc />
        public static EditorDescriptorsFactory UseTokenStringPropertyEditors(this EditorDescriptorsFactory editorDescriptorsFactory)
        {
            _ = editorDescriptorsFactory ?? throw new ArgumentNullException(nameof(editorDescriptorsFactory));

            editorDescriptorsFactory.RegisterPropertyEditorAlias(
                Xenial.Framework.TokenEditors.PubTernal.TokenEditorAliases.TokenStringPropertyEditor,
                typeof(string),
                true
                );

            return(editorDescriptorsFactory);
        }
Example #6
0
        protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
        {
            base.RegisterEditorDescriptors(editorDescriptorsFactory);
            string callBackHandler = null;

            if (Application != null && Application.GetPlatform() == Platform.Web)
            {
                callBackHandler = ",DevExpress.ExpressApp.Web.Templates.IXafCallbackHandler";
            }
            string code               = $@"
namespace {GetType().Namespace}{{
    public class ProgressBarViewItem:{typeof(ProgressBarViewItemBase).FullName}{callBackHandler}{{
        public ProgressBarViewItem({typeof(IModelProgressBarViewItem).FullName} info, System.Type classType) : base(info, classType){{
        }}
    }}
}}
";
            var    codeProvider       = new CSharpCodeProvider();
            var    compilerParameters = new CompilerParameters {
                CompilerOptions  = "/t:library",
                GenerateInMemory = true
            };

            compilerParameters.ReferencedAssemblies.Add("System.dll");
            compilerParameters.ReferencedAssemblies.Add(typeof(ProgressBarViewItemBase).Assembly.Location);
            compilerParameters.ReferencedAssemblies.Add(typeof(ViewItem).Assembly.Location);
            if (callBackHandler != null)
            {
                var xafWebAssembly = AppDomain.CurrentDomain.GetAssemblies().First(assembly => assembly.FullName.StartsWith("DevExpress.ExpressApp.Web"));
                compilerParameters.ReferencedAssemblies.Add(xafWebAssembly.Location);
            }
            var compilerResults = codeProvider.CompileAssemblyFromSource(compilerParameters, code);

            if (compilerResults.Errors.Count > 0)
            {
                var message = string.Join(Environment.NewLine, compilerResults.Errors.Cast <CompilerError>().Select(error => error.ToString()));
                throw new Exception(message);
            }

            var type = compilerResults.CompiledAssembly.Types().First(_ => !_.IsAbstract && typeof(ProgressBarViewItemBase).IsAssignableFrom(_));

            editorDescriptorsFactory.List.Add(new ViewItemDescriptor(new ViewItemRegistration(typeof(IModelProgressBarViewItem), type, true)));
        }
Example #7
0
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.List.Add(new PropertyEditorDescriptor(new AliasRegistration(EditorAliases.RichEditRftPropertyEditor, typeof(string), false)));
     editorDescriptorsFactory.List.Add(new PropertyEditorDescriptor(new EditorTypeRegistration(EditorAliases.RichEditRftPropertyEditor, typeof(string), typeof(RichEditWinPropertyEditor), false)));
 }
Example #8
0
 /// <summary>
 /// Registers the editor descriptors.
 /// </summary>
 /// <param name="editorDescriptorsFactory">The editor descriptors factory.</param>
 /// <autogeneratedoc />
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.UseWebViewUriPropertyEditorsBlazor();
     editorDescriptorsFactory.UseWebViewHtmlStringPropertyEditorsBlazor();
 }
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     editorDescriptorsFactory.RegisterListEditor(EditorAliases.XpandTreeListEditor, typeof(ITreeNode), typeof(XpandASPxTreeListEditor), true);
 }
Example #10
0
 /// <summary>
 /// Registers the editor descriptors.
 /// </summary>
 /// <param name="editorDescriptorsFactory">The editor descriptors factory.</param>
 /// <autogeneratedoc />
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.UseStepProgressEnumPropertyEditorsWin();
 }
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.RegisterListEditor(EditorAliases.GridListEditor, typeof(Object), typeof(BlazorGridListEditor), true);
     editorDescriptorsFactory.RegisterPropertyEditor(typeof(object), typeof(BlazorPropertyEditor), true);
 }
Example #12
0
 /// <summary>
 /// Registers the editor descriptors.
 /// </summary>
 /// <param name="editorDescriptorsFactory">The editor descriptors factory.</param>
 /// <autogeneratedoc />
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.UseTokenObjectsPropertyEditors();
     editorDescriptorsFactory.UseTokenStringPropertyEditors();
 }
 /// <inheritdoc />
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     // No editors to register here
 }
 /// <summary>
 /// Registers the editor descriptors.
 /// </summary>
 /// <param name="editorDescriptorsFactory">The editor descriptors factory.</param>
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 => editorDescriptorsFactory.RegisterListEditor(EditorAliases.GridListEditor, typeof(object), typeof(GridListEditor), true);
Example #15
0
 /// <inheritdoc/>
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     // Method intentionally left empty.
 }
 /// <summary>
 /// Registers the editor descriptors.
 /// </summary>
 /// <param name="editorDescriptorsFactory">The editor descriptors factory.</param>
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 => editorDescriptorsFactory.RegisterLabelStringPropertyEditor();
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     editorDescriptorsFactory.RegisterPropertyEditor(EditorAliases.RichTextPropertyEditor, typeof(byte[]), typeof(RichTextPropertyEditor), false);
 }
Example #18
0
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.List.Add(new PropertyEditorDescriptor(new EditorTypeRegistration(EditorAliases.TimePropertyEditor, typeof(DateTime), typeof(ASPxTimePropertyEditor), false)));
 }
Example #19
0
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.List.Add(new ListEditorDescriptor(new AliasRegistration("MapListEditor", typeof(object), false)));
     editorDescriptorsFactory.List.Add(new ListEditorDescriptor(new EditorTypeRegistration("MapListEditor", typeof(object), typeof(MapListEditor), false)));
 }
Example #20
0
 /// <inheritdoc/>
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
 }
Example #21
0
 protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
 {
     base.RegisterEditorDescriptors(editorDescriptorsFactory);
     editorDescriptorsFactory.RegisterListEditorAlias("Thumbnail", typeof(IPictureItem), true);
     editorDescriptorsFactory.RegisterListEditor("Thumbnail", typeof(IPictureItem), typeof(WinThumbnailEditor), true);
 }