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; }
/// <summary> /// Adds a <see cref="ToolboxLibrary.DesignerContainerItem"/> with the specified value to the /// <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> . /// </summary> /// <param name="value">The <see cref="ToolboxLibrary.DesignerContainerItem"/> to add.</param> /// <returns> /// The index at which the new element was inserted. /// </returns> /// <remarks><seealso cref="ToolboxLibrary.DesignerContainerItemCollection.AddRange"/></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public int Add(DesignerContainerItem value) { return(List.Add(value)); }
/// <summary> /// Removes a specific <see cref="ToolboxLibrary.DesignerContainerItem"/> from the /// <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> . /// </summary> /// <param name="value">The <see cref="ToolboxLibrary.DesignerContainerItem"/> to remove from the <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> .</param> /// <remarks><exception cref="System.ArgumentException"><paramref name="value"/> is not found in the Collection. </exception></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public void Remove(DesignerContainerItem value) { List.Remove(value); }
/// <summary> /// Inserts a <see cref="ToolboxLibrary.DesignerContainerItem"/> into the <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> at the specified index. /// </summary> /// <param name="index">The zero-based index where <paramref name="value"/> should be inserted.</param> /// <param name=" value">The <see cref="ToolboxLibrary.DesignerContainerItem"/> to insert.</param> /// <remarks><seealso cref="ToolboxLibrary.DesignerContainerItemCollection.Add"/></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public void Insert(int index, DesignerContainerItem value) { List.Insert(index, value); }
/// <summary> /// Returns the index of a <see cref="ToolboxLibrary.DesignerContainerItem"/> in /// the <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> . /// </summary> /// <param name="value">The <see cref="ToolboxLibrary.DesignerContainerItem"/> to locate.</param> /// <returns> /// The index of the <see cref="ToolboxLibrary.DesignerContainerItem"/> of <paramref name="value"/> in the /// <see cref="ToolboxLibrary.DesignerContainerItemCollection"/>, if found; otherwise, -1. /// </returns> /// <remarks><seealso cref="ToolboxLibrary.DesignerContainerItemCollection.Contains"/></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public int IndexOf(DesignerContainerItem value) { return(List.IndexOf(value)); }
/// <summary> /// Gets a value indicating whether the /// <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> contains the specified <see cref="ToolboxLibrary.DesignerContainerItem"/>. /// </summary> /// <param name="value">The <see cref="ToolboxLibrary.DesignerContainerItem"/> to locate.</param> /// <returns> /// <see langword="true"/> if the <see cref="ToolboxLibrary.DesignerContainerItem"/> is contained in the collection; /// otherwise, <see langword="false"/>. /// </returns> /// <remarks><seealso cref="ToolboxLibrary.DesignerContainerItemCollection.IndexOf"/></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public bool Contains(DesignerContainerItem value) { return(List.Contains(value)); }