コード例 #1
0
 public WindowList(ExtendedForm parentForm)
 {
     windowListForm               = parentForm;
     windowListForm.ChildAdded   += WindowListForm_ChildAdded;
     windowListForm.ChildRemoved += WindowListForm_ChildRemoved;
     this.parentForm              = parentForm;
 }
コード例 #2
0
 private void RemoteToolsControl_Load(object sender, EventArgs e)
 {
     if (this.ParentForm != null)
     {
         hostForm = (ExtendedForm)this.ParentForm;
     }
 }
コード例 #3
0
 public ExtendedForm(ExtendedForm parentForm, string formGuid)
 {
     FormGuid   = formGuid;
     ParentForm = parentForm;
     SubscribeEvents();
     SetDoubleBuffering();
 }
コード例 #4
0
 public void AddChild(ExtendedForm child)
 {
     if (!childForms.Contains(child))
     {
         childForms.Add(child);
         child.Disposed += Child_Disposed;
         OnChildAdded(this, child);
     }
 }
コード例 #5
0
 public ExtendedForm(ExtendedForm parentForm, MappedObject currentObject, bool startHidden = false) : this(parentForm, currentObject.Guid)
 {
     // If the form is starting without being shown, call for the handle to force its creation.
     if (startHidden)
     {
         var dummy = this.Handle;
         startedHidden = true;
     }
 }
コード例 #6
0
 public PSExecCommandForm(ExtendedForm parentForm, Device device) : base(parentForm)
 {
     InitializeComponent();
     this.DisableDoubleBuffering();
     targetDevice  = device;
     pSExecWrapper = new PSExecWrapper(device.HostName);
     pSExecWrapper.ErrorReceived  += PSExecWrapper_ErrorReceived;
     pSExecWrapper.OutputReceived += PSExecWrapper_OutputReceived;
     this.Text += " - " + device.CurrentUser;
     this.Show();
 }
コード例 #7
0
 private void ExtendedForm_Disposed(object sender, System.EventArgs e)
 {
     if (!IsDisposed)
     {
         DoneWaiting();
         UnSubscribeEvents();
         CloseChildren();
         parentForm = null;
         childForms.Clear();
         childForms = null;
     }
 }
コード例 #8
0
        private void InitToolItems(ExtendedForm parentForm)
        {
            var toolItemList = new List <ToolStripMenuItem>();

            toolItemList.Add(NewToolItem("tsmUserOrgObLookup", "User Lookup", () => MunisFunctions.NameSearch(parentForm)));
            toolItemList.Add(NewToolItem("tsmOrgObLookup", "Org/Obj Lookup", () => MunisFunctions.OrgObjSearch(parentForm)));
            toolItemList.Add(NewToolItem("tsmPOLookUp", "PO Lookup", () => MunisFunctions.POSearch(parentForm)));
            toolItemList.Add(NewToolItem("tsmReqNumLookUp", "Requisition # Lookup", () => MunisFunctions.ReqSearch(parentForm)));
            toolItemList.Add(NewToolItem("tsmDeviceLookUp", "Device Lookup", () => MunisFunctions.AssetSearch(parentForm)));

            foreach (var item in toolItemList)
            {
                AddToolItem(item);
            }
        }
コード例 #9
0
        private List <ExtendedForm> GetChildFormsList(ExtendedForm parent)
        {
            var childList = new List <ExtendedForm>();

            childList.AddRange(parent.ChildForms);

            foreach (var child in parent.childForms)
            {
                if (child.ChildForms.Count > 0)
                {
                    childList.AddRange(GetChildFormsList(child));
                }
            }

            return(childList);
        }
コード例 #10
0
        private OnlineStatusMenuItem NewMenuItem(ExtendedForm frm)
        {
            var newitem = new OnlineStatusMenuItem();

            newitem.Name       = frm.Name;
            newitem.Font       = dropDownControl.Font;
            newitem.Text       = frm.Text;
            newitem.Image      = frm.Icon.ToBitmap();
            newitem.TargetForm = frm;

            if (frm is IOnlineStatus)
            {
                newitem.SetOnlineStatusInterface((IOnlineStatus)frm);
            }
            newitem.ToolTipText = "Right-Click to close. Middle-Click to minimize.";
            newitem.MouseUp    += ItemClicked;
            return(newitem);
        }
コード例 #11
0
        /// <summary>
        /// Adds a menu item for the specified child to the specified parent menu item.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="child"></param>
        /// <param name="targetMenu"></param>
        private void AddChildMenu(ExtendedForm parent, ExtendedForm child, ToolStripItemCollection targetMenu)
        {
            // If this window list parent is the direct parent of the child,
            // add the child menu item to the top/root menu.
            if (parent == this.parentForm)
            {
                // Always add the Sibi form to the top of the menu,
                // all others can go below.
                if (child is SibiMainForm)
                {
                    targetMenu.Insert(0, NewMenuItem(child));
                }
                else
                {
                    targetMenu.Add(NewMenuItem(child));
                }
            }
            else
            {
                // If this window list parent is not the direct parent of the child,
                // iterate and recurse through all the menu items until we find the
                // item which targets the parent, and add to or start a new sub menu.
                foreach (var item in targetMenu)
                {
                    // Ignore seperators.
                    if (item is OnlineStatusMenuItem)
                    {
                        var statusItem = (OnlineStatusMenuItem)item;

                        // Add the child menu item to the sub menu of the matching parent item.
                        if (statusItem.TargetForm == parent)
                        {
                            statusItem.DropDownItems.Add(NewMenuItem(child));
                        }

                        // Recurse with sub menu items.
                        if (statusItem.HasDropDownItems)
                        {
                            AddChildMenu(parent, child, statusItem.DropDownItems);
                        }
                    }
                }
            }
        }
コード例 #12
0
        /// <summary>
        /// Removes the menu item for the specified child form.
        /// </summary>
        /// <param name="child"></param>
        /// <param name="targetMenu"></param>
        private void RemoveChildMenu(ExtendedForm child, ToolStripItemCollection targetMenu)
        {
            // Must use a regular 'for' block because we are going to modify the collection.
            // Iterate and recurse all menu items and remove any items that match the specified child form.
            for (int i = 0; i < targetMenu.Count; i++)
            {
                // Ignore seperators.
                if (targetMenu[i] is OnlineStatusMenuItem)
                {
                    OnlineStatusMenuItem item = (OnlineStatusMenuItem)targetMenu[i];
                    if (item.TargetForm == child)
                    {
                        DisposeDropDownItem(item);
                    }

                    if (item.HasDropDownItems)
                    {
                        RemoveChildMenu(child, item.DropDownItems);
                    }
                }
            }
        }
コード例 #13
0
 private void SetTheme(ExtendedForm parent)
 {
     Icon      = parent.Icon;
     GridTheme = parent.GridTheme;
 }
コード例 #14
0
 public ExtendedForm(ExtendedForm parentForm, MappedObject currentObject) : this(parentForm, currentObject.Guid)
 {
 }
コード例 #15
0
 public void RemoveChild(ExtendedForm child)
 {
     childForms.Remove(child);
     child.Disposed -= Child_Disposed;
     OnChildRemoved(this, child);
 }
コード例 #16
0
 public ExtendedForm(ExtendedForm parentForm) : this(parentForm, string.Empty)
 {
 }
コード例 #17
0
 private void WindowListForm_ChildRemoved(object sender, ExtendedForm e)
 {
     RemoveChildMenu(e, dropDownControl.DropDownItems);
     dropDownControl.Text = CountText(windowListForm.ChildFormCount());
     SetVisibility();
 }
コード例 #18
0
 private void OnChildRemoved(ExtendedForm parent, ExtendedForm child)
 {
     ChildRemoved?.Invoke(parent, child);
     parentForm?.OnChildRemoved(parent, child);
 }
コード例 #19
0
 protected override void Dispose(bool disposing)
 {
     targetForm            = null;
     onlineStatusInterface = null;
     base.Dispose(disposing);
 }
コード例 #20
0
 public MunisToolBar(ExtendedForm parentForm)
 {
     InitDropDown();
     InitToolItems(parentForm);
 }