Exemplo n.º 1
0
 private void ListBoxCommand_SelectedIndexChanged(object sender, EventArgs e)
 {
     CommandForm.CommandItem commandItem = this.listBoxCommand.SelectedItem as CommandForm.CommandItem;
     if (commandItem == null)
     {
         return;
     }
     foreach (CommandForm.ArgumentControl argumentControl in base.SetArgPanel(this.panelArgList, commandItem.Command, this.serverList))
     {
         argumentControl.Control.GotFocus  += this.Control_GetFocus;
         argumentControl.Control.LostFocus += this.Control_LostFocus;
     }
 }
Exemplo n.º 2
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     CommandForm.CommandItem commandItem = this.listBoxCommand.SelectedItem as CommandForm.CommandItem;
     if (commandItem == null)
     {
         Utility.ShowErrorMessage(LocalizeText.Get(247));
         return;
     }
     this.Command = base.GetFromArgPanel(commandItem.Command);
     if (this.Command != null)
     {
         base.DialogResult = DialogResult.OK;
         base.Close();
     }
 }
Exemplo n.º 3
0
 private void listBoxCommand_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.checkedListBoxServer.Items.Clear();
     CommandForm.CommandItem commandItem = this.listBoxCommand.SelectedItem as CommandForm.CommandItem;
     if (commandItem != null && this.commandDict.ContainsKey(commandItem.Command.RawCommand))
     {
         HashSet <ServerCommandForm.ServerGroupItem> hashSet = this.commandDict[commandItem.Command.RawCommand];
         foreach (ServerCommandForm.ServerGroupItem item in hashSet)
         {
             this.checkedListBoxServer.Items.Add(item);
         }
         foreach (CommandForm.ArgumentControl argumentControl in base.SetArgPanel(this.panelArgList, commandItem.Command, null))
         {
             if (argumentControl.Argument.Type == RCProcess.CustomCommandParser.DataType.ServerGroup)
             {
                 argumentControl.Control.Visible = false;
                 argumentControl.Label.Visible   = false;
             }
         }
     }
 }
Exemplo n.º 4
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     CommandForm.CommandItem commandItem = this.listBoxCommand.SelectedItem as CommandForm.CommandItem;
     if (!this.ScheduleModified || this.checkSchedule.Checked)
     {
         if (commandItem == null)
         {
             Utility.ShowErrorMessage(LocalizeText.Get(247));
             return;
         }
         if (this.checkedListBoxServer.CheckedItems.Count == 0)
         {
             Utility.ShowErrorMessage(LocalizeText.Get(535));
             return;
         }
         if (this.clientAuthority == Authority.UserKicker)
         {
             string text = commandItem.ToString();
             if (!text.Equals("Kick Character") && !text.Equals("Kick Account"))
             {
                 Utility.ShowErrorMessage(LocalizeText.Get(229));
                 return;
             }
         }
     }
     this.Command = new List <KeyValuePair <int, StandardInProcessMessage> >();
     if (commandItem.Command.Command.Equals("announce", StringComparison.CurrentCultureIgnoreCase) && MessageBox.Show(string.Format("\"{0}\"\r\n{1}", this.GetArgument(1, commandItem.Command.Arguments.ElementAt(1)), LocalizeText.Get(546)), "Announce to client Check", MessageBoxButtons.YesNo) != DialogResult.Yes)
     {
         return;
     }
     foreach (object obj in this.checkedListBoxServer.CheckedItems)
     {
         ServerCommandForm.ServerGroupItem serverGroupItem = (ServerCommandForm.ServerGroupItem)obj;
         this.currentServer = serverGroupItem.ServerGroup;
         string text2 = base.GetFromArgPanel(commandItem.Command);
         if (text2 == null)
         {
             return;
         }
         if (commandItem.Command.Command.Equals("console", StringComparison.CurrentCultureIgnoreCase) && text2.StartsWith("event reg ", StringComparison.CurrentCultureIgnoreCase))
         {
             text2 = text2.Substring(0, text2.Length - 1);
             text2 = text2 + " username " + MainForm.Instance.GetCurrentUserID() + "'";
         }
         if (this.checkSchedule.Checked)
         {
             string name = string.Format("{0} {1}", serverGroupItem.ServerGroup, commandItem.ToString());
             string key  = this.MakeKey(serverGroupItem.ID, serverGroupItem.Process);
             this.AddSchedule(key, this.dateTimePicker.Value, name, text2);
             this.ScheduleModified = true;
         }
         else
         {
             this.Command.Add(new KeyValuePair <int, StandardInProcessMessage>(serverGroupItem.ID, new StandardInProcessMessage(serverGroupItem.Process, text2)));
         }
     }
     if (!this.checkSchedule.Checked)
     {
         if (this.ScheduleModified)
         {
             foreach (KeyValuePair <int, RCProcess> keyValuePair in this.commandBridges)
             {
                 string key2 = this.MakeKey(keyValuePair.Key, keyValuePair.Value.Name);
                 keyValuePair.Value.Schedules.Clear();
                 foreach (RCProcessScheduler item in this.schedulesByTime[key2].Values)
                 {
                     keyValuePair.Value.Schedules.Add(item);
                 }
                 foreach (RCProcessScheduler item2 in this.schedulesOther[key2].Values)
                 {
                     keyValuePair.Value.Schedules.Add(item2);
                 }
             }
         }
         base.DialogResult = DialogResult.OK;
         base.Close();
         return;
     }
     this.checkSchedule.Checked = false;
     this.checkedListBoxServer.ClearSelected();
     this.listBoxCommand.ClearSelected();
 }