Example #1
0
        private void LinkDefaultEditors()
        {
            // Vector2
            System.Collections.Hashtable table = new System.Collections.Hashtable();
            table.Add(typeof(Microsoft.Xna.Framework.Vector2), typeof(Vector2UITypeEditor).AssemblyQualifiedName);
            TypeDescriptor.AddEditorTable(typeof(System.Drawing.Design.UITypeEditor), table);
            // Color
            System.Collections.Hashtable table2 = new System.Collections.Hashtable();
            table.Add(typeof(Microsoft.Xna.Framework.Color), typeof(XNAColorUITypeEditor).AssemblyQualifiedName);
            TypeDescriptor.AddEditorTable(typeof(System.Drawing.Design.UITypeEditor), table2);
            // Rectangle
            System.Collections.Hashtable table3 = new System.Collections.Hashtable();
            table.Add(typeof(Microsoft.Xna.Framework.Rectangle), typeof(RectangleUITypeEditor).AssemblyQualifiedName);
            TypeDescriptor.AddEditorTable(typeof(System.Drawing.Design.UITypeEditor), table3);

            // Transform
            System.Collections.Hashtable table4 = new System.Collections.Hashtable();
            table.Add(typeof(MonoGame.Extended.Transform2), typeof(TransformUITypeEditor).AssemblyQualifiedName);
            TypeDescriptor.AddEditorTable(typeof(System.Drawing.Design.UITypeEditor), table4);

            // Vector2 List
            System.Collections.Hashtable table5 = new System.Collections.Hashtable();
            table.Add(typeof(List <Microsoft.Xna.Framework.Vector2>), typeof(CollectionEditor).AssemblyQualifiedName);
            TypeDescriptor.AddEditorTable(typeof(System.Drawing.Design.UITypeEditor), table5);

            // Vector2 List
            System.Collections.Hashtable table6 = new System.Collections.Hashtable();
            table.Add(typeof(GameObject), typeof(ItemUITypeEditor).AssemblyQualifiedName);
            TypeDescriptor.AddEditorTable(typeof(System.Drawing.Design.UITypeEditor), table6);
        }
Example #2
0
        static UITypeEditor()
        {
            // Our set of intrinsic editors.
            Hashtable intrinsicEditors = new Hashtable
            {
                // System.ComponentModel type Editors
                [typeof(DateTime)]    = $"System.ComponentModel.Design.DateTimeEditor, {AssemblyRef.SystemDesign}",
                [typeof(Array)]       = $"System.ComponentModel.Design.ArrayEditor, {AssemblyRef.SystemDesign}",
                [typeof(IList)]       = $"System.ComponentModel.Design.CollectionEditor, {AssemblyRef.SystemDesign}",
                [typeof(ICollection)] = $"System.ComponentModel.Design.CollectionEditor, {AssemblyRef.SystemDesign}",
                [typeof(byte[])]      = $"System.ComponentModel.Design.BinaryEditor, {AssemblyRef.SystemDesign}",
                [typeof(Stream)]      = $"System.ComponentModel.Design.BinaryEditor, {AssemblyRef.SystemDesign}",

                // System.Windows.Forms type Editors
                [typeof(string[])]            = $"System.Windows.Forms.Design.StringArrayEditor, {AssemblyRef.SystemDesign}",
                [typeof(Collection <string>)] = $"System.Windows.Forms.Design.StringCollectionEditor, {AssemblyRef.SystemDesign}",
                [typeof(StringCollection)]    = $"System.Windows.Forms.Design.StringCollectionEditor, {AssemblyRef.SystemDesign}",

                // System.Drawing.Design type Editors
                [typeof(Bitmap)]           = $"System.Drawing.Design.BitmapEditor, {AssemblyRef.SystemDrawingDesign}",
                [typeof(Color)]            = $"System.Drawing.Design.ColorEditor, {AssemblyRef.SystemDrawingDesign}",
                [typeof(ContentAlignment)] = $"System.Drawing.Design.ContentAlignmentEditor, {AssemblyRef.SystemDrawingDesign}",
                [typeof(Font)]             = $"System.Drawing.Design.FontEditor, {AssemblyRef.SystemDrawingDesign}",
                // No way to add Font.Name and associate it with FontNameEditor.
                [typeof(Icon)]     = $"System.Drawing.Design.IconEditor, {AssemblyRef.SystemDrawingDesign}",
                [typeof(Image)]    = $"System.Drawing.Design.ImageEditor, {AssemblyRef.SystemDrawingDesign}",
                [typeof(Metafile)] = $"System.Drawing.Design.MetafileEditor, {AssemblyRef.SystemDrawingDesign}",
            };

            // Add our intrinsic editors to TypeDescriptor.
            TypeDescriptor.AddEditorTable(typeof(UITypeEditor), intrinsicEditors);
        }
        static UITypeEditor()
        {
            Hashtable editors = new Hashtable();

            editors [typeof(Array)]       = "System.ComponentModel.Design.ArrayEditor, " + Consts.AssemblySystem_Design;
            editors [typeof(byte [])]     = "System.ComponentModel.Design.BinaryEditor, " + Consts.AssemblySystem_Design;
            editors [typeof(DateTime)]    = "System.ComponentModel.Design.DateTimeEditor, " + Consts.AssemblySystem_Design;
            editors [typeof(IList)]       = "System.ComponentModel.Design.CollectionEditor, " + Consts.AssemblySystem_Design;
            editors [typeof(ICollection)] = "System.ComponentModel.Design.CollectionEditor, " + Consts.AssemblySystem_Design;
            editors [typeof(string[])]    = "System.Windows.Forms.Design.StringArrayEditor, " + Consts.AssemblySystem_Design;
            TypeDescriptor.AddEditorTable(typeof(UITypeEditor), editors);
        }
Example #4
0
        static UITypeEditor()
        {
            Hashtable hashtable = new Hashtable();

            hashtable[typeof(Stream)]      = "System.ComponentModel.Design.BinaryEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            hashtable[typeof(DateTime)]    = "System.ComponentModel.Design.DateTimeEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            hashtable[typeof(Array)]       = "System.ComponentModel.Design.ArrayEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            hashtable[typeof(ICollection)] = "System.ComponentModel.Design.CollectionEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            hashtable[typeof(byte[])]      = "System.ComponentModel.Design.BinaryEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            hashtable[typeof(string[])]    = "System.Windows.Forms.Design.StringArrayEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            TypeDescriptor.AddEditorTable(typeof(UITypeEditor), hashtable);
            hashtable[typeof(IList)] = "System.ComponentModel.Design.CollectionEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
        }
        static UITypeEditor()
        {
            Hashtable editors = new Hashtable();

            editors [typeof(Array)]       = "System.ComponentModel.Design.ArrayEditor, System.Design";
            editors [typeof(byte [])]     = "System.ComponentModel.Design.BinaryEditor, System.Design";
            editors [typeof(DateTime)]    = "System.ComponentModel.Design.DateTimeEditor, System.Design";
            editors [typeof(IList)]       = "System.ComponentModel.Design.CollectionEditor, System.Design";
            editors [typeof(ICollection)] = "System.ComponentModel.Design.CollectionEditor, System.Design";
            editors [typeof(string[])]    = "System.Windows.Forms.Design.StringArrayEditor, System.Design";
#if !MOBILE
            TypeDescriptor.AddEditorTable(typeof(UITypeEditor), editors);
#endif
        }
Example #6
0
        static UITypeEditor()
        {
            Hashtable editors = new Hashtable();

            editors [typeof(Array)]       = "System.ComponentModel.Design.ArrayEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            editors [typeof(byte [])]     = "System.ComponentModel.Design.BinaryEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            editors [typeof(DateTime)]    = "System.ComponentModel.Design.DateTimeEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            editors [typeof(IList)]       = "System.ComponentModel.Design.CollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            editors [typeof(ICollection)] = "System.ComponentModel.Design.CollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            editors [typeof(string[])]    = "System.Windows.Forms.Design.StringArrayEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
#if !MOBILE
            TypeDescriptor.AddEditorTable(typeof(UITypeEditor), editors);
#endif
        }
Example #7
0
        /// <include file='doc\UITypeEditor.uex' path='docs/doc[@for="UITypeEditor.UITypeEditor"]/*' />
        /// <devdoc>
        ///      In this static constructor we provide default UITypeEditors to
        ///      the TypeDescriptor.
        /// </devdoc>
        static UITypeEditor()
        {
            Hashtable intrinsicEditors = new Hashtable();

            // Our set of intrinsic editors.
            intrinsicEditors[typeof(DateTime)]         = "System.ComponentModel.Design.DateTimeEditor, " + AssemblyRef.SystemDesign;
            intrinsicEditors[typeof(Array)]            = "System.ComponentModel.Design.ArrayEditor, " + AssemblyRef.SystemDesign;
            intrinsicEditors[typeof(IList)]            = "System.ComponentModel.Design.CollectionEditor, " + AssemblyRef.SystemDesign;
            intrinsicEditors[typeof(ICollection)]      = "System.ComponentModel.Design.CollectionEditor, " + AssemblyRef.SystemDesign;
            intrinsicEditors[typeof(byte[])]           = "System.ComponentModel.Design.BinaryEditor, " + AssemblyRef.SystemDesign;
            intrinsicEditors[typeof(System.IO.Stream)] = "System.ComponentModel.Design.BinaryEditor, " + AssemblyRef.SystemDesign;
            intrinsicEditors[typeof(string[])]         = "System.Windows.Forms.Design.StringArrayEditor, " + AssemblyRef.SystemDesign;

            // Add our intrinsic editors to TypeDescriptor.
            //
            TypeDescriptor.AddEditorTable(typeof(UITypeEditor), intrinsicEditors);
        }