Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public FormItem this[FrmToolBase registeredForm]
        {
            get
            {
                foreach (FormItem fi in this)
                {
                    if (fi.RegisteredForm == registeredForm)
                    {
                        return(fi);
                    }
                }

                return(null);
            }
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public FormItem(FrmToolBase registeredForm, string uniqueId)
 {
     this._registeredForm = registeredForm;
     _id = uniqueId;
 }