コード例 #1
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     // Uses the IWindowsFormsEditorService to display a
     // drop-down UI in the Properties window.
     IWindowsFormsEditorService edSvc =
         (IWindowsFormsEditorService) provider.GetService(typeof (IWindowsFormsEditorService));
     if (edSvc != null) {
         MaterialTreeViewEditorControl view = new MaterialTreeViewEditorControl();
         // Display an angle selection control and retrieve the value.
         edSvc.DropDownControl(view);
         if (view.SelectedMaterial != null) {
             return view.SelectedMaterial;
         }
     }
     return value;
 }
コード例 #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            // Uses the IWindowsFormsEditorService to display a
            // drop-down UI in the Properties window.
            IWindowsFormsEditorService edSvc =
                (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc != null)
            {
                MaterialTreeViewEditorControl view = new MaterialTreeViewEditorControl();
                // Display an angle selection control and retrieve the value.
                edSvc.DropDownControl(view);
                if (view.SelectedMaterial != null)
                {
                    return(view.SelectedMaterial);
                }
            }
            return(value);
        }