Esempio n. 1
0
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                IWindowsFormsEditorService editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
                if (editorService == null)
                {
                    return(value);
                }

                if (m_ui == null)
                {
                    this.m_ui = new FlagsEditorUI <T>();
                }

                m_ui.Value = (T)value;

                editorService.DropDownControl(m_ui);
                T result = this.m_ui.Value;

                value = result;
            }

            return(value);
        }
Esempio n. 2
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (m_ui != null)
         {
             m_ui.Dispose();
             m_ui = null;
         }
     }
 }