예제 #1
0
 private void frmComputerInfo_Shown(object sender, EventArgs e)
 {
     foreach (TabPage tab in tabControl1.TabPages)
     {
         if (tab.Controls.Count > 0)
         {
             if (tab.Controls[0] is ctlEventLogs)
             {
                 ctlEventLogs ev = (ctlEventLogs)tab.Controls[0];
                 ev.FixView();
                 break;
             }
         }
     }
 }
예제 #2
0
        private void treeAction_AfterSelect(object sender, TreeViewEventArgs e)
        {
            Splitty.Panel2.Controls.Clear();
            switch (e.Node.Name)
            {
            case "server":
            {
                ctlFirstPage ctl = new ctlFirstPage();
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }

            case "unapprovcomputer":
            {
                ctlListPCs ctl = new ctlListPCs(false, null);
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }

            case "allcomputers":
            {
                ctlListPCs ctl = new ctlListPCs(null, null);
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }

            case "allprograms":
            {
                ctlAddRemovePrograms ctl = new ctlAddRemovePrograms("");
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }

            case "alldiskdata":
            {
                ctlListDiskData ctl = new ctlListDiskData("");
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }

            case "alleventlogs":
            {
                ctlEventLogs ctl = new ctlEventLogs();
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }

            case "allstartup":
            {
                ctlStartupItems ctl = new ctlStartupItems("");
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }

#if ENABLECHAT
            case "pendingchats":
            {
                ctlPendingChats ctl = new ctlPendingChats();
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }
#endif
            case "uploaddownload":
            {
                ctlUploadDownloadStatus ctl = new ctlUploadDownloadStatus();
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }

            case "simpletasks":
            {
                ctlSimpleTasks ctl = new ctlSimpleTasks("");
                ctl.Dock = DockStyle.Fill;
                Splitty.Panel2.Controls.Add(ctl);
                break;
            }
            }

            SelectedGroup  = null;
            SelectedPolicy = null;
            if (GroupFolders.AfterSelect(treeAction, e, out SelectedGroup, out SelectedPolicy) == true)
            {
                if (SelectedGroup != null)
                {
                    ctlListPCs ctl = new ctlListPCs(null, SelectedGroup);
                    ctl.Dock = DockStyle.Fill;
                    Splitty.Panel2.Controls.Add(ctl);
                }
                if (SelectedPolicy != null)
                {
                    PolicyObject obj = Program.net.GetPolicyObject(SelectedPolicy.Value);
                    if (obj == null)
                    {
                        MessageBox.Show(this, "Loading policy failed: " + Program.net.GetLastError(), Program.Title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    else
                    {
                        PolicyElementInterface i = PolicyList.GetInstance(obj.Type);
                        i.SetData(obj);
                        UserControl ctl = (UserControl)i;
                        ctl.Dock = DockStyle.Fill;
                        Splitty.Panel2.Controls.Add(ctl);
                    }
                }
            }
        }