Exemple #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);
            }
        }
Exemple #2
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;
        }
Exemple #3
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;
        }
Exemple #4
0
        private DesignerContainerTabCollection PopulateToolboxTabs()
        {
            DesignerContainerTabCollection toolboxTabs = new DesignerContainerTabCollection();

            string[] tabNames = { Strings.UserControls, Strings.WindowsForms, Strings.Components, Strings.Data };

            for (int i = 0; i < tabNames.Length; i++)
            {
                if (i > 1)
                {
                    break;
                }
                DesignerContainerTab toolboxTab = new DesignerContainerTab();

                toolboxTab.Name = tabNames[i];
                PopulateDesignerContainerItems(toolboxTab);
                toolboxTabs.Add(toolboxTab);
            }

            return(toolboxTabs);
        }
Exemple #5
0
        private DesignerContainerTabCollection PopulateToolboxTabs(XmlDocument xmlDocument)
        {
            if (xmlDocument == null)
            {
                return(null);
            }

            XmlNode toolboxNode = xmlDocument.FirstChild;

            if (toolboxNode == null)
            {
                return(null);
            }

            XmlNode tabCollectionNode = toolboxNode.FirstChild;

            if (tabCollectionNode == null)
            {
                return(null);
            }

            XmlNodeList tabsNodeList = tabCollectionNode.ChildNodes;

            if (tabsNodeList == null)
            {
                return(null);
            }

            DesignerContainerTabCollection toolboxTabs = new DesignerContainerTabCollection();

            foreach (XmlNode tabNode in tabsNodeList)
            {
                if (tabNode == null)
                {
                    continue;
                }

                XmlNode propertiesNode = tabNode.FirstChild;
                if (propertiesNode == null)
                {
                    continue;
                }

                XmlNode nameNode = propertiesNode[Strings.Name];
                if (nameNode == null)
                {
                    continue;
                }

                DesignerContainerTab DesignerContainerTab = new DesignerContainerTab();
                DesignerContainerTab.Name = nameNode.InnerXml.ToString();
                PopulateDesignerContainerItems(tabNode, DesignerContainerTab);
                toolboxTabs.Add(DesignerContainerTab);
            }
            if (toolboxTabs.Count == 0)
            {
                return(null);
            }

            return(toolboxTabs);
        }
Exemple #6
0
 public void Remove(DesignerContainerTab value)
 {
     List.Remove(value);
 }
Exemple #7
0
 public void Insert(int index, DesignerContainerTab value)
 {
     List.Insert(index, value);
 }
Exemple #8
0
 public int IndexOf(DesignerContainerTab value)
 {
     return(List.IndexOf(value));
 }
Exemple #9
0
 public bool Contains(DesignerContainerTab value)
 {
     return(List.Contains(value));
 }
Exemple #10
0
 public int Add(DesignerContainerTab value)
 {
     return(List.Add(value));
 }