private void menuItemClientProcessAdd_Click(object sender, EventArgs e) { if (this._selectedNode != null) { if (this._selectedNode.Nodes.Count > 0) { Utility.ShowErrorMessage(LocalizeText.Get(381)); return; } TwoStringInputForm twoStringInputForm = new TwoStringInputForm(LocalizeText.Get(382), LocalizeText.Get(383), LocalizeText.Get(384), LocalizeText.Get(385)); if (twoStringInputForm.ShowDialog() != DialogResult.OK) { return; } WorkGroupCondition condition = new WorkGroupCondition(twoStringInputForm.Value1, twoStringInputForm.Value2); try { ((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).AddCondition(condition); this.IncreaseConditionCountWorkGroup(condition); this._modified = true; this.TreeViewWorkGroup_AfterSelect(sender, new TreeViewEventArgs(this._selectedNode)); } catch (ArgumentException) { Utility.ShowErrorMessage(LocalizeText.Get(386)); } } }
private void OnConnectionResult(object sender, EventArgs <RCUserHandler.ConnectionResult> args) { this.RCUserHandler.ConnectionResulted -= this.OnConnectionResult; this.UIThread(delegate { this.Enabled = true; switch (args.Value) { case RCUserHandler.ConnectionResult.Success: if (this.RCUserHandler.Authority > Authority.None) { this.ServerMonitorControl.EnableConnectionEvents(); Utility.ShowInformationMessage(string.Format(LocalizeText.Get(185), this.RCUserHandler.Authority.ToString())); this.DialogResult = DialogResult.OK; this.Close(); return; } this.RCUserHandler.Stop(); Utility.ShowErrorMessage(LocalizeText.Get(186)); return; case RCUserHandler.ConnectionResult.VersionMismatch: Utility.ShowErrorMessage(LocalizeText.Get(187)); this.DialogResult = DialogResult.Cancel; this.Close(); return; } this.RCUserHandler.Stop(); Utility.ShowErrorMessage(LocalizeText.Get(188)); }); }
protected string GetFromArgPanel(RCProcess.CustomCommandParser command) { bool flag = false; int num = 0; List <string> list = new List <string>(); foreach (RCProcess.CustomCommandParser.CommandArg arg in command.Arguments) { string text = this.GetArgument(num, arg); if (text.IndexOf('\'') != -1) { Utility.ShowErrorMessage(LocalizeText.Get(533)); return(null); } if (string.IsNullOrEmpty(text)) { text = string.Empty; flag = true; } list.Add(string.Format("'{0}'", text)); num++; } string finalCommand = command.GetFinalCommand(list.ToArray()); if (flag && !Utility.InputYesNoFromWarning(LocalizeText.Get(405))) { return(null); } return(finalCommand); }
public UserAlarmForm() { this.InitializeComponent(); this.suppressMinutes = new List <int>(); this.logs = new Dictionary <DateTime, string>(); this.emergencyMembers = new List <EmergencyInformationData>(); this.BtnOK.Text = LocalizeText.Get(358); this.clmnTime.Text = LocalizeText.Get(414); this.clmnDesc.Text = LocalizeText.Get(424); this.LabelDesc.Text = LocalizeText.Get(425); this.Text = LocalizeText.Get(156); this.EmergencyCallLabel.Text = LocalizeText.Get(545); this.Department.Text = LocalizeText.Get(539); this.Id.Text = LocalizeText.Get(540); this.CallName.Text = LocalizeText.Get(541); this.PhoneNumber.Text = LocalizeText.Get(542); this.Mail.Text = LocalizeText.Get(543); this.Rank.Text = LocalizeText.Get(544); for (int i = 10; i <= 60; i += 10) { this.ComboMinute.Items.Add(string.Format(LocalizeText.Get(426), i)); this.suppressMinutes.Add(i); } this.ComboMinute.SelectedIndex = 0; }
private void menuItemTemplateModify_Click(object sender, EventArgs e) { if (this.listViewProcessTemplate.SelectedItems.Count > 0) { string text = this.listViewProcessTemplate.SelectedItems[0].Text; foreach (RCProcess rcprocess in this.processTemplateCollection) { if (rcprocess.Name == text) { ProcessPropertyForm processPropertyForm = new ProcessPropertyForm(rcprocess, 0, true, false); while (processPropertyForm.ShowDialog() == DialogResult.OK) { try { this.ModifyTemplate(processPropertyForm.RCProcess, this.listViewProcessTemplate.SelectedIndices[0]); this._modified = true; break; } catch (ArgumentException ex) { Utility.ShowErrorMessage(LocalizeText.Get(331) + ex.Message); } } break; } } } }
private void ListViewBoundProcess_DragDrop(object sender, DragEventArgs args) { if (this._validDragToBoundList) { if (this.treeViewWorkGroup.SelectedNode == null) { Utility.ShowErrorMessage(LocalizeText.Get(387)); return; } TreeNode selectedNode = this.treeViewWorkGroup.SelectedNode; if (selectedNode.Nodes.Count > 0) { Utility.ShowErrorMessage(LocalizeText.Get(388)); return; } WorkGroupControl.ConditionItem[] array = (WorkGroupControl.ConditionItem[])args.Data.GetData(typeof(WorkGroupControl.ConditionItem[])); if (array == null) { return; } foreach (WorkGroupControl.ConditionItem conditionItem in array) { try { ((WorkGroupControl.SimpleWorkGroupTreeNode)selectedNode).AddCondition(conditionItem.Condition); this.IncreaseConditionCountWorkGroup(conditionItem.Condition); } catch (ArgumentException) { } } this._modified = true; this.TreeViewWorkGroup_AfterSelect(sender, new TreeViewEventArgs(selectedNode)); } }
private void listViewProperty_DoubleClick(object sender, EventArgs e) { if (!this._editable) { return; } if (this.listViewProperty.SelectedItems.Count > 0) { ListViewItem listViewItem = this.listViewProperty.SelectedItems[0]; TwoStringInputForm twoStringInputForm = new TwoStringInputForm("프로세스 속성 편집", this.IsStaticProperty(listViewItem) ? "프로세스 속성을 입력하세요." : "동적 속성은 편집할 수 없습니다.", "Key", "Value", listViewItem.SubItems[0].Text, listViewItem.SubItems[1].Text); while (twoStringInputForm.ShowDialog() == DialogResult.OK) { try { if (this.IsStaticProperty(listViewItem)) { this.CheckProperty(twoStringInputForm.Value1, listViewItem.Index); listViewItem.SubItems[0].Text = twoStringInputForm.Value1; listViewItem.SubItems[1].Text = twoStringInputForm.Value2; } break; } catch (Exception ex) { Utility.ShowErrorMessage(LocalizeText.Get(313) + ex.Message); } } } }
private void ListViewPerformanceDescription_DoubleClick(object sender, EventArgs e) { if (!this._editable) { return; } if (this.listViewPerformanceDescription.SelectedItems.Count > 0) { ListViewItem listViewItem = this.listViewPerformanceDescription.SelectedItems[0]; TwoStringInputForm twoStringInputForm = new TwoStringInputForm(LocalizeText.Get(309), LocalizeText.Get(310), LocalizeText.Get(311), LocalizeText.Get(312), listViewItem.SubItems[0].Text, listViewItem.SubItems[1].Text); while (twoStringInputForm.ShowDialog() == DialogResult.OK) { try { new RCProcess.PerformanceDescriptionParser(twoStringInputForm.Value1, twoStringInputForm.Value2); listViewItem.SubItems[0].Text = twoStringInputForm.Value1; listViewItem.SubItems[1].Text = twoStringInputForm.Value2; break; } catch (Exception ex) { Utility.ShowErrorMessage(LocalizeText.Get(313) + ex.Message); } } } }
private void ListViewUnboundProcess_DragDrop(object sender, DragEventArgs args) { if (this._validDragToUnboundList) { WorkGroupControl.ConditionItem[] array = (WorkGroupControl.ConditionItem[])args.Data.GetData(typeof(WorkGroupControl.ConditionItem[])); if (array == null) { return; } if (Utility.InputYesNoFromWarning(LocalizeText.Get(389))) { foreach (WorkGroupControl.ConditionItem conditionItem in array) { foreach (object obj in this.treeViewWorkGroup.Nodes) { WorkGroupControl.SimpleWorkGroupTreeNode node = (WorkGroupControl.SimpleWorkGroupTreeNode)obj; this.RemoveSpecifiedCondition(node, conditionItem.Condition); } } } this._modified = true; TreeNode selectedNode = this.treeViewWorkGroup.SelectedNode; if (selectedNode != null) { this.TreeViewWorkGroup_AfterSelect(sender, new TreeViewEventArgs(selectedNode)); } } }
private void BtnAddUser_Click(object sender, EventArgs e) { AuthUserManage authUserManage = new AuthUserManage(null, this._rcUser.Authority); while (authUserManage.ShowDialog() == DialogResult.OK) { if (!(authUserManage.TBoxPassword.Text != authUserManage.TBoxRePassword.Text)) { string text = authUserManage.TBoxID.Text; Authority authority = (Authority)Enum.Parse(typeof(Authority), authUserManage.CBoxAuthLevel.Text); foreach (object obj in this.LViewUsers.Items) { ListViewItem listViewItem = (ListViewItem)obj; if (listViewItem.SubItems[0].Text == text) { Utility.ShowErrorMessage(LocalizeText.Get(181)); return; } } this._rcUser.RegisterUser(text, Utility.GetHashedPassword(authUserManage.TBoxPassword.Text), authority); this.AddMember(text, authority); break; } Utility.ShowErrorMessage(LocalizeText.Get(180)); } }
private void menuItemProcessAdd_Click(object sender, EventArgs e) { if (this.calculateThread != null) { return; } ProcessPropertyForm processPropertyForm = new ProcessPropertyForm(this.processTemplateCollection); if (processPropertyForm.ShowDialog(this) == DialogResult.OK) { ControlRequestMessage controlRequestMessage = new ControlRequestMessage(SerializeWriter.ToBinary <AddProcessMessage>(new AddProcessMessage(processPropertyForm.RCProcess)).Bytes); bool flag = false; foreach (object obj in this.listViewRCClient.SelectedItems) { RCClientControl.ClientItem clientItem = (RCClientControl.ClientItem)obj; try { clientItem.AddProcess(processPropertyForm.RCProcess); controlRequestMessage.AddClientID(clientItem.ID); } catch (ArgumentException) { flag = true; } } this.messageList.Add(controlRequestMessage); if (flag) { Utility.ShowErrorMessage(LocalizeText.Get(343)); } this.RecalculateCommonProcess(); } }
private void menuItemServerGroupNew_Click(object sender, EventArgs e) { if (this._selectedNode != null) { this.treeViewServerGroup.SelectedNode = this._selectedNode; if (!this._selectedNode.IsEditing) { if (((ServerGroupControl.SimpleServerGroupTreeNode) this._selectedNode).Servers.Count > 0) { if (!Utility.InputYesNoFromWarning(LocalizeText.Get(380))) { return; } foreach (string server in ((ServerGroupControl.SimpleServerGroupTreeNode) this._selectedNode).Servers) { this.DecreaseServerRefCount(server); } ((ServerGroupControl.SimpleServerGroupTreeNode) this._selectedNode).Clear(); } ServerGroupControl.SimpleServerGroupTreeNode simpleServerGroupTreeNode = new ServerGroupControl.SimpleServerGroupTreeNode("", ((ServerGroupControl.SimpleServerGroupTreeNode) this._selectedNode).Authority); this._selectedNode.Nodes.Add(simpleServerGroupTreeNode); this._selectedNode.Expand(); this.treeViewServerGroup.SelectedNode = simpleServerGroupTreeNode; this.Modified = true; simpleServerGroupTreeNode.BeginEdit(); } } }
private void ListViewBoundServer_DragDrop(object sender, DragEventArgs args) { if (this._validDragToBoundList) { if (this.treeViewServerGroup.SelectedNode == null) { Utility.ShowErrorMessage(LocalizeText.Get(387)); return; } TreeNode selectedNode = this.treeViewServerGroup.SelectedNode; if (selectedNode.Nodes.Count > 0) { Utility.ShowErrorMessage(LocalizeText.Get(388)); return; } ListViewItem[] array = (ListViewItem[])args.Data.GetData(typeof(ListViewItem[])); if (array == null) { return; } foreach (ListViewItem listViewItem in array) { try { ((ServerGroupControl.SimpleServerGroupTreeNode)selectedNode).AddServer(listViewItem.Text); this.IncreaseServerRefCount(listViewItem.Text); } catch (ArgumentException) { } } this.Modified = true; this.TreeViewServerGroup_AfterSelect(sender, new TreeViewEventArgs(selectedNode)); } }
private void ListViewUnboundServer_DragDrop(object sender, DragEventArgs args) { if (this._validDragToUnboundList) { string[] array = (string[])args.Data.GetData(typeof(ListViewItem[])); if (array == null) { return; } if (Utility.InputYesNoFromWarning(LocalizeText.Get(389))) { foreach (string server in array) { foreach (object obj in this.treeViewServerGroup.Nodes) { ServerGroupControl.SimpleServerGroupTreeNode node = (ServerGroupControl.SimpleServerGroupTreeNode)obj; this.RemoveSpecifiedServer(node, server); } } } this.Modified = true; TreeNode selectedNode = this.treeViewServerGroup.SelectedNode; if (selectedNode != null) { this.TreeViewServerGroup_AfterSelect(sender, new TreeViewEventArgs(selectedNode)); } } }
private void menuItemWorkGroupNew_Click(object sender, EventArgs e) { if (this._selectedNode != null) { this.treeViewWorkGroup.SelectedNode = this._selectedNode; if (!this._selectedNode.IsEditing) { if (((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).Conditions.Count > 0) { if (!Utility.InputYesNoFromWarning(LocalizeText.Get(380))) { return; } foreach (object obj in ((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).Conditions) { WorkGroupCondition condition = (WorkGroupCondition)obj; this.DecreaseConditionCountWorkGroup(condition); } ((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).ClearCondition(); } WorkGroupControl.SimpleWorkGroupTreeNode simpleWorkGroupTreeNode = new WorkGroupControl.SimpleWorkGroupTreeNode("", ((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).Authority); this._selectedNode.Nodes.Add(simpleWorkGroupTreeNode); this._selectedNode.Expand(); this.treeViewWorkGroup.SelectedNode = simpleWorkGroupTreeNode; this._modified = true; simpleWorkGroupTreeNode.BeginEdit(); } } }
private void InitializePlot(string title) { this.plotSurface = this.CreateDefaultPlot(); this.plotSurface.Title = title; this.plotSurface.XAxis1.Label = LocalizeText.Get(414); this.plotSurface.YAxis1.Label = LocalizeText.Get(415); this.plotSurface.Dock = DockStyle.Fill; base.Controls.Add(this.plotSurface); }
public ProcessPropertyForm(RCProcess process, int version, bool editable, bool multEdit) : this() { this.detailForm = new ProcessPropertyDetailForm(process, editable); this._editable = editable; this.comboBoxName.Text = process.Name; this.comboBoxName.Enabled = false; this.textBoxType.Text = process.Type; this.textBoxDescription.Text = process.Description; this.textBoxWorkingDirectory.Text = process.WorkingDirectory; this.textBoxExecuteFileName.Text = process.ExecuteName; this.textBoxExecuteFileArgs.Text = process.ExecuteArgs; if (string.IsNullOrEmpty(this.textBoxExecuteFileArgs.Text)) { this.toolTipProperty.SetToolTip(this.textBoxExecuteFileArgs, LocalizeText.Get(260)); } else { this.toolTipProperty.SetToolTip(this.textBoxExecuteFileArgs, process.ExecuteArgs); } this.textBoxUpdateFileName.Text = process.UpdateExecuteName; this.textBoxUpdateFileArgs.Text = process.UpdateExecuteArgs; this.textBoxStandardOutLogLines.Text = process.LogLines.ToString(); this.checkBoxRunOnce.Checked = process.AutomaticRestart; this.checkBoxUse.Checked = process.DefaultSelect; this.checkBoxAutomaticStart.Checked = process.AutomaticStart; this.checkBoxPerformance.Checked = process.CheckPerformance; if (!editable) { this.textBoxType.Enabled = false; this.textBoxDescription.Enabled = false; this.textBoxWorkingDirectory.Enabled = false; this.textBoxExecuteFileName.Enabled = false; this.textBoxExecuteFileArgs.Enabled = false; this.textBoxUpdateFileName.Enabled = false; this.textBoxUpdateFileArgs.Enabled = false; this.textBoxStandardOutLogLines.Enabled = false; this.checkBoxRunOnce.Enabled = false; this.checkBoxUse.Enabled = false; this.checkBoxAutomaticStart.Enabled = false; this.checkBoxPerformance.Enabled = false; this.buttonScheduleAdd.Enabled = false; this.buttonScheduleSub.Enabled = false; } else if (multEdit) { this.textBoxDescription.Enabled = false; } if (version != 0 && version < 8) { this.textBoxType.Enabled = false; } foreach (RCProcessScheduler schedule in process.Schedules) { this.AddProcessSchedule(schedule); } }
private void BtnRemoveUser_Click(object sender, EventArgs e) { string text = this.LViewUsers.SelectedItems[0].SubItems[0].Text; if (Utility.InputYesNoFromWarning(string.Format(LocalizeText.Get(182), text))) { this._rcUser.RemoveUser(text); this.LViewUsers.Items.RemoveAt(this.LViewUsers.SelectedIndices[0]); } }
public SelfUpdateForm() { this.InitializeComponent(); this.label2.Text = LocalizeText.Get(351); this.label3.Text = LocalizeText.Get(352); this.label4.Text = LocalizeText.Get(353); this.label5.Text = LocalizeText.Get(354); this.buttonOK.Text = LocalizeText.Get(355); this.buttonCancel.Text = LocalizeText.Get(356); this.Text = LocalizeText.Get(357); }
private void textBoxName_Validating(object sender, CancelEventArgs e) { string value = null; if (this.textBoxName.Text.Length == 0) { value = LocalizeText.Get(450); e.Cancel = true; } this.errorProviderAll.SetError(this.textBoxName, value); }
public void ProcessRCClientMessage(RCClient rcClient, ArraySegment <byte> value) { try { this.MF.Handle(new Packet(value), rcClient); } catch (Exception ex) { Utility.ShowErrorMessage(LocalizeText.Get(221) + ex.ToString()); this.Stop(); } }
private void RCClientControl_Load(object sender, EventArgs e) { this.labelRCClient.Text = LocalizeText.Get(332); this.columnHeader1.Text = LocalizeText.Get(333); this.columnHeader2.Text = LocalizeText.Get(334); this.columnHeader4.Text = LocalizeText.Get(335); this.labelProcess.Text = LocalizeText.Get(336); this.columnHeader3.Text = LocalizeText.Get(337); this.menuItemProcessAdd.Text = LocalizeText.Get(338); this.menuItemProcessRemove.Text = LocalizeText.Get(339); this.menuItemProcessProperty.Text = LocalizeText.Get(340); this.menuItemClientProperty.Text = LocalizeText.Get(341); this.menuItemSelfUpdate.Text = LocalizeText.Get(342); }
private string GetExeTypeStr(RCProcessScheduler.EExeType type) { switch (type) { case RCProcessScheduler.EExeType.StdInput: return(LocalizeText.Get(449)); case RCProcessScheduler.EExeType.ExternalExe: return(LocalizeText.Get(448)); default: return(type.ToString()); } }
public PersonalInfo(string ID, string Authority) { this.InitializeComponent(); this.label1.Text = LocalizeText.Get(165); this.label2.Text = LocalizeText.Get(166); this.label3.Text = LocalizeText.Get(167); this.label4.Text = LocalizeText.Get(168); this.label5.Text = LocalizeText.Get(169); this.BtnOK.Text = LocalizeText.Get(170); this.BtnCancel.Text = LocalizeText.Get(171); this.Text = LocalizeText.Get(172); this.LabelID.Text = ID; this.LabelAuth.Text = Authority; }
private void buttonScheduleAdd_Click(object sender, EventArgs e) { SchedulerSettingForm schedulerSettingForm = new SchedulerSettingForm(); while (schedulerSettingForm.ShowDialog() == DialogResult.OK) { if (!this.listViewSchedule.Items.ContainsKey(schedulerSettingForm.ScheduleName)) { RCProcessScheduler schedule = new RCProcessScheduler(schedulerSettingForm.ScheduleName, schedulerSettingForm.ScheduleType, schedulerSettingForm.ScheduleTime, schedulerSettingForm.ExeType, schedulerSettingForm.Command, true); this.AddProcessSchedule(schedule); return; } Utility.ShowErrorMessage(LocalizeText.Get(451)); } }
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(); } }
public StdinCommandForm(string customCommandString, IEnumerable <string> serverGroup) { this.InitializeComponent(); this.groupBoxCommand.Text = LocalizeText.Get(242); this.groupBoxArgList.Text = LocalizeText.Get(243); this.buttonOK.Text = LocalizeText.Get(244); this.buttonCancel.Text = LocalizeText.Get(245); this.tabPage1.Text = LocalizeText.Get(523); this.Text = LocalizeText.Get(246); foreach (RCProcess.CustomCommandParser command in RCProcess.CustomCommandParser.GetFromRawString(customCommandString)) { this.listBoxCommand.Items.Add(new CommandForm.CommandItem(command)); } this.controlArgs = new List <Control>(); this.serverList = new List <string>(serverGroup); }
public UserView(RCUserHandler rcUser, IEnumerable <Member> memberList) { this.InitializeComponent(); this.UserId.Text = LocalizeText.Get(173); this.UserAuthority.Text = LocalizeText.Get(174); this.BtnAddUser.Text = LocalizeText.Get(175); this.BtnRemoveUser.Text = LocalizeText.Get(176); this.BtnChangeUser.Text = LocalizeText.Get(177); this.BtnOK.Text = LocalizeText.Get(178); this.Text = LocalizeText.Get(179); this._rcUser = rcUser; foreach (Member member in memberList) { this.AddMember(member.ID, member.Authority); } }
public static string GetScheduleTypeStr(RCProcessScheduler.EScheduleType type) { switch (type) { case RCProcessScheduler.EScheduleType.AfterBoot: return(LocalizeText.Get(445)); case RCProcessScheduler.EScheduleType.AfterCrach: return(LocalizeText.Get(446)); case RCProcessScheduler.EScheduleType.Once: return(LocalizeText.Get(447)); default: return(type.ToString()); } }
public ServerGroupControl() { this.InitializeComponent(); this.menuItemWorkGroupRename.Text = LocalizeText.Get(361); this.menuItemWorkGroupNew.Text = LocalizeText.Get(362); this.menuItemWorkGroupDelete.Text = LocalizeText.Get(363); this.menuItemWorkGroupMoveUp.Text = LocalizeText.Get(364); this.menuItemWorkGroupMoveDown.Text = LocalizeText.Get(365); this.menuItemWorkGroupNewRoot.Text = LocalizeText.Get(366); this.columnHeader1.Text = LocalizeText.Get(193); this.menuItemClientProcessRemove.Text = LocalizeText.Get(371); this.labelServerGroup.Text = LocalizeText.Get(516); this.labelBound.Text = LocalizeText.Get(517); this.columnHeader3.Text = LocalizeText.Get(193); this.labelUnbound.Text = LocalizeText.Get(377); this._serverRefCountList = new SortedList <string, int>(); }