예제 #1
0
        // Displays the UI for value selection.
        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)
            {
                // Display an angle selection control and retrieve the value.
                IDControl idControl = new IDControl((ushort)value, (SETItem)context.Instance, edSvc);
                edSvc.DropDownControl(idControl);
                return(idControl.value);
            }
            return(value);
        }
예제 #2
0
 // Displays the UI for value selection.
 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)
     {
         // Display an angle selection control and retrieve the value.
         IDControl idControl = new IDControl((ushort)value, edSvc);
         edSvc.DropDownControl(idControl);
         return idControl.value;
     }
     return value;
 }