public FrmToolBase GetWindow(string uniqueId)
        {
            // Look for an existing window with the specified uniqueId
            FrmToolBase form = this.FindExistingWindow(uniqueId);

            if (form == null)
            {
                form             = (FrmToolBase)Assembly.GetExecutingAssembly().CreateInstance(uniqueId);
                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;
 }