System.Windows.Forms.Design.IWindowsFormsEditorService.DropDownControl(System.Windows.Forms.Control)

Here are the examples of the csharp api class System.Windows.Forms.Design.IWindowsFormsEditorService.DropDownControl(System.Windows.Forms.Control) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

73 Examples 7

1. Example

Project: DotSpatial
Source File: CharacterCodeEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            ICharacterSymbol symbol = context?.Instance as ICharacterSymbol;
            IWindowsFormsEditorService dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            CharacterControl cc = new CharacterControl(dialogProvider, symbol);
            dialogProvider?.DropDownControl(cc);
            return cc.SelectedChar;
        }

2. Example

View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _layer = context?.Instance as ILayer;
            IWindowsFormsEditorService dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            DynamicVisibilityControl dvc = new DynamicVisibilityControl(dialogProvider, _layer);
            dialogProvider?.DropDownControl(dvc);
            _layer?.Invalidate();
            return dvc.UseDynamicVisibility;
        }

3. Example

Project: KeeAnywhere
Source File: DropDownImages.cs
View license
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
		{	
			edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
			imagesContainer.ImageList = imageList;
			
				if( edSvc != null )
				{
					edSvc.DropDownControl(imagesContainer);
					if(imagesContainer.SelectedItem != string.Empty)
						return imagesContainer.SelectedItem.ToString();
					
				}
			
			return value;
		}

4. Example

View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider == null) return value;
            _editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            if (_editorService == null) return value;

            var credentialManager = Runtime.CredentialProviderCatalog;

            var listBox = new CredentialRecordListBox(credentialManager.GetCredentialRecords());
            listBox.SelectedValueChanged += ListBoxOnSelectedValueChanged;

            _editorService.DropDownControl(listBox);
            if (listBox.SelectedItem == listBox.NoneSelection)
                return null;
            if (listBox.SelectedItem == listBox.AddNewSelection)
            {
                //var newCred = new CredentialRecord();
                //credentialManager.Add(newCred);
                //return newCred;
            }

            return listBox.SelectedItem ?? value;
        }

5. Example

Project: MultiversePlatform
Source File: EventEditor.cs
View license
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

                if (edSvc == null)
                {
                    return value;
                }

                if (this.eventEditorUC == null)
                {
                    BaseControl baseControl = (BaseControl)context.Instance;
                    FrameType frameType = (FrameType)baseControl.SerializationObject;

                    this.eventEditorUC = new EventEditorUserControl(
                        frameType, 
                        context.PropertyDescriptor.Name,
                        baseControl.DesignerLoader,
                        edSvc);
                }

                //this.dockUI.Start(edSvc, value);
                this.eventEditorUC.Script = value as string;
                edSvc.DropDownControl(this.eventEditorUC);
                return this.eventEditorUC.Script;

                //value = this.dockUI.Value;
                //this.dockUI.End();
            }

            return value;
        }

6. Example

View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            if (editorService == null)
            {
                return value;
            }
            standardValueEditorUI.SetData(context, editorService, value);
            editorService.DropDownControl(standardValueEditorUI);
            value = standardValueEditorUI.GetValue();
            return value;
        }

7. Example

Project: ATF
Source File: BoundedFloatEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editorService =
                provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            if (editorService != null)
            {
                if (!(value is float))
                    value = m_min;

                FloatInputControl floatInputControl = new FloatInputControl((float)value, m_min, m_max);
                editorService.DropDownControl(floatInputControl);
                // be careful to return the same object if the value didn't change
                if (!floatInputControl.Value.Equals(value))
                    value = floatInputControl.Value;
            }

            return value;
        }

8. Example

Project: ATF
Source File: BoundedIntEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editorService =
                provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            if (editorService != null)
            {
                if (!(value is int))
                    value = m_min;

                IntInputControl intInputControl = new IntInputControl((int)value, m_min, m_max);
                editorService.DropDownControl(intInputControl);
                // be careful to return the same object if the value didn't change
                if (!intInputControl.Value.Equals(value))
                    value = intInputControl.Value;
            }

            return value;
        }

9. Example

Project: ATF
Source File: NumericMatrixEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editorService =
                provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;

            if (editorService != null)
            {
                Sce.Atf.Controls.NumericMatrixControl control =
                    new Sce.Atf.Controls.NumericMatrixControl(m_numericType, m_rows, m_columns);

                if (value != null)
                    control.Value = value;

                editorService.DropDownControl(control);
                value = control.LastEdit; // kind of tricky way to ensure that we don't create a new object with the same value
            }

            return value;
        }

10. Example

Project: ATF
Source File: NumericTupleEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editorService =
                provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;

            if (editorService != null)
            {
                Sce.Atf.Controls.NumericTupleControl control =
                    new Sce.Atf.Controls.NumericTupleControl(m_numericType, m_names);
                control.HideAxisLabel = HideAxisLabel;
                control.SetLabelBackColors(m_labelColors);
                if (value != null)
                    control.Value = value;

                editorService.DropDownControl(control);
                value = control.LastEdit; // kind of tricky way to ensure that we don't create a new object with the same value
            }

            return value;
        }

11. Example

Project: Gorgon
Source File: WriteMaskTypeEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			var editorSerivce = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
			WriteMaskEditor maskEditor = null;

		    if (value == null)
		    {
		        value = ColorWriteMaskFlags.All;
		    }

			try
			{
			    maskEditor = new WriteMaskEditor((ColorWriteMaskFlags)value)
			                 {
			                     Service = editorSerivce,
			                     BackColor = DarkFormsRenderer.DarkBackground,
			                     ForeColor = DarkFormsRenderer.ForeColor,
			                     BorderStyle = BorderStyle.None
			                 };

			    editorSerivce.DropDownControl(maskEditor);

				return maskEditor.WriteMask != (ColorWriteMaskFlags)value ? maskEditor.WriteMask : value;
			}
			finally
			{
			    if (maskEditor != null)
			    {
			        maskEditor.Dispose();
			    }
			}
		}

12. Example

Project: Gorgon
Source File: AnchorTypeEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			var editorSerivce = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
			var content = (GorgonSpriteContent)((ContentTypeDescriptor)context.Instance).Content;

			if (value == null)
			{
				return content.Anchor;
			}

			using (var editor = new SpriteAnchorEditor(content.Size, editorSerivce))
			{
				editor.SpriteAnchor = (Point)value;
				editorSerivce.DropDownControl(editor);

				return editor.SpriteAnchor;
			}
		}

13. Example

Project: ultraviolet
Source File: MatrixEditor.cs
View license
public override Object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)
        {
            if (provider != null)
            {
                editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            }

            if (editorService != null)
            {
                var control = new MatrixEditorControl((Matrix)value, editorService);

                editorService.DropDownControl(control);

                value = control.Matrix;
            }

            return value;
        }

14. Example

Project: ultraviolet
Source File: RadiansEditor.cs
View license
public override Object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)
        {
            if (provider != null)
            {
                editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            }

            if (editorService != null)
            {
                var control = new RadiansEditorControl((Radians)value, editorService);

                editorService.DropDownControl(control);

                value = control.Radians;
            }

            return value;
        }

15. Example

Project: ccmaps-net
Source File: DynamicTypeDescriptor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) {
			if (provider != null) {
				IWindowsFormsEditorService editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
				if (editorService == null)
					return value;

				m_ui.SetData(context, editorService, value);

				editorService.DropDownControl(m_ui);

				value = m_ui.GetValue();

			}

			return value;
		}

16. Example

Project: Krypton
Source File: PaletteDrawBordersEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, 
                                         IServiceProvider provider, 
                                         object value)
        {
            if ((context != null) && (provider != null) && (value != null))
            {
                // Grab the service needed to show the drop down
                IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

                if (service != null)
                {
                    // Create the custom control used to edit value
                    PaletteDrawBordersSelector selector = new PaletteDrawBordersSelector();

                    // Populate selector with starting value
                    selector.Value = (PaletteDrawBorders)value;

                    // Show as a drop down control
                    service.DropDownControl(selector);

                    // Return the updated value
                    return selector.Value;
                }
            }

            return base.EditValue(context, provider, value);
        }

17. Example

Project: MapleShark
Source File: DockAreasEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
		{
			if (m_ui == null)
				m_ui = new DockAreasEditor.DockAreasEditorControl();

			m_ui.SetStates((DockAreas)value);

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
			edSvc.DropDownControl(m_ui);

			return m_ui.DockAreas;
		}

18. Example

Project: dockpanelsuite
Source File: DockAreasEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (m_ui == null)
                m_ui = new DockAreasEditor.DockAreasEditorControl();

            m_ui.SetStates((DockAreas)value);

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            edSvc.DropDownControl(m_ui);

            return m_ui.DockAreas;
        }

19. Example

Project: DotSpatial
Source File: LayoutMapEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            if (context == null) return null;

            LayoutScaleBar scaleBar = context.Instance as LayoutScaleBar;
            LayoutLegend legend = context.Instance as LayoutLegend;
            LayoutControl lc = null;
            if (scaleBar?.LayoutControl != null)
                lc = scaleBar.LayoutControl;
            else if (legend?.LayoutControl != null)
                lc = legend.LayoutControl;

            ListBox lb = new ListBox();
            if (lc == null) return null;

            foreach (LayoutElement le in lc.LayoutElements.FindAll(o => o is LayoutMap))
            {
                lb.Items.Add(le);
            }

            lb.SelectedItem = value;
            lb.SelectedValueChanged += LbSelectedValueChanged;
            _dialogProvider?.DropDownControl(lb);
            return lb.SelectedItem;
        }

20. Example

Project: DotSpatial
Source File: AngleEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            AngleControl ac = new AngleControl
            {
                Angle = Convert.ToInt32(value)
            };
            ac.AngleChosen += AcAngleChosen;
            _dialogProvider?.DropDownControl(ac);
            return (double)ac.Angle;
        }

21. Example

Project: DotSpatial
Source File: AzimuthAngleEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            AngleControl ac = new AngleControl
            {
                StartAngle = 90,
                Clockwise = true,
                Angle = Convert.ToInt32(value)
            };
            ac.AngleChosen += AcAngleChosen;
            _dialogProvider?.DropDownControl(ac);
            return (double)ac.Angle;
        }

22. Example

Project: DotSpatial
Source File: OpacityEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            RampSlider rs = new RampSlider
            {
                Maximum = 1,
                Minimum = 0,
                MaximumColor = Color.SteelBlue,
                MinimumColor = Color.Transparent,
                RampText = "Opacity",
                RampTextBehindRamp = true,
                Value = Convert.ToDouble(value),
                ShowValue = false,
                Width = 75,
                Height = 50
            };
            rs.ValueChanged += RsValueChanged;
            _dialogProvider?.DropDownControl(rs);
            return (float)rs.Value;
        }

23. Example

Project: DotSpatial
Source File: ZenithEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            RampSlider rs = new RampSlider
            {
                Maximum = 90,
                Minimum = 0,
                MaximumColor = Color.SteelBlue,
                MinimumColor = Color.Transparent,
                RampText = "Zenith",
                RampTextBehindRamp = false,
                Value = Convert.ToDouble(value),
                ShowValue = false,
                Width = 75,
                Height = 50
            };
            rs.ValueChanged += RsValueChanged;
            _dialogProvider?.DropDownControl(rs);
            return (float)rs.Value;
        }

24. Example

View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                this.editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            }

            if (this.editorService != null)
            {
                if (value != null)
                {
                    picker.Value = Convert.ToDateTime(value);
                }
                this.editorService.DropDownControl(picker);
                value = new DateTime?(picker.Value);
            }

            return value;
        }

25. Example

Project: ArnoldSimulator
Source File: DockAreasEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
        {
            if (m_ui == null)
                m_ui = new DockAreasEditor.DockAreasEditorControl();

            m_ui.SetStates((DockAreas)value);

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
            edSvc.DropDownControl(m_ui);

            return m_ui.DockAreas;
        }

26. Example

Project: lua-tilde
Source File: DockAreasEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
		{
			if (m_ui == null)
				m_ui = new DockAreasEditor.DockAreasEditorControl();

			m_ui.SetStates((DockAreas)value);

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
			edSvc.DropDownControl(m_ui);

			return m_ui.DockAreas;
		}

27. Example

Project: fdotoolbox
Source File: OgrEsriPgb.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                if (editorService == null)
                    editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

                editorService.DropDownControl(box);

                if (box.SelectedItem != null)
                {
                    return box.SelectedItem;
                }
            }
            return base.EditValue(context, provider, value);
        }

28. Example

View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
        {
            if (m_ui == null)
                m_ui = new DockAreasEditor.DockAreasEditorControl();

            m_ui.SetStates((DockAreas)value);

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
            edSvc.DropDownControl(m_ui);

            return m_ui.DockAreas;
        }

29. Example

View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			if (context != null && context.Instance != null && provider != null)
			{
				IWindowsFormsEditorService wesEditor = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
				if (wesEditor != null)
				{
					Enum e = (Enum)Convert.ChangeType(value, context.PropertyDescriptor.PropertyType);
					m_clbFlagEnum.EnumValue = e;
					wesEditor.DropDownControl(m_clbFlagEnum);
					return m_clbFlagEnum.EnumValue;
				}
			}
			return null;
		}

30. Example

Project: nHydrate
Source File: EntityFieldEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			var retval = Guid.Empty;
			try
			{
				edSvc = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

				var indexColumn = context.Instance as IndexColumn;
				var field = indexColumn.Index.Entity.Fields.FirstOrDefault(x => x.Id == indexColumn.FieldID);
				var fieldList = indexColumn.Index.Entity.Fields.OrderBy(x => x.Name).ToList();

				//Create the list box
				var newBox = new System.Windows.Forms.ListBox();
				newBox.Click += new EventHandler(newBox_Click);
				newBox.IntegralHeight = false;

				newBox.Items.AddRange(fieldList.Select(x => x.Name).ToArray());
				if (field != null)
					newBox.SelectedIndex = fieldList.IndexOf(field);

				edSvc.DropDownControl(newBox);
				if ((indexColumn != null) && (newBox.SelectedIndex != -1))
					retval = fieldList[newBox.SelectedIndex].Id;

			}
			catch (Exception ex) { }
			return retval;
		}

31. Example

View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			Reference retval = null;
			try
			{
				edSvc = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

				var table = (Table)context.Instance;
				var root = (ModelRoot)table.Root;
				var referenceCollection = table.Columns;

				//Create the list box 
				var newBox = new System.Windows.Forms.ListBox();
				newBox.Click += new EventHandler(newBox_Click);
				newBox.IntegralHeight = false;

				newBox.Items.Add("(Not Set)");
				foreach(Reference reference in referenceCollection)
				{
					var column = ((ModelRoot)reference.Root).Database.Columns.GetById(reference.Ref)[0];
					newBox.Items.Add(column);
				}

				edSvc.DropDownControl(newBox);
				if((newBox.SelectedIndex > 0) && (newBox.SelectedItem != null))
					retval = ((Column)newBox.SelectedItem).CreateRef();

			}
			catch(Exception ex) { }
			return retval;
		}

32. Example

Project: Honeycombs
Source File: TrackBarValueEditor.cs
View license
public override object EditValue( ITypeDescriptorContext context, IServiceProvider provider, object value )
		{
			if( context != null && provider != null )
			{
				editorService = (IWindowsFormsEditorService)provider.GetService( typeof( IWindowsFormsEditorService ) );
				if( editorService != null )
				{
					// Create a new trackbar and set it up.
					TrackBar trackBar = new TrackBar();
					trackBar.ValueChanged += new EventHandler( this.ValueChanged );
					trackBar.MouseLeave += new EventHandler( this.MouseLeave );
					trackBar.Minimum = 0;
					trackBar.Maximum = 100;
					trackBar.TickStyle = TickStyle.None;

					// Get the low/high values.
					PropertyDescriptor prop = context.PropertyDescriptor;
					RangeAttribute ra = prop.Attributes[typeof( RangeAttribute )] as RangeAttribute;
					valueLow = ra.Low;
					valueHigh = ra.High;

					// Set the corresponding trackbar value.
					double percent = ( System.Convert.ToDouble( value ) - valueLow ) / ( valueHigh - valueLow );
					trackBar.Value = (int)( 100 * percent );

					// Show the control.
					editorService.DropDownControl( trackBar );

					// Here is the output value.
					value = valueLow + ( (double)trackBar.Value / 100 ) * ( valueHigh - valueLow );
				}
			}

			return value;
		}

33. Example

Project: WorldSmith
Source File: FlagCheckListBox.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null
                && context.Instance != null
                && provider != null)
            {

                IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

                if (edSvc != null)
                {

                    Enum e = (Enum)Convert.ChangeType(value, context.PropertyDescriptor.PropertyType);
                    flagEnumCB.EnumValue = e;
                    edSvc.DropDownControl(flagEnumCB);
                    return flagEnumCB.EnumValue;

                }
            }
            return null;
        }

34. Example

Project: Gorgon
Source File: AlphaChannelEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			var editorSerivce = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
			ControlColorPicker colorPicker = null;

			Debug.Assert(value != null, "Value is NULL.");

			try
			{
				colorPicker = new ControlColorPicker
				              {
					              EditorService = editorSerivce,
					              AlphaOnly = true,
					              CurrentColor = (Color)value
				              };
				editorSerivce.DropDownControl(colorPicker);

				return colorPicker.CurrentColor;
			}
			finally
			{
				if (colorPicker != null)
					colorPicker.Dispose();
			}
		}

35. Example

Project: Gorgon
Source File: RGBAEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			Debug.Assert(value != null, "Value is NULL.");

			var editorSerivce = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
			ControlColorPicker colorPicker = null;

			try
			{
				Color color = value is GorgonColor ? (Color)(GorgonColor)value : (Color)value;
				colorPicker = new ControlColorPicker
				              {
					              EditorService = editorSerivce,
					              CurrentColor = color
				              };
				editorSerivce.DropDownControl(colorPicker);

				return colorPicker.CurrentColor;
			}
			finally
			{
				if (colorPicker != null)
					colorPicker.Dispose();
			}
		}

36. Example

Project: ynoteclassic
Source File: DockAreasEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
        {
            if (m_ui == null)
                m_ui = new DockAreasEditorControl();

            m_ui.SetStates((DockAreas) value);

            IWindowsFormsEditorService edSvc =
                (IWindowsFormsEditorService) sp.GetService(typeof (IWindowsFormsEditorService));
            edSvc.DropDownControl(m_ui);

            return m_ui.DockAreas;
        }

37. Example

Project: SquareOne
Source File: DockAreasEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
        {
            if (m_ui == null)
                m_ui = new DockAreasEditor.DockAreasEditorControl();

            m_ui.SetStates((DockAreas)value);

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
            edSvc.DropDownControl(m_ui);

            return m_ui.DockAreas;
        }

38. Example

Project: xenadmin
Source File: CommandEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && provider != null)
            {
                IWindowsFormsEditorService editor = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;

                if (editor != null)
                {
                    CommandEditorControl ctrl = new CommandEditorControl(typeof(TCommand), value as Command);
                    ctrl.Closed += delegate { editor.CloseDropDown(); };
                    editor.DropDownControl(ctrl);
                    return ctrl.SelectedCommand ?? value;
                }
            }

            return null;
        }

39. Example

Project: ceptr
Source File: DockAreasEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
		{
			if (m_ui == null)
				m_ui = new DockAreasEditor.DockAreasEditorControl();

			m_ui.SetStates((DockAreas)value);

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
			edSvc.DropDownControl(m_ui);

			return m_ui.DockAreas;
		}

40. Example

Project: HOPE
Source File: DockAreasEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
		{
			if (m_ui == null)
				m_ui = new DockAreasEditor.DockAreasEditorControl();

			m_ui.SetStates((DockAreas)value);

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
			edSvc.DropDownControl(m_ui);

			return m_ui.DockAreas;
		}

41. Example

Project: tesvsnip
Source File: ballontooltip.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider == null)
                return value;

            var edSvc = provider.GetService(typeof (IWindowsFormsEditorService)) as IWindowsFormsEditorService;

            if (edSvc == null)
                return value;

            var textBox = new MultilineTextBox();
            textBox.BorderStyle = BorderStyle.None;
            textBox.Size = new Size(150, 80);
            textBox.Text = value == null ? string.Empty : value.ToString();

            edSvc.DropDownControl(textBox);

            if (!textBox.Cancelled)
                value = textBox.Text;

            textBox.Dispose();

            return value;
        }

42. Example

Project: falloutsnip
Source File: ballontooltip.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider == null)
                return value;

            var edSvc = provider.GetService(typeof (IWindowsFormsEditorService)) as IWindowsFormsEditorService;

            if (edSvc == null)
                return value;

            var textBox = new MultilineTextBox();
            textBox.BorderStyle = BorderStyle.None;
            textBox.Size = new Size(150, 80);
            textBox.Text = value == null ? string.Empty : value.ToString();

            edSvc.DropDownControl(textBox);

            if (!textBox.Cancelled)
                value = textBox.Text;

            textBox.Dispose();

            return value;
        }

43. Example

Project: MapViewer
Source File: BrushPen.DesignTime.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            // For future reference. When we are running within the IDE, IDesignerHost will be non-null, e.g.
            //IDesignerHost host = provider.GetService(typeof(IDesignerHost)) as IDesignerHost;

            // We need editor service otherwise we can't do anything
            IWindowsFormsEditorService wfes = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            if (wfes == null)
                return value;

            BrushForm form = new BrushForm();
            form.SetBrush(value as IBrushData);
            wfes.DropDownControl(form);
            return form.GetBrushData();
        }

44. Example

Project: MapViewer
Source File: BrushPen.DesignTime.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            // For future reference. When we are running within the IDE, IDesignerHost will be non-null, e.g.
            //IDesignerHost host = provider.GetService(typeof(IDesignerHost)) as IDesignerHost;

            // We need editor service otherwise we can't do anything
            IWindowsFormsEditorService wfes = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            if (wfes == null)
                return value;

            PenForm form = new PenForm();
            form.SetPenData(value as PenData);
            wfes.DropDownControl(form);
            return form.GetPenData();
        }

45. Example

Project: KeeAnywhere
Source File: DropDownDrawModes.cs
View license
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			DrawModeList.Items.Clear();
			DrawModeList.Items.AddRange(List);
			DrawModeList.Height=DrawModeList.PreferredHeight;
			edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
			if( edSvc != null )
			{
				edSvc.DropDownControl( DrawModeList );
				return DrawModeList.SelectedItem;

			}
			return value;
		}

46. Example

Project: referencesource
Source File: SetStateDesigner.cs
View license
public override object EditValue(ITypeDescriptorContext typeDescriptorContext, IServiceProvider serv/n ..... /n //View Source file for more details /n }

47. Example

Project: MvvmFx
Source File: DropDownTypeEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && context.Container != null && provider != null)
            {
                _editorService = provider.GetService(typeof (IWindowsFormsEditorService)) as IWindowsFormsEditorService;
                if (_editorService != null)
                {
                    using (var listBox = new ListBox())
                    {
                        listBox.BorderStyle = BorderStyle.None;

                        FillListBox(listBox, context, value);
                        listBox.SelectedIndexChanged += ListBox_SelectedIndexChanged;

                        _editorService.DropDownControl(listBox);

                        if (listBox.SelectedItem != null)
                        {
                            value = GetValueFromListItem(context, listBox.SelectedItem);
                        }
                        listBox.SelectedIndexChanged -= ListBox_SelectedIndexChanged;
                    }
                    _editorService = null;
                }
            }
            return value;
        }

48. Example

Project: MvvmFx
Source File: DropDownTypeEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && context.Container != null && provider != null)
            {
                _editorService = provider.GetService(typeof (IWindowsFormsEditorService)) as IWindowsFormsEditorService;
                if (_editorService != null)
                {
                    using (var listBox = new ListBox())
                    {
                        listBox.BorderStyle = BorderStyle.None;

                        FillListBox(listBox, context, value);
                        listBox.SelectedIndexChanged += ListBox_SelectedIndexChanged;

                        _editorService.DropDownControl(listBox);

                        if (listBox.SelectedItem != null)
                        {
                            value = GetValueFromListItem(context, listBox.SelectedItem);
                        }
                        listBox.SelectedIndexChanged -= ListBox_SelectedIndexChanged;
                    }
                    _editorService = null;
                }
            }
            return value;
        }

49. Example

Project: MvvmFx
Source File: DropDownTypeEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && context.Container != null && provider != null)
            {
                _editorService = provider.GetService(typeof (IWindowsFormsEditorService)) as IWindowsFormsEditorService;
                if (_editorService != null)
                {
                    using (var listBox = new ListBox())
                    {
                        listBox.BorderStyle = BorderStyle.None;

                        FillListBox(listBox, context, value);
                        listBox.SelectedIndexChanged += ListBox_SelectedIndexChanged;

                        _editorService.DropDownControl(listBox);

                        if (listBox.SelectedItem != null)
                        {
                            value = GetValueFromListItem(context, listBox.SelectedItem);
                        }
                        listBox.SelectedIndexChanged -= ListBox_SelectedIndexChanged;
                    }
                    _editorService = null;
                }
            }
            return value;
        }

50. Example

Project: MvvmFx
Source File: DropDownTypeEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && context.Container != null && provider != null)
            {
                _editorService = provider.GetService(typeof (IWindowsFormsEditorService)) as IWindowsFormsEditorService;
                if (_editorService != null)
                {
                    using (var listBox = new ListBox())
                    {
                        listBox.BorderStyle = BorderStyle.None;

                        FillListBox(listBox, context, value);
                        listBox.SelectedIndexChanged += ListBox_SelectedIndexChanged;

                        _editorService.DropDownControl(listBox);

                        if (listBox.SelectedItem != null)
                        {
                            value = GetValueFromListItem(context, listBox.SelectedItem);
                        }
                        listBox.SelectedIndexChanged -= ListBox_SelectedIndexChanged;
                    }
                    _editorService = null;
                }
            }
            return value;
        }