コード例 #1
0
ファイル: MainForm.cs プロジェクト: ulkyome/laucher_server
 private void ShowLog <T>(LogGenerator logGenerator, IEnumerable <T> prevLog, Action <LogViewForm> preLoadFunc)
 {
     this.UIThread(delegate
     {
         if (!this.logViews.ContainsKey(logGenerator.Key))
         {
             LogViewForm logViewForm = new LogViewForm();
             if (preLoadFunc != null)
             {
                 preLoadFunc(logViewForm);
             }
             logViewForm.Text = logGenerator.Name;
             logViewForm.Name = logGenerator.Key;
             this.logViews.Add(logGenerator.Key, logViewForm);
             logViewForm.LogGenerator = logGenerator;
             logViewForm.MdiParent    = this;
             logViewForm.Closed      += this.LogViewForm_Closed;
             logViewForm.AddLog <T>(prevLog);
             logViewForm.Show();
             ToolStripItem toolStripItem = this.toolStrip.Items.Add(logGenerator.Name);
             toolStripItem.Name          = logGenerator.Key;
             toolStripItem.Tag           = logViewForm;
             toolStripItem.Click        += this.LogItem_Click;
             logViewForm.Tag             = toolStripItem;
             return;
         }
         this.logViews[logGenerator.Key].Activate();
     });
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: ulkyome/laucher_server
        private void OnSplitChildProcessLog(object sender, EventArgs <ChildProcessLogReplyMessage> args)
        {
            LogGenerator logGenerator = this.childProcessLogs.FindGenerator(args.Value.ClientID, args.Value.ProcessName, args.Value.ProcessID);

            if (logGenerator != null)
            {
                this.ShowLog <RCProcess.ChildProcessLog>(logGenerator, args.Value.Log, delegate(LogViewForm f)
                {
                    f.EnableInput = false;
                });
            }
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: ulkyome/laucher_server
 public MainForm(Configuration config, RCUserHandler rcUser, ServerMonitorControl control)
 {
     this.InitializeComponent();
     this.Text                  = LocalizeText.Get(151);
     this.menuItem1.Text        = LocalizeText.Get(138);
     this.MenuItemAboutMe.Text  = LocalizeText.Get(139);
     this.MenuItemClose.Text    = LocalizeText.Get(140);
     this.menuItem5.Text        = LocalizeText.Get(141);
     this.MenuItemUser.Text     = LocalizeText.Get(142);
     this.menuItem4.Text        = LocalizeText.Get(143);
     this.MenuItemHelp.Text     = LocalizeText.Get(144);
     this.TSBServer.Text        = LocalizeText.Get(147);
     this.TSBServer.ToolTipText = LocalizeText.Get(148);
     this.TSBUser.Text          = LocalizeText.Get(149);
     this.TSBUser.ToolTipText   = LocalizeText.Get(150);
     this.Text                  = LocalizeText.Get(151);
     if (rcUser.Authority < Authority.GSM)
     {
         this.toolStrip.Items.Remove(this.TSBServer);
         if (rcUser.Authority != Authority.UserMonitor)
         {
             this.toolStrip.Items.Remove(this.TSBUser);
         }
     }
     this._config = config;
     this._rcUser = rcUser;
     this._rcUser.ReceivedUserListReply += this.RC_ReceivedUserListReply;
     this._rcUser.ChildProcessLogOpened += this.OnSplitChildProcessLog;
     this._rcUser.ChildProcessLogged    += delegate(object s, EventArgs <ChildProcessLogMessage> e)
     {
         LogGenerator logGenerator = this.childProcessLogs.FindGenerator(e.Value.ClientID, e.Value.ProcessName, e.Value.ProcessID);
         if (logGenerator != null)
         {
             logGenerator.LogGenerated(null, e.Value.ToString());
         }
     };
     this._serverMonitorControl = control;
     this._serverMonitorControl.OnSplitGeneralLog    += this.OnSplitGeneralLog;
     this._serverMonitorControl.OnSplitProcessLog    += this.OnSplitProcessLog;
     this._serverMonitorControl.OnSplitAllProcessLog += this.OnSplitAllProcessLog;
     this.bAlarm             = true;
     this.alarmForm          = this._serverMonitorControl.alarmForm;
     this.alarmForm.OnClose += this.UpdateAlarmTime;
     this.UpdateAlarm(this.bAlarm);
     this.alarmSound                    = new SoundPlayer(Resources.AlarmSound);
     this._userCountData                = new UserCountData(this._rcUser);
     this.childProcessLogs              = new ChildProcessLogGeneratorCollection();
     this.childProcessLogs.OnLogClosed += delegate(object s, EventArgs <ChildProcessLogDisconnectMessage> e)
     {
         this._rcUser.SendMessage <ChildProcessLogDisconnectMessage>(e.Value);
     };
     MainForm.Instance = this;
 }