Ext.Net.FitLayoutDesigner.AddItem C# (CSharp) Method

AddItem() private method

private AddItem ( Type type ) : void
type System.Type
return void
        internal void AddItem(Type type)
        {
            IDesignerHost host = (IDesignerHost) GetService(typeof (IDesignerHost));

            if (host != null)
            {
                
                    PanelBase item = (PanelBase) host.CreateComponent(type);

                    if (item != null)
                    {
                        InitializeItem(item);
                        IComponentChangeService changeService =
                            (IComponentChangeService) GetService(typeof (IComponentChangeService));

                        try
                        {
                            changeService.OnComponentChanging(this.fitLayout,
                                                              TypeDescriptor.GetProperties(this.fitLayout)["Items"]);
                            this.fitLayout.Items.Clear();
                            this.fitLayout.Items.Add(item);
                        }
                        finally
                        {
                            changeService.OnComponentChanged(this.fitLayout,
                                                             TypeDescriptor.GetProperties(this.fitLayout)["Items"], null,
                                                             null);
                        }
                    }
                
                this.UpdateDesignTimeHtml();
                //this.RaiseComponentChanged(TypeDescriptor.GetProperties(this.fitLayout)["Controls"],null,null);
                this.Tag.SetDirty(true);

                //this.Refresh();
            }
        }