public void RegisterWindow(FrmToolBase form, string uniqueId) { if (this._forms[uniqueId] != null) throw new InvalidOperationException("Window is already registered."); if (string.IsNullOrEmpty(uniqueId)) throw new ArgumentNullException("uniqueId cannot be null.", "uniqueId"); FormItem fi = new FormItem(form, uniqueId); _forms.Add(fi); }
public FrmToolBase GetWindow(string uniqueId, InvokeMethod func) { // Look for an existing window with the specified uniqueId FrmToolBase form = this.FindExistingWindow(uniqueId); if (form == null) { form = (FrmToolBase)Assembly.GetExecutingAssembly().CreateInstance(uniqueId); form.MessageChanged += new FrmToolBase.MessageChangedEventHandler(func); form.FormClosed += new FormClosedEventHandler(form_FormClosed); this.RegisterWindow(form, uniqueId); } return(form); }
public FormItem this[FrmToolBase registeredForm] { get { foreach (FormItem fi in this) { if (fi.RegisteredForm == registeredForm) { return(fi); } } return(null); } }
public void RegisterWindow(FrmToolBase form, string uniqueId) { if (this._forms[uniqueId] != null) { throw new InvalidOperationException("Window is already registered."); } if (string.IsNullOrEmpty(uniqueId)) { throw new ArgumentNullException("uniqueId cannot be null.", "uniqueId"); } FormItem fi = new FormItem(form, uniqueId); _forms.Add(fi); }
public FormItem(FrmToolBase registeredForm, string uniqueId) { this._registeredForm = registeredForm; _id = uniqueId; }