public void CreateOrAtcivateEntGroupManagerWindow(EntGroup entGroup, OperationType type) { long gid; if (entGroup == null) { gid = -1L; } else { gid = entGroup.Gid; } if (this.entGroupManagerWindows.ContainsKey(gid)) { EntGroupManagerWindow temEntGroupManagerWindow = this.entGroupManagerWindows[gid]; temEntGroupManagerWindow.Activate(); } else { if (type == OperationType.Add) { EntGroupManagerWindow temEntGroupManagerWindow = new EntGroupManagerWindow(); this.entGroupManagerWindows.Add(gid, temEntGroupManagerWindow); temEntGroupManagerWindow.Show(); } else { if (type == OperationType.Modify) { if (entGroup == null) { throw new System.InvalidOperationException("操作类型为Modify时,参数不可为空!"); } EntGroupManagerWindow temEntGroupManagerWindow = new EntGroupManagerWindow(entGroup); this.entGroupManagerWindows.Add(gid, temEntGroupManagerWindow); temEntGroupManagerWindow.Show(); } } } }
private EntGroupManagerWindow GetManagerWindow(bool create = false) { EntGroupManagerWindow window; if (create) { window = new EntGroupManagerWindow(); } else { window = new EntGroupManagerWindow(this.group); } return window; }