public object GetEditor(Type editorBaseType)
 {
     return(SelectedObject == null ? null : TypeDescriptor.GetEditor(SelectedObject, editorBaseType));
 }
        /// <summary>
        ///  Creates an instance of the specified type in the collection.
        /// </summary>
        protected override object CreateInstance(Type type)
        {
            UITypeEditor editor = (UITypeEditor)TypeDescriptor.GetEditor(typeof(ImageListImage), typeof(UITypeEditor));

            return(editor.EditValue(Context, null));
        }
示例#3
0
 object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(this, editorBaseType, true));
 }
示例#4
0
 object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(GetType(), editorBaseType));
 }
示例#5
0
 public object GetEditor(Type editorBaseType) => TypeDescriptor.GetEditor(this, editorBaseType, true);
 /// <summary>
 /// Returns an editor of the specified type for this instance of Asset.
 /// </summary>
 /// <param name="editorBaseType">A Type that represents the editor for this object. </param>
 /// <returns>An Object of the specified type that is the editor for this object,
 /// or null if the editor cannot be found.</returns>
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(m_asset, editorBaseType, false));
 }
 object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(this.Target, editorBaseType));
 }
示例#8
0
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(_ob, _ob.GetType()));
 }
 object ICustomTypeDescriptor.GetEditor(Type type)
 {
     return(TypeDescriptor.GetEditor(this.column, type));
 }
示例#10
0
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(mCurrentSelectObject, editorBaseType));
 }
示例#11
0
 protected override object CreateInstance(Type type)
 {
     return(((UITypeEditor)TypeDescriptor.GetEditor(ImageListImageType,
                                                    typeof(UITypeEditor))).EditValue(Context, null));
 }
示例#12
0
 Object ICustomTypeDescriptor.GetEditor(Type editorBaseType) => TypeDescriptor.GetEditor(this, editorBaseType, true);
示例#13
0
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(mInstance, editorBaseType, bInherited));
 }
示例#14
0
 public object GetEditor(object totest, Type editorBase)
 {
     return(TypeDescriptor.GetEditor(totest, editorBase));
 }
示例#15
0
 object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(typeof(TextResource), editorBaseType));
 }
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(_wrappedObject, editorBaseType));
 }
示例#17
0
 object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(ConfigUnit, editorBaseType, true));
 }
 public Com2ExtendedUITypeEditor(Type baseType)
 {
     innerEditor = (UITypeEditor)TypeDescriptor.GetEditor(baseType, typeof(UITypeEditor));
 }
        internal virtual object CreateUIEditor(PropertyModelView.OptionItemPropertyDescriptor desc)
        {
            OptionItem item = desc.Item;
//      EditorAttribute editorAttribute =
//        TypeDescriptor.GetProperties(item, false)["Value"].Attributes[typeof(EditorAttribute)]
//        as EditorAttribute;

//      UITypeEditor coreEditor;
//      if (editorAttribute.EditorTypeName != "") {
//        //attribute set, get the converter that is set by the attribute
//        coreEditor = TypeDescriptor.GetProperties(item, false)["Value"].GetEditor();
//      } else {
//        //no attribute, delegate to base
//        coreEditor = TypeDescriptor.GetConverter(item.Type);
//      }

            object       editor    = TypeDescriptor.GetEditor(desc.PropertyType, typeof(UITypeEditor));
            UITypeEditor _delegate = editor as UITypeEditor;

            object editorOverride = item.GetAttribute(OptionItem.CUSTOM_TABLEITEM_EDITOR);

            if (editorOverride != null)
            {
                if (editorOverride is Type)
                {
                    try {
                        UITypeEditor o = System.Activator.CreateInstance((Type)editorOverride) as UITypeEditor;
                        if (o != null)
                        {
                            _delegate = o;
                        }
                    } catch {
                        Trace.WriteLine("Cannot create UI editor instance");
                    }
                }
                else if (editorOverride is string)
                {
                    try {
                        UITypeEditor o =
                            System.Activator.CreateInstance(Type.GetType((string)editorOverride)) as UITypeEditor;
                        if (o != null)
                        {
                            _delegate = o;
                        }
                    } catch {
                        Trace.WriteLine("Cannot create UI editor instance");
                    }
                }
                else if (editorOverride is UITypeEditor)
                {
                    _delegate = (UITypeEditor)editorOverride;
                }
                else
                {
                    Trace.WriteLine("Invalid type for UI editor attribute");
                }
            }

//      if(_delegate != null && _delegate is EnumUITypeEditor) {
//        IItemRenderer renderer = GetRenderer(item);
//        if(renderer != null) {
//          ((EnumUITypeEditor) _delegate).Renderer = renderer;
//        }
//      }

            bool supportNull  = (bool)desc.Item.GetAttribute(OptionItem.SUPPORT_NULL_VALUE_ATTRIBUTE);
            bool supportUndef = (bool)desc.Item.GetAttribute(OptionItem.SUPPORT_UNDEFINED_VALUE_ATTRIBUTE);

            if (supportNull)
            {
                return(_delegate == null
                 ? (supportUndef ? new UndefinedValueUITypeEditor() : editor)
                 :
                       new NullableUITypeEditor(_delegate));
            }
            else
            {
                return(supportUndef ? new UndefinedValueUITypeEditor(_delegate) : _delegate);
            }
        }
示例#20
0
 object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(component, editorBaseType));
 }
        public object GetEditor(Type editorBaseType)
        {
            var o = TypeDescriptor.GetEditor(this, editorBaseType, true);

            return(o);
        }
示例#22
0
        /// <summary>
        /// Forward to the normal <see cref="Image" /> editor
        /// </summary>
        /// <param name="ItemType">ignored</param>
        /// <returns>A new <see cref="Image" /></returns>
        protected override object CreateInstance(Type ItemType)
        {
            UITypeEditor editor = ((UITypeEditor)TypeDescriptor.GetEditor(typeof(Image), typeof(UITypeEditor)));

            return((Image)editor.EditValue(base.Context, null));
        }
示例#23
0
 /// <summary>
 /// Initializes a new instance of the <see cref='System.Windows.Forms.Design.ImageIndexEditor'/> class.
 /// </summary>
 public ImageIndexEditor()
 {
     // Get the type editor for images.  We use the properties on
     // this to determine if we support value painting, etc.
     imageEditor = (UITypeEditor)TypeDescriptor.GetEditor(typeof(Image), typeof(UITypeEditor));
 }
示例#24
0
 internal object GetEditor(object component, Type baseEditorType)
 {
     return(TypeDescriptor.GetEditor(component.GetType(), baseEditorType));
 }
示例#25
0
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(_sourceType, editorBaseType));
 }
示例#26
0
        object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
        {
            object o = TypeDescriptor.GetEditor(this, editorBaseType, true);

            return(o);
        }
示例#27
0
 public override object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(PropertyType, editorBaseType));
 }
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(Object.GetType(), editorBaseType));
 }
示例#29
0
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(this, editorBaseType, true));
 }
示例#30
0
 public object GetEditor(Type editorBaseType)
 {
     return(TypeDescriptor.GetEditor(_connectionStringBuilder, editorBaseType));
 }