Ejemplo n.º 1
0
 private void ToolBarButtonServerMonitorSystem_Click()
 {
     if (this._serverMonitorForm == null)
     {
         if (this._rcUser.Authority < Authority.UserKicker)
         {
             Utility.ShowErrorMessage(LocalizeText.Get(152));
             return;
         }
         try
         {
             this._serverMonitorForm          = new ServerMonitorForm(this._config, this._serverMonitorControl);
             this._serverMonitorForm.OnAlarm += this.Alarm;
         }
         catch (InvalidOperationException)
         {
             return;
         }
         this.TSBServer.Tag = this._serverMonitorForm;
         this._serverMonitorForm.MdiParent = this;
         this._serverMonitorForm.Closed   += this.ServerMonitorForm_Closed;
         this._serverMonitorForm.Show();
         this.TSBServer.Checked = true;
         return;
     }
     else
     {
         this._serverMonitorForm.Focus();
     }
 }
Ejemplo n.º 2
0
 public HelpViewer()
 {
     this.InitializeComponent();
     this.TViewHelpIndex.Nodes.AddRange(new TreeNode[]
     {
         new TreeNode(LocalizeText.Get(0), 0, 0, new TreeNode[]
         {
             new TreeNode(LocalizeText.Get(1), 1, 1, new TreeNode[]
             {
                 new TreeNode(LocalizeText.Get(2)),
                 new TreeNode(LocalizeText.Get(3)),
                 new TreeNode(LocalizeText.Get(4))
             })
         })
     });
     this.TViewHelpIndex.Nodes[0].Text                   = LocalizeText.Get(0);
     this.TViewHelpIndex.Nodes[0].Nodes[0].Text          = LocalizeText.Get(1);
     this.TViewHelpIndex.Nodes[0].Nodes[0].Nodes[0].Text = LocalizeText.Get(2);
     this.TViewHelpIndex.Nodes[0].Nodes[0].Nodes[1].Text = LocalizeText.Get(3);
     this.TViewHelpIndex.Nodes[0].Nodes[0].Nodes[2].Text = LocalizeText.Get(4);
     this.TViewHelpIndex.AfterExpand   += this.NodeExpanded;
     this.TViewHelpIndex.AfterCollapse += this.NodeCollapsed;
     this.HtmlIndexList = new SortedList();
     this.HtmlIndexList.Add("0.0.0", "LogQuery.htm");
     this.HtmlIndexList.Add("0.0.1", "LogResult.htm");
     this.HtmlIndexList.Add("0.0.2", "LogAdvance.htm");
     this.TViewHelpIndex.ExpandAll();
 }
Ejemplo n.º 3
0
 private void MainForm_Closing(object sender, CancelEventArgs args)
 {
     if (MessageBox.Show(LocalizeText.Get(155), LocalizeText.Get(156), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No)
     {
         args.Cancel = true;
     }
 }
Ejemplo n.º 4
0
 private void ToolBarButtonUserMonitorSystem_Click()
 {
     if (this._userMonitorForm == null)
     {
         if (this._rcUser.Authority < Authority.GSM && this._rcUser.Authority != Authority.UserMonitor)
         {
             Utility.ShowErrorMessage(LocalizeText.Get(406));
             return;
         }
         try
         {
             this._userMonitorForm             = new UserMonitorForm2(this._userCountData);
             this._userMonitorForm.OnUserDrop += new UserDropEventHandler(this.Alarm);
         }
         catch (InvalidOperationException)
         {
             return;
         }
         this.TSBUser.Tag = this._userMonitorForm;
         this._userMonitorForm.MdiParent = this;
         this._userMonitorForm.Closed   += this.UserMonitorForm_Closed;
         this._userMonitorForm.Show();
         return;
     }
     else
     {
         this._userMonitorForm.Focus();
     }
 }
Ejemplo n.º 5
0
        private void TSButtonCopy_Click(object sender, EventArgs e)
        {
            StringBuilder stringBuilder = new StringBuilder(1048576);

            foreach (DataTable dataTable in this.userCountData.Tables)
            {
                foreach (object obj in dataTable.Columns)
                {
                    DataColumn dataColumn = (DataColumn)obj;
                    stringBuilder.AppendFormat("{0}\t", dataColumn.Caption);
                }
                stringBuilder.Replace("\t", "\r\n", stringBuilder.Length - 1, 1);
                foreach (object obj2 in dataTable.Rows)
                {
                    DataRow dataRow = (DataRow)obj2;
                    foreach (object obj3 in dataTable.Columns)
                    {
                        DataColumn dataColumn2 = (DataColumn)obj3;
                        object     obj4        = dataRow[dataColumn2.Caption];
                        if (obj4 is DBNull)
                        {
                            obj4 = "0";
                        }
                        stringBuilder.AppendFormat("{0}\t", obj4.ToString());
                    }
                    stringBuilder.Replace("\t", "\r\n", stringBuilder.Length - 1, 1);
                }
            }
            DataObject data = new DataObject(stringBuilder.ToString());

            Clipboard.SetDataObject(data, false);
            Utility.ShowInformationMessage(LocalizeText.Get(404));
        }
Ejemplo n.º 6
0
 private void MenuItemUser_Click(object sender, EventArgs e)
 {
     if (this._rcUser.Authority < Authority.Supervisor)
     {
         Utility.ShowErrorMessage(LocalizeText.Get(154));
         return;
     }
     this._rcUser.GetUserList();
 }
Ejemplo n.º 7
0
 public ServerMonitorForm(Configuration config, ServerMonitorControl serverMonitorControl)
 {
     this.InitializeComponent();
     this.menuItem1.Text       = LocalizeText.Get(390);
     this.menuItemControl.Text = LocalizeText.Get(395);
     this.Text = LocalizeText.Get(396);
     this._serverMonitorControl = serverMonitorControl;
     this._serverMonitorControl.OnProcessCrash     += this.ProcessCrashed;
     this._serverMonitorControl.OnChildProcessList += this.ChildProcessListed;
     this._serverMonitorControl.OnExeInfo          += this.ExeInfo;
     this._config = config;
 }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
0
        public static void SetLocale(string locale)
        {
            if (LocalizeText._localText == null)
            {
                throw new InvalidOperationException("LocalizeText not initialized!");
            }
            object obj = LocalizeText._localeList[locale];

            if (obj == null)
            {
                throw new IndexOutOfRangeException("No locale information named " + locale);
            }
            LocalizeText.SetLocale((int)obj);
        }
Ejemplo n.º 10
0
        private void MenuItemAboutMe_Click(object sender, EventArgs e)
        {
            PersonalInfo personalInfo = new PersonalInfo(this._config.ID, this._rcUser.Authority.ToString());

            while (personalInfo.ShowDialog() == DialogResult.OK && personalInfo.TBoxOldPassword.Text.Length > 0)
            {
                if (!(personalInfo.TBoxNewPassword.Text != personalInfo.TBoxRePassword.Text))
                {
                    this._rcUser.ChangePassword(Utility.GetHashedPassword(personalInfo.TBoxOldPassword.Text), Utility.GetHashedPassword(personalInfo.TBoxNewPassword.Text));
                    break;
                }
                Utility.ShowErrorMessage(LocalizeText.Get(153));
            }
        }
Ejemplo n.º 11
0
        public UserMonitorForm2(UserCountData data)
        {
            this.InitializeComponent();
            this.userCountData = data;
            UserCountData userCountData = this.userCountData;

            userCountData.OnUserDrop = (UserDropEventHandler)Delegate.Combine(userCountData.OnUserDrop, new UserDropEventHandler(this.UserDropped));
            UserCountData userCountData2 = this.userCountData;

            userCountData2.OnTableAdd = (EventHandler <EventArgs <DataTable> >)Delegate.Combine(userCountData2.OnTableAdd, new EventHandler <EventArgs <DataTable> >(this.TableAdded));
            this.TSComboStyle.Items.Add(LocalizeText.Get(536));
            this.TSComboStyle.Items.Add(LocalizeText.Get(537));
            this.TSComboStyle.SelectedIndex = 0;
        }
Ejemplo n.º 12
0
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            string text = "HeroesOpToolConfig.xml";

            if (args.Length > 0)
            {
                text = args[0];
            }
            XmlTextReader xmlTextReader = null;
            Configuration configuration;

            try
            {
                xmlTextReader = new XmlTextReader(text);
                configuration = (Configuration) new System.Xml.Serialization.XmlSerializer(typeof(Configuration)).Deserialize(xmlTextReader);
            }
            catch (Exception ex)
            {
                Utility.ShowErrorMessage(string.Format("Error occured while reading configuration file : {0}\nSource message : {1}", text, ex.Message));
                return;
            }
            finally
            {
                if (xmlTextReader != null)
                {
                    xmlTextReader.Close();
                }
            }
            try
            {
                LocalizeText.LoadText(configuration.TextFile);
                LocalizeText.SetLocale(configuration.Language);
            }
            catch (Exception ex2)
            {
                Utility.ShowErrorMessage("Error occured while reading text file! - " + ex2.ToString());
                return;
            }
            HeroesOpTool.Thread = new JobProcessor();
            HeroesOpTool.Thread.ExceptionOccur += delegate(object sender, EventArgs <Exception> e)
            {
                Utility.ShowErrorMessage(e.Value.ToString());
            };
            HeroesOpTool.Thread.Start();
            RCUserHandler        rcUser = new RCUserHandler(configuration);
            ServerMonitorControl serverMonitorControl = new ServerMonitorControl(rcUser);

            serverMonitorControl.CreateControl();
            Login login = new Login(configuration, rcUser, serverMonitorControl);

            if (login.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    Application.Run(new MainForm(configuration, rcUser, serverMonitorControl));
                }
                catch (Exception ex3)
                {
                    Utility.ShowErrorMessage(ex3.ToString());
                }
            }
            HeroesOpTool.Thread.Stop();
        }
Ejemplo n.º 13
0
 private InputBox()
 {
     this.InitializeComponent();
     this.BtnOK.Text     = LocalizeText.Get(5);
     this.BtnCancel.Text = LocalizeText.Get(6);
 }