private void cmdTest_Click(object sender, EventArgs e) { if (CheckControls(true)) { ProcessCollectorConfigEntry testEntry = new ProcessCollectorConfigEntry() { Name = txtName.Text, ProcessFilterType = (ProcessCollectorFilterType)cboFilterType.SelectedIndex, ProcessFilter = txtFilter.Text, ProcessCollectorTestType = (ProcessCollectorTestType)cboTestType.SelectedIndex, MinimumRunningInstanceCount = (int)nudMinInstanceCount.Value, MaximumRunningInstanceCount = (int)nudMaxInstanceCount.Value, ProcessorPercWarningTrigger = (int)nudCPUWarn.Value, ProcessorPercErrorTrigger = (int)nudCPUErr.Value, MemoryKBWarningTrigger = (int)nudMemWarn.Value, MemoryKBErrorTrigger = (int)nudMemErr.Value, ThreadCountWarningTrigger = (int)nudThreadCountWarn.Value, ThreadCountErrorTrigger = (int)nudThreadCountErr.Value }; MonitorState testState = testEntry.GetCurrentState(); string value = testState.ReadFirstValue(true); string rawDetails = testState.ReadAllRawDetails(); Forms.ShowTextDialog td = new Forms.ShowTextDialog(); td.Height = 300; td.ShowText("Test results", string.Format($"State: {testState.State}\r\n\r\nValue: {value}\r\nDetails: {rawDetails}"), true); } }
private void llblVariableTip_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Forms.ShowTextDialog tipWindow = new Forms.ShowTextDialog(); tipWindow.Height = 200; tipWindow.ShowScrollbars = false; tipWindow.TextAlign = HorizontalAlignment.Center; tipWindow.FormBorderStyle = FormBorderStyle.SizableToolWindow; tipWindow.TopMost = true; tipWindow.ShowText("Variables tip", "\r\nYou can set up variables that will be use to prompt you for a value when use the template.\r\n\r\nUse [[Variable Name]] to create a variable named 'Variable Name'\r\n\r\nTo specify a default value use [[Variable Name:default value]]", true); }
private void llblScriptingTip_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Forms.ShowTextDialog tipWindow = new Forms.ShowTextDialog(); tipWindow.Height = 300; tipWindow.ShowScrollbars = false; tipWindow.WordWrap = true; tipWindow.FormBorderStyle = FormBorderStyle.SizableToolWindow; tipWindow.TopMost = true; tipWindow.ShowText("PowerShell Scripting tips", Properties.Resources.PowerShellTips, true); }