System.Windows.Forms.Design.ComponentEditorPage.GetSelectedComponent()

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

2 Examples 7

1. Example

Project: referencesource
Source File: MobileComponentEditorPage.cs
protected MobileControl GetBaseControl()
        {
            if (_control != null)
            {
                return _control;
            }

            IComponent selectedComponent = GetSelectedComponent();
            Debug.Assert(selectedComponent is MobileControl);
            _control = (MobileControl)selectedComponent;

            return _control;
        }

2. Example

Project: referencesource
Source File: MobileComponentEditorPage.cs
protected ControlDesigner GetBaseDesigner() 
        {
            if (_designer != null)
            {
                return _designer;
            }

            IDesignerHost designerHost = 
                (IDesignerHost)DesignerSite.GetService(typeof(IDesignerHost));
            Debug.Assert(designerHost != null, "Expected a designer host.");

            _designer = (ControlDesigner)designerHost.GetDesigner(GetSelectedComponent());

            Debug.Assert(_designer != null, "Expected a designer for the selected component");

            return _designer;
        }