Ejemplo n.º 1
0
        private static NavigateMenuNode smethod_0(ArrayList arrayList_0)
        {
            NavigateMenuNode node = new NavigateMenuNode();

            foreach (object obj2 in arrayList_0)
            {
                if (obj2 is TreeNodeCommand)
                {
                    TreeNodeCommand command = obj2 as TreeNodeCommand;
                    if (command != null)
                    {
                        Bitmap bitmap = ResourceUtil.GetBitmap(command.ImageKey);
                        if (bitmap == null)
                        {
                            bitmap = Class131.smethod_38();
                        }
                        NavigateMenuNode node2 = new NavigateMenuNode(command.Text, command.function_0.Id, bitmap, command)
                        {
                            ImageKey = command.ImageKey
                        };
                        if (command.Nodes.Count > 0)
                        {
                            smethod_1(node2, command);
                        }
                        node.Node.Add(node2);
                    }
                }
            }
            return(node);
        }
Ejemplo n.º 2
0
        public static void Load(AisinoTVW aisinoTVW_0, object object_0, string string_0, bool bool_0)
        {
            if (aisinoTVW_0.ImageList != null)
            {
                foreach (string str in ResourceUtil.dictionary_0.Keys)
                {
                    if (ResourceUtil.GetBitmap(str) != null)
                    {
                        aisinoTVW_0.ImageList.Images.Add(str, ResourceUtil.GetBitmap(str));
                    }
                }
            }
            Class120 class2 = PlugInTree.smethod_5(string_0);

            if (class2 != null)
            {
                foreach (object obj2 in class2.method_2(object_0, bool_0))
                {
                    if (!bool_0 && (obj2 is TreeNodeCommand))
                    {
                        aisinoTVW_0.Nodes.Add((TreeNodeCommand)obj2);
                    }
                    else if (bool_0 && (obj2 is TreeNodeCommand_All))
                    {
                        aisinoTVW_0.Nodes.Add((TreeNodeCommand_All)obj2);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public void Load(string string_0, NavigateMenuNode navigateMenuNode_0)
 {
     if (File.Exists(string_0))
     {
         this.navigateToolScripBody1.Items.Clear();
         try
         {
             XmlDocument document = new XmlDocument();
             document.Load(string_0);
             if ((document == null) || !document.HasChildNodes)
             {
                 throw new Exception("XML文件格式不正确!");
             }
             this.list_0.Clear();
             this.method_5(navigateMenuNode_0.Node);
             XmlNodeList list = document.SelectNodes("root/ToolBarItemCollection/ToolBarItem");
             if ((list == null) || (list.Count <= 0))
             {
                 throw new Exception("XML文件格式不正确!");
             }
             foreach (XmlNode node in list)
             {
                 XmlAttributeCollection attributes = node.Attributes;
                 string str    = attributes["text"].Value;
                 string str2   = attributes["image"].Value;
                 string item   = attributes["menuID"].Value;
                 string str4   = attributes["tooltip"].Value;
                 Bitmap bitmap = ResourceUtil.GetBitmap(str2);
                 if (bitmap == null)
                 {
                     bitmap = Class131.smethod_38();
                 }
                 if (this.list_0.Contains(item))
                 {
                     this.navigateToolScripBody1.Items.Add(new NavigateMenuNode(str, item, bitmap, str4));
                 }
             }
             return;
         }
         catch (Exception exception)
         {
             throw exception;
         }
     }
     throw new Exception("文件不存在!");
 }
Ejemplo n.º 4
0
 private static void smethod_1(NavigateMenuNode navigateMenuNode_0, TreeNode treeNode_0)
 {
     foreach (TreeNodeCommand command in treeNode_0.Nodes)
     {
         Bitmap bitmap = ResourceUtil.GetBitmap(command.ImageKey);
         if (bitmap == null)
         {
             bitmap = Class131.smethod_38();
         }
         NavigateMenuNode node = new NavigateMenuNode(command.Text, command.function_0.Id, bitmap, command)
         {
             ImageKey = command.ImageKey
         };
         if (command.Nodes.Count > 0)
         {
             smethod_1(node, command);
         }
         navigateMenuNode_0.Node.Add(node);
     }
 }
Ejemplo n.º 5
0
 public void Load(string string_0)
 {
     if (File.Exists(string_0))
     {
         try
         {
             XmlDocument document = new XmlDocument();
             document.Load(string_0);
             if ((document == null) || !document.HasChildNodes)
             {
                 throw new Exception("XML文件格式不正确!");
             }
             XmlNodeList list = document.SelectNodes("root/ToolBarItemCollection/ToolBarItem");
             if ((list == null) || (list.Count <= 0))
             {
                 throw new Exception("XML文件格式不正确!");
             }
             this.method_2();
             foreach (XmlNode node in list)
             {
                 XmlAttributeCollection attributes = node.Attributes;
                 string str    = attributes["text"].Value;
                 string str2   = attributes["image"].Value;
                 string str3   = attributes["menuID"].Value;
                 Bitmap bitmap = ResourceUtil.GetBitmap(str2);
                 if (bitmap == null)
                 {
                     bitmap = Class131.smethod_38();
                 }
                 this.NodeAdd(str, str3, bitmap);
             }
             return;
         }
         catch (Exception exception)
         {
             throw exception;
         }
     }
     throw new Exception("文件不存在!");
 }
Ejemplo n.º 6
0
        public void LoadIcon(string name, IconDock control)
        {
            bool       flag     = false;
            XmlElement userNode = this.GetUserNode(name);

            if (userNode != null)
            {
                foreach (XmlNode node in userNode.SelectNodes("IconDock/Icon"))
                {
                    XmlElement element2 = node as XmlElement;
                    if (element2 == null)
                    {
                        continue;
                    }
                    string        attribute = element2.GetAttribute("style");
                    string        str2      = element2.GetAttribute("title");
                    string        str3      = element2.GetAttribute("icon");
                    string        path      = element2.GetAttribute("value");
                    string        str5      = element2.GetAttribute("row");
                    string        str6      = element2.GetAttribute("column");
                    ButtonControl control2  = new ButtonControl(control)
                    {
                        DockRow    = this.ToInt(str5),
                        DockColumn = this.ToInt(str6),
                        IconName   = str3
                    };
                    string str7 = attribute;
                    if (str7 != null)
                    {
                        if (!(str7 == "exe"))
                        {
                            if (str7 == "system")
                            {
                                goto Label_015B;
                            }
                            if (str7 == "url")
                            {
                                goto Label_01A6;
                            }
                            if (str7 == "add")
                            {
                                goto Label_01BC;
                            }
                        }
                        else
                        {
                            control2.ClickStyle = ButtonClickStyle.Exe;
                            if (File.Exists(path))
                            {
                                control2.Icon = GetIcon.GetFileIcon(control2.ClickText).ToBitmap();
                            }
                            if (Directory.Exists(path))
                            {
                                control2.Icon = GetIcon.GetDirectoryIcon().ToBitmap();
                            }
                        }
                    }
                    goto Label_01D5;
Label_015B:
                    control2.ClickStyle = ButtonClickStyle.System;
                    if (str3 != string.Empty)
                    {
                        control2.Icon = ResourceUtil.GetBitmap(str3);
                    }
                    List <string> list2 = UserInfo.get_Gnqx();
                    if ((!UserInfo.get_IsAdmin() && (list2 != null)) && !list2.Contains(path))
                    {
                        control.DeleteButton(control2);
                    }
                    goto Label_01D5;
Label_01A6:
                    control2.ClickStyle = ButtonClickStyle.URL;
                    control2.Icon       = Resources.net;
                    goto Label_01D5;
Label_01BC:
                    if (!flag)
                    {
                        control2.ClickStyle = ButtonClickStyle.Add;
                        control2.Icon       = Resources.addIcon;
                        flag = true;
                    }
Label_01D5:
                    control2.Title     = str2;
                    control2.ClickText = path;
                }
                if (!flag)
                {
                    ButtonControl control3 = new ButtonControl(control)
                    {
                        ClickStyle = ButtonClickStyle.Add,
                        ClickText  = "添加",
                        Icon       = Resources.addIcon
                    };
                }
            }
        }