private void OnComponentsCreating(object sender, ToolboxComponentsCreatingEventArgs e) { // Displays ComponentsCreating event information on the Console. Console.WriteLine("Name of the class of the root component of " + "the designer host receiving new components: " + e.DesignerHost.RootComponentClassName); }
//</Snippet3> //<Snippet4> public ToolboxComponentsCreatingEventArgs CreateToolboxComponentsCreatingEventArgs(System.ComponentModel.Design.IDesignerHost host) { ToolboxComponentsCreatingEventArgs e = new ToolboxComponentsCreatingEventArgs(host); // The designer host of the document receiving the components e.DesignerHost return(e); }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// toolboxcomponentscreatingeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this ToolboxComponentsCreatingEventHandler toolboxcomponentscreatingeventhandler, Object sender, ToolboxComponentsCreatingEventArgs e, AsyncCallback callback) { if (toolboxcomponentscreatingeventhandler == null) { throw new ArgumentNullException("toolboxcomponentscreatingeventhandler"); } return(toolboxcomponentscreatingeventhandler.BeginInvoke(sender, e, callback, null)); }
public void Ctor_IDesignerHost(IDesignerHost host) { var e = new ToolboxComponentsCreatingEventArgs(host); Assert.Equal(host, e.DesignerHost); }