Esempio n. 1
0
        private void UpdateDesignerContainerItems(int tabIndex)
        {
            Toolbox.ToolsListBox.Items.Clear();
            Toolbox.ToolsListBox.Items.Add(pointer);
            if (Toolbox.Tabs.Count <= 0)
            {
                return;
            }

            DesignerContainerTab            toolboxTab             = Toolbox.Tabs[tabIndex];
            DesignerContainerItemCollection DesignerContainerItems = toolboxTab.DesignerContainerItems;

            foreach (DesignerContainerItem DesignerContainerItem in DesignerContainerItems)
            {
                Type type = DesignerContainerItem.Type;
                System.Drawing.Design.ToolboxItem     tbi = new System.Drawing.Design.ToolboxItem(type);
                System.Drawing.ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(System.Drawing.ToolboxBitmapAttribute)] as System.Drawing.ToolboxBitmapAttribute;

                if (tba != null)
                {
                    tbi.Bitmap = (System.Drawing.Bitmap)tba.GetImage(type);
                }

                Toolbox.ToolsListBox.Items.Add(tbi);
            }
        }
Esempio n. 2
0
 ///  <summary>
 ///
 ///       Adds the contents of another <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> to the end of the collection.
 ///
 ///  </summary>
 ///  <param name="value">
 ///    A <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> containing the objects to add to the collection.
 ///  </param>
 ///  <remarks><seealso cref="ToolboxLibrary.DesignerContainerItemCollection.Add"/></remarks>
 ///  <history>
 ///      [dineshc] 3/26/2003  Created
 ///  </history>
 public void AddRange(DesignerContainerItemCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add(value[i]);
     }
 }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
 ///  <summary>
 ///       Initializes a new instance of <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> based on another <see cref="ToolboxLibrary.DesignerContainerItemCollection"/>.
 ///  </summary>
 ///  <param name="value">
 ///       A <see cref="ToolboxLibrary.DesignerContainerItemCollection"/> from which the contents are copied
 ///  </param>
 ///  <remarks></remarks>
 ///  <history>
 ///      [dineshc] 3/26/2003  Created
 ///  </history>
 public DesignerContainerItemCollection(DesignerContainerItemCollection value)
 {
     this.AddRange(value);
 }
Esempio n. 6
0
 public DesignerContainerItemEnumerator(DesignerContainerItemCollection mappings)
 {
     this.temp           = ((IEnumerable)(mappings));
     this.baseEnumerator = temp.GetEnumerator();
 }