private void PopulateDesignerContainerItems(XmlNode tabNode, DesignerContainerTab DesignerContainerTab) { if (tabNode == null) { return; } XmlNode DesignerContainerItemCollectionNode = tabNode[Strings.DesignerContainerItemCollection]; if (DesignerContainerItemCollectionNode == null) { return; } XmlNodeList DesignerContainerItemNodeList = DesignerContainerItemCollectionNode.ChildNodes; if (DesignerContainerItemNodeList == null) { return; } DesignerContainerItemCollection DesignerContainerItems = new DesignerContainerItemCollection(); foreach (XmlNode DesignerContainerItemNode in DesignerContainerItemNodeList) { if (DesignerContainerItemNode == null) { continue; } XmlNode typeNode = DesignerContainerItemNode[Strings.Type]; if (typeNode == null) { continue; } bool found = false; System.Reflection.Assembly[] loadedAssemblies = System.AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < loadedAssemblies.Length && !found; i++) { System.Reflection.Assembly assembly = loadedAssemblies[i]; System.Type[] types = assembly.GetTypes(); for (int j = 0; j < types.Length && !found; j++) { System.Type type = types[j]; if (type.FullName == typeNode.InnerXml.ToString()) { DesignerContainerItem DesignerContainerItem = new DesignerContainerItem(); DesignerContainerItem.Type = type; DesignerContainerItems.Add(DesignerContainerItem); found = true; } } } } DesignerContainerTab.DesignerContainerItems = DesignerContainerItems; return; }
private void PopulateDesignerContainerItems(DesignerContainerTab DesignerContainerTab) { if (DesignerContainerTab == null) { return; } Type[] typeArray = null; switch (DesignerContainerTab.Name) { case Strings.WindowsForms: typeArray = new Type[] { typeof(MLabel), typeof(MTextBox), typeof(CustomControl), typeof(MedGridView), typeof(MRichTextBox), typeof(MPanel), typeof(MedDateTimer), typeof(MedMyLine), typeof(MedVitalSignGraph), typeof(MedAnesSheetDetails), typeof(MedDrugGraph), typeof(Panel), typeof(MedSheet), typeof(MedGridGraph), typeof(NewPictureBox), typeof(MedButton), typeof(DrugContent), typeof(MedBloodGasGraph), typeof(MedLiquidStat), typeof(MedLegengGraph) }; break; case Strings.Components: typeArray = componentsToolTypes; break; case Strings.Data: typeArray = dataToolTypes; break; case Strings.UserControls: //typeArray = userControlsToolTypes; typeArray = new Type[] { typeof(ReportViewProperties), typeof(MedPanel) }; break; default: break; } DesignerContainerItemCollection DesignerContainerItems = new DesignerContainerItemCollection(); for (int i = 0; i < typeArray.Length; i++) { DesignerContainerItem DesignerContainerItem = new DesignerContainerItem(); DesignerContainerItem.Type = typeArray[i]; DesignerContainerItem.Name = typeArray[i].Name; DesignerContainerItems.Add(DesignerContainerItem); } DesignerContainerTab.DesignerContainerItems = DesignerContainerItems; }