Пример #1
0
        /// <summary>
        /// Gets a UI type editor for the given property descriptor and context</summary>
        /// <param name="descriptor">Property descriptor</param>
        /// <param name="context">Type descriptor context</param>
        /// <returns>UI type editor for the given property descriptor and context</returns>
        public static UITypeEditor GetUITypeEditor(
            PropertyDescriptor descriptor,
            ITypeDescriptorContext context)
        {
            UITypeEditor editor = descriptor.GetEditor(typeof(UITypeEditor)) as UITypeEditor;
            if (editor == null)
            {
                if (StandardValuesUIEditor.CanCreateStandardValues(descriptor, context))
                {
                    editor = new StandardValuesUIEditor(descriptor);
                }
                else
                {
                    Type type = descriptor.PropertyType;
                    editor = TypeDescriptor.GetEditor(type, typeof(UITypeEditor)) as UITypeEditor;
                }
            }

            return editor;
        }
Пример #2
0
        /// <summary>
        /// Gets a UI type editor for the given property descriptor and context</summary>
        /// <param name="descriptor">Property descriptor</param>
        /// <param name="context">Type descriptor context</param>
        /// <returns>UI type editor for the given property descriptor and context</returns>
        public static UITypeEditor GetUITypeEditor(
            PropertyDescriptor descriptor,
            ITypeDescriptorContext context)
        {
            UITypeEditor editor = descriptor.GetEditor(typeof(UITypeEditor)) as UITypeEditor;

            if (editor == null)
            {
                if (StandardValuesUIEditor.CanCreateStandardValues(descriptor, context))
                {
                    editor = new StandardValuesUIEditor(descriptor);
                }
                else
                {
                    Type type = descriptor.PropertyType;
                    editor = TypeDescriptor.GetEditor(type, typeof(UITypeEditor)) as UITypeEditor;
                }
            }

            return(editor);
        }
Пример #3
0
 public StandardValuesListBox(StandardValuesUIEditor editor)
 {
     m_editor = editor;
     base.BorderStyle = BorderStyle.None;
     base.DrawMode = DrawMode.OwnerDrawVariable;
 }
Пример #4
0
 public StandardValuesListBox(StandardValuesUIEditor editor)
 {
     m_editor         = editor;
     base.BorderStyle = BorderStyle.None;
     base.DrawMode    = DrawMode.OwnerDrawVariable;
 }