示例#1
0
 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);
 }
示例#2
0
        //</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);
        }
示例#3
0
        /// <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));
        }
示例#4
0
        public void Ctor_IDesignerHost(IDesignerHost host)
        {
            var e = new ToolboxComponentsCreatingEventArgs(host);

            Assert.Equal(host, e.DesignerHost);
        }