/// <summary> /// Use this if we're looking at a part document. But it's also used were we're looking /// at an assembly because we use the same properties. /// </summary> /// <param name="md">A ModelDoc2 object.</param> private void SetupPart(ModelDoc2 md) { // Blow out any existing controls, and dump events. ClearControls(this); // Fill everything so it stretches. DockStyle d = DockStyle.Fill; // New model handler with current property (aquired in this.Connect...()) mrb = new ModelRedbrick(ref prop); // If it's not docked, dock it. mrb.Dock = d; // put the redbrick in this control Controls.Add(mrb); // Dock this control in the taskpane. Dock = d; foreach (Control item in mrb.Controls) { item.Dock = d; //item.ResumeLayout(true); } // Gonna use access to all these controls. ds = mrb.aDepartmentSelector; cs = mrb.aConfigurationSpecific; gp = mrb.aGeneralProperties; mp = mrb.aMachineProperties; op = mrb.aOps; // Part-related events. ConnectPartEvents(md); //ResumeLayout(true); // Boom, we're set up. PartSetup = true; }