private void AddType() { if (this.assemblyBrowser.SelectedNode is TypeNode) { TypeNode typeNode = (TypeNode)this.assemblyBrowser.SelectedNode; // NOTE: Allow multiple instances of the same type (this is probably common) //if (!this.typeDocuments.ContainsKey (typeNode.Type)) //{ WrappedType wrappedType = new WrappedType(typeNode.Type); WrappingOptions wrappingOptions = new WrappingOptions(wrappedType); wrappingOptions.MethodsListViewSelectedIndexChanged += this.OnListViewSelectedIndexChanged; wrappingOptions.PropertiesListViewSelectedIndexChanged += this.OnListViewSelectedIndexChanged; wrappingOptions.EventsListViewSelectedIndexChanged += this.OnListViewSelectedIndexChanged; WrappedTypeDocument document = new WrappedTypeDocument(wrappingOptions); document.SuspendLayout(); document.Guid = new Guid("A694E86E-73C0-417e-B85D-A04361C3CDC4"); document.SizeChanged += this.OnDockControlSizeChanged; document.PerformLayout(); this.documentContainer.AddDocument(document); //this.typeDocuments[typeNode.Type] = document; //} //this.typeDocuments[typeNode.Type].Activate (); document.Activate(); } }
private void OnDocumentContainerControlRemoved(object sender, ControlEventArgs e) { WrappedTypeDocument document = (WrappedTypeDocument)e.Control; this.wrapperClass.WrappedTypes.Remove(document.WrappingOptions.WrappedType); }