public IconManager(IconDock dock) { this.InitializeComponent(); this.PowerList = UserInfo.get_Gnqx(); this.tab_wb.DragDrop += new DragEventHandler(this.tab_wb_DragDrop); this.tab_wb.DragEnter += new DragEventHandler(this.tab_wb_DragEnter); this.owner = dock; this.lastTree1.AfterCheck += new TreeViewEventHandler(this.lastTree1_AfterCheck); this.TreeLoad(); }
public static IDock DockFactory(string DockName, PageControl page) { IDock dock; string str = DockName; if (str != null) { if (!(str == "IconDock")) { if (str == "InfoDock") { dock = new InfoDock(page); goto Label_0061; } if (str == "JScardDock") { dock = new JScardDock(page); goto Label_0061; } if (str == "TongjiDock") { dock = new TongjiDock(page); goto Label_0061; } } else { dock = new IconDock(page); goto Label_0061; } } dock = null; Label_0061: if (dock != null) { dock.Size = new Size(HeadWidth, HeadHeight); dock.LoadUser(UserName); } return(dock); }
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 }; } } }