@@ -4,4 +4,4 @@ bin/ | |||
*.suo | |||
*.exe | |||
*.msi | |||
_ReSharper.Clickforensics.Quartz/ | |||
_ReSharper.Clickforensics.Quartz/ |
@@ -1,4 +1,4 @@ | |||
"DeployProject" | |||
"DeployProject" | |||
{ | |||
"VSVersion" = "3:800" | |||
"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" | |||
@@ -33,13 +33,11 @@ namespace ClickForensics.Quartz.Manager | |||
} | |||
private void loadJobAssemblies() | |||
{ | |||
FileStream stream = File.OpenRead("JobAssemblies.txt"); | |||
StreamReader reader = new StreamReader(stream); | |||
string line; | |||
var assemblies = AssemblyRepository.GetAssemblies(); | |||
SortedList<string, string> jobTypes = new SortedList<string, string>(); | |||
while ((line = reader.ReadLine()) != null) | |||
foreach (var assemblyName in assemblies) | |||
{ | |||
Assembly assembly = Assembly.LoadFile(Environment.CurrentDirectory + "\\" + line); | |||
Assembly assembly = Assembly.LoadFile(Environment.CurrentDirectory + "\\" + assemblyName); | |||
foreach (Type type in assembly.GetTypes()) | |||
{ | |||
if (typeof(IJob).IsAssignableFrom(type) && type.IsClass) | |||
@@ -0,0 +1,55 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.IO; | |||
using System.Linq; | |||
using System.Text; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public class AssemblyRepository | |||
{ | |||
public static void AddAssembly(string assembly) | |||
{ | |||
var assemblies = GetAssemblies(); | |||
assemblies.Add(assembly); | |||
using (StreamWriter stream = File.CreateText("JobAssemblies.txt")) | |||
{ | |||
foreach (var assemblyName in assemblies) | |||
{ | |||
stream.WriteLine(assemblyName); | |||
} | |||
} | |||
} | |||
public static HashSet<string> GetAssemblies() | |||
{ | |||
HashSet<string> assemblies = new HashSet<string>(); | |||
using (FileStream stream = File.OpenRead("JobAssemblies.txt")) | |||
{ | |||
using (StreamReader reader = new StreamReader(stream)) | |||
{ | |||
string line; | |||
while ((line = reader.ReadLine()) != null) | |||
{ | |||
assemblies.Add(line); | |||
} | |||
} | |||
} | |||
return assemblies; | |||
} | |||
public static void DeleteAssembly(string assembly) | |||
{ | |||
var assemblies = GetAssemblies(); | |||
assemblies.Remove(assembly); | |||
using (StreamWriter stream = File.CreateText("JobAssemblies.txt")) | |||
{ | |||
foreach (var assemblyName in assemblies) | |||
{ | |||
stream.WriteLine(assemblyName); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -88,6 +88,20 @@ | |||
<Compile Include="AddListenerForm.Designer.cs"> | |||
<DependentUpon>AddListenerForm.cs</DependentUpon> | |||
</Compile> | |||
<Compile Include="AssemblyRepository.cs" /> | |||
<Compile Include="ConnectionInfo.cs" /> | |||
<Compile Include="DeleteAssembliesForm.cs"> | |||
<SubType>Form</SubType> | |||
</Compile> | |||
<Compile Include="DeleteAssembliesForm.Designer.cs"> | |||
<DependentUpon>DeleteAssembliesForm.cs</DependentUpon> | |||
</Compile> | |||
<Compile Include="SimpleTriggerDisplay.cs"> | |||
<SubType>UserControl</SubType> | |||
</Compile> | |||
<Compile Include="SimpleTriggerDisplay.Designer.cs"> | |||
<DependentUpon>SimpleTriggerDisplay.cs</DependentUpon> | |||
</Compile> | |||
<Compile Include="ErrorDialog.cs"> | |||
<SubType>Form</SubType> | |||
</Compile> | |||
@@ -116,6 +130,12 @@ | |||
<EmbeddedResource Include="AddListenerForm.resx"> | |||
<DependentUpon>AddListenerForm.cs</DependentUpon> | |||
</EmbeddedResource> | |||
<EmbeddedResource Include="DeleteAssembliesForm.resx"> | |||
<DependentUpon>DeleteAssembliesForm.cs</DependentUpon> | |||
</EmbeddedResource> | |||
<EmbeddedResource Include="SimpleTriggerDisplay.resx"> | |||
<DependentUpon>SimpleTriggerDisplay.cs</DependentUpon> | |||
</EmbeddedResource> | |||
<EmbeddedResource Include="CronTriggerDisplay.resx"> | |||
<DependentUpon>CronTriggerDisplay.cs</DependentUpon> | |||
</EmbeddedResource> | |||
@@ -152,6 +172,7 @@ | |||
<DesignTimeSharedInput>True</DesignTimeSharedInput> | |||
</Compile> | |||
<Compile Include="QuartzScheduler.cs" /> | |||
<Compile Include="RegistryStore.cs" /> | |||
<Compile Include="SchedulerNode.cs" /> | |||
<Compile Include="ServerConnectForm.cs"> | |||
<SubType>Form</SubType> | |||
@@ -0,0 +1,35 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public class ConnectionInfo | |||
{ | |||
public ConnectionInfo() | |||
{ | |||
} | |||
public static ConnectionInfo Parse(string connectionString) | |||
{ | |||
if (connectionString == null) | |||
{ | |||
return null; | |||
} | |||
string[] parameters = connectionString.Split(new string[] { "|" }, StringSplitOptions.None); | |||
if (parameters.Length != 3) | |||
{ | |||
return null; | |||
} | |||
return new ConnectionInfo { ServerName = parameters[0], Port = int.Parse(parameters[1]), SchedulerName = parameters[2] }; | |||
} | |||
public string ServerName { get; set; } | |||
public int Port { get; set; } | |||
public string SchedulerName { get; set; } | |||
public override string ToString() | |||
{ | |||
return string.Format("{0}|{1}|{2}", ServerName, Port, SchedulerName); | |||
} | |||
} | |||
} |
@@ -0,0 +1,72 @@ | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
partial class DeleteAssembliesForm | |||
{ | |||
/// <summary> | |||
/// Required designer variable. | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// Clean up any resources being used. | |||
/// </summary> | |||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region Windows Form Designer generated code | |||
/// <summary> | |||
/// Required method for Designer support - do not modify | |||
/// the contents of this method with the code editor. | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.lbxAssemblies = new System.Windows.Forms.ListBox(); | |||
this.btnDelete = new System.Windows.Forms.Button(); | |||
this.SuspendLayout(); | |||
// | |||
// lbxAssemblies | |||
// | |||
this.lbxAssemblies.FormattingEnabled = true; | |||
this.lbxAssemblies.Location = new System.Drawing.Point(42, 25); | |||
this.lbxAssemblies.Name = "lbxAssemblies"; | |||
this.lbxAssemblies.Size = new System.Drawing.Size(162, 212); | |||
this.lbxAssemblies.TabIndex = 0; | |||
// | |||
// btnDelete | |||
// | |||
this.btnDelete.Location = new System.Drawing.Point(80, 243); | |||
this.btnDelete.Name = "btnDelete"; | |||
this.btnDelete.Size = new System.Drawing.Size(75, 23); | |||
this.btnDelete.TabIndex = 1; | |||
this.btnDelete.Text = "Delete"; | |||
this.btnDelete.UseVisualStyleBackColor = true; | |||
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); | |||
// | |||
// DeleteAssembliesForm | |||
// | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.ClientSize = new System.Drawing.Size(247, 291); | |||
this.Controls.Add(this.btnDelete); | |||
this.Controls.Add(this.lbxAssemblies); | |||
this.Name = "DeleteAssembliesForm"; | |||
this.Text = "DeleteAssembliesForm"; | |||
this.Load += new System.EventHandler(this.DeleteAssembliesForm_Load); | |||
this.ResumeLayout(false); | |||
} | |||
#endregion | |||
private System.Windows.Forms.ListBox lbxAssemblies; | |||
private System.Windows.Forms.Button btnDelete; | |||
} | |||
} |
@@ -0,0 +1,33 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Data; | |||
using System.Drawing; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Windows.Forms; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public partial class DeleteAssembliesForm : Form | |||
{ | |||
public DeleteAssembliesForm() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private void btnDelete_Click(object sender, EventArgs e) | |||
{ | |||
if (lbxAssemblies.SelectedItem != null) | |||
{ | |||
AssemblyRepository.DeleteAssembly(lbxAssemblies.SelectedItem as string); | |||
lbxAssemblies.DataSource = AssemblyRepository.GetAssemblies().ToList(); | |||
} | |||
} | |||
private void DeleteAssembliesForm_Load(object sender, EventArgs e) | |||
{ | |||
lbxAssemblies.DataSource = AssemblyRepository.GetAssemblies().ToList(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,120 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<root> | |||
<!-- | |||
Microsoft ResX Schema | |||
Version 2.0 | |||
The primary goals of this format is to allow a simple XML format | |||
that is mostly human readable. The generation and parsing of the | |||
various data types are done through the TypeConverter classes | |||
associated with the data types. | |||
Example: | |||
... ado.net/XML headers & schema ... | |||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||
<resheader name="version">2.0</resheader> | |||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||
</data> | |||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
<comment>This is a comment</comment> | |||
</data> | |||
There are any number of "resheader" rows that contain simple | |||
name/value pairs. | |||
Each data row contains a name, and value. The row also contains a | |||
type or mimetype. Type corresponds to a .NET class that support | |||
text/value conversion through the TypeConverter architecture. | |||
Classes that don't support this are serialized and stored with the | |||
mimetype set. | |||
The mimetype is used for serialized objects, and tells the | |||
ResXResourceReader how to depersist the object. This is currently not | |||
extensible. For a given mimetype the value must be set accordingly: | |||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||
that the ResXResourceWriter will generate, however the reader can | |||
read any of the formats listed below. | |||
mimetype: application/x-microsoft.net.object.binary.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.soap.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
value : The object must be serialized into a byte array | |||
: using a System.ComponentModel.TypeConverter | |||
: and then encoded with base64 encoding. | |||
--> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
</root> |
@@ -1,399 +1,429 @@ | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
partial class MainForm | |||
{ | |||
/// <summary> | |||
/// Required designer variable. | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// Clean up any resources being used. | |||
/// </summary> | |||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region Windows Form Designer generated code | |||
/// <summary> | |||
/// Required method for Designer support - do not modify | |||
/// the contents of this method with the code editor. | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.components = new System.ComponentModel.Container(); | |||
this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); | |||
this.schedulerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.jobsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addJobToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.listenersStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.globalListenersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addGlobalJobListenerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addTriggerListenerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addJobListenerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.statusStrip1 = new System.Windows.Forms.StatusStrip(); | |||
this.serverConnectStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); | |||
this.StripStatusLabel_Job_Groups = new System.Windows.Forms.ToolStripStatusLabel(); | |||
this.StripStatusLabel_Jobs_Refresh_date = new System.Windows.Forms.ToolStripStatusLabel(); | |||
this.jobGroupsTreeView = new System.Windows.Forms.TreeView(); | |||
this.label1 = new System.Windows.Forms.Label(); | |||
this.label2 = new System.Windows.Forms.Label(); | |||
this.btnRefreshRunningJobs = new System.Windows.Forms.Button(); | |||
this.btnRefreshJobGroups = new System.Windows.Forms.Button(); | |||
this.btnDeleteJob = new System.Windows.Forms.Button(); | |||
this.btnRunJobNow = new System.Windows.Forms.Button(); | |||
this.btnPause = new System.Windows.Forms.Button(); | |||
this.pnlDetails = new System.Windows.Forms.Panel(); | |||
this.label3 = new System.Windows.Forms.Label(); | |||
this.btnEdit = new System.Windows.Forms.Button(); | |||
this.ctxScheduler = new System.Windows.Forms.ContextMenuStrip(this.components); | |||
this.backupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.timer_Refresh_Running_Jobs = new System.Windows.Forms.Timer(this.components); | |||
this.listView_RunningJobs = new System.Windows.Forms.ListView(); | |||
this.JobName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |||
this.JobDuration = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |||
this.mainMenuStrip.SuspendLayout(); | |||
this.statusStrip1.SuspendLayout(); | |||
this.ctxScheduler.SuspendLayout(); | |||
this.SuspendLayout(); | |||
// | |||
// mainMenuStrip | |||
// | |||
this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.schedulerToolStripMenuItem, | |||
this.jobsToolStripMenuItem, | |||
this.listenersStripMenuItem}); | |||
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0); | |||
this.mainMenuStrip.Name = "mainMenuStrip"; | |||
this.mainMenuStrip.Size = new System.Drawing.Size(913, 24); | |||
this.mainMenuStrip.TabIndex = 0; | |||
this.mainMenuStrip.Text = "menuStrip1"; | |||
// | |||
// schedulerToolStripMenuItem | |||
// | |||
this.schedulerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.connectToolStripMenuItem}); | |||
this.schedulerToolStripMenuItem.Name = "schedulerToolStripMenuItem"; | |||
this.schedulerToolStripMenuItem.Size = new System.Drawing.Size(71, 20); | |||
this.schedulerToolStripMenuItem.Text = "Scheduler"; | |||
// | |||
// connectToolStripMenuItem | |||
// | |||
this.connectToolStripMenuItem.Name = "connectToolStripMenuItem"; | |||
this.connectToolStripMenuItem.Size = new System.Drawing.Size(119, 22); | |||
this.connectToolStripMenuItem.Text = "Connect"; | |||
this.connectToolStripMenuItem.Click += new System.EventHandler(this.connectToolStripMenuItem_Click); | |||
// | |||
// jobsToolStripMenuItem | |||
// | |||
this.jobsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.addJobToolStripMenuItem}); | |||
this.jobsToolStripMenuItem.Enabled = false; | |||
this.jobsToolStripMenuItem.Name = "jobsToolStripMenuItem"; | |||
this.jobsToolStripMenuItem.Size = new System.Drawing.Size(42, 20); | |||
this.jobsToolStripMenuItem.Text = "Jobs"; | |||
// | |||
// addJobToolStripMenuItem | |||
// | |||
this.addJobToolStripMenuItem.Name = "addJobToolStripMenuItem"; | |||
this.addJobToolStripMenuItem.Size = new System.Drawing.Size(96, 22); | |||
this.addJobToolStripMenuItem.Text = "Add"; | |||
this.addJobToolStripMenuItem.Click += new System.EventHandler(this.addJobToolStripMenuItem_Click); | |||
// | |||
// listenersStripMenuItem | |||
// | |||
this.listenersStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.globalListenersToolStripMenuItem, | |||
this.addJobListenerToolStripMenuItem}); | |||
this.listenersStripMenuItem.Enabled = false; | |||
this.listenersStripMenuItem.Name = "listenersStripMenuItem"; | |||
this.listenersStripMenuItem.Size = new System.Drawing.Size(65, 20); | |||
this.listenersStripMenuItem.Text = "Listeners"; | |||
// | |||
// globalListenersToolStripMenuItem | |||
// | |||
this.globalListenersToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.addGlobalJobListenerToolStripMenuItem, | |||
this.addTriggerListenerToolStripMenuItem}); | |||
this.globalListenersToolStripMenuItem.Name = "globalListenersToolStripMenuItem"; | |||
this.globalListenersToolStripMenuItem.Size = new System.Drawing.Size(161, 22); | |||
this.globalListenersToolStripMenuItem.Text = "Global"; | |||
// | |||
// addGlobalJobListenerToolStripMenuItem | |||
// | |||
this.addGlobalJobListenerToolStripMenuItem.Name = "addGlobalJobListenerToolStripMenuItem"; | |||
this.addGlobalJobListenerToolStripMenuItem.Size = new System.Drawing.Size(181, 22); | |||
this.addGlobalJobListenerToolStripMenuItem.Text = "Add Job Listener"; | |||
this.addGlobalJobListenerToolStripMenuItem.Click += new System.EventHandler(this.addGlobalListenerToolStripMenuItem_Click); | |||
// | |||
// addTriggerListenerToolStripMenuItem | |||
// | |||
this.addTriggerListenerToolStripMenuItem.Name = "addTriggerListenerToolStripMenuItem"; | |||
this.addTriggerListenerToolStripMenuItem.Size = new System.Drawing.Size(181, 22); | |||
this.addTriggerListenerToolStripMenuItem.Text = "Add Trigger Listener"; | |||
// | |||
// addJobListenerToolStripMenuItem | |||
// | |||
this.addJobListenerToolStripMenuItem.Name = "addJobListenerToolStripMenuItem"; | |||
this.addJobListenerToolStripMenuItem.Size = new System.Drawing.Size(161, 22); | |||
this.addJobListenerToolStripMenuItem.Text = "Add Job Listener"; | |||
this.addJobListenerToolStripMenuItem.Click += new System.EventHandler(this.addJobListenerToolStripMenuItem_Click); | |||
// | |||
// statusStrip1 | |||
// | |||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.serverConnectStatusLabel, | |||
this.StripStatusLabel_Job_Groups, | |||
this.StripStatusLabel_Jobs_Refresh_date}); | |||
this.statusStrip1.Location = new System.Drawing.Point(0, 639); | |||
this.statusStrip1.Name = "statusStrip1"; | |||
this.statusStrip1.Size = new System.Drawing.Size(913, 22); | |||
this.statusStrip1.TabIndex = 1; | |||
this.statusStrip1.Text = "statusStrip1"; | |||
// | |||
// serverConnectStatusLabel | |||
// | |||
this.serverConnectStatusLabel.Name = "serverConnectStatusLabel"; | |||
this.serverConnectStatusLabel.Size = new System.Drawing.Size(86, 17); | |||
this.serverConnectStatusLabel.Text = "Not connected"; | |||
// | |||
// StripStatusLabel_Job_Groups | |||
// | |||
this.StripStatusLabel_Job_Groups.BackColor = System.Drawing.Color.LightCyan; | |||
this.StripStatusLabel_Job_Groups.Name = "StripStatusLabel_Job_Groups"; | |||
this.StripStatusLabel_Job_Groups.Size = new System.Drawing.Size(157, 17); | |||
this.StripStatusLabel_Job_Groups.Text = "StripStatusLabel_Job_Groups"; | |||
this.StripStatusLabel_Job_Groups.ToolTipText = "Last Refresh of Job Groups"; | |||
// | |||
// StripStatusLabel_Jobs_Refresh_date | |||
// | |||
this.StripStatusLabel_Jobs_Refresh_date.BackColor = System.Drawing.SystemColors.ActiveCaptionText; | |||
this.StripStatusLabel_Jobs_Refresh_date.Name = "StripStatusLabel_Jobs_Refresh_date"; | |||
this.StripStatusLabel_Jobs_Refresh_date.Size = new System.Drawing.Size(191, 17); | |||
this.StripStatusLabel_Jobs_Refresh_date.Text = "StripStatusLabel_Jobs_Refresh_date"; | |||
this.StripStatusLabel_Jobs_Refresh_date.ToolTipText = "Last Refresh Date of Running Jobs"; | |||
// | |||
// jobGroupsTreeView | |||
// | |||
this.jobGroupsTreeView.HideSelection = false; | |||
this.jobGroupsTreeView.Location = new System.Drawing.Point(8, 48); | |||
this.jobGroupsTreeView.Name = "jobGroupsTreeView"; | |||
this.jobGroupsTreeView.Size = new System.Drawing.Size(351, 252); | |||
this.jobGroupsTreeView.TabIndex = 2; | |||
// | |||
// label1 | |||
// | |||
this.label1.AutoSize = true; | |||
this.label1.Location = new System.Drawing.Point(8, 32); | |||
this.label1.Name = "label1"; | |||
this.label1.Size = new System.Drawing.Size(94, 13); | |||
this.label1.TabIndex = 4; | |||
this.label1.Text = "Scheduler Objects"; | |||
// | |||
// label2 | |||
// | |||
this.label2.AutoSize = true; | |||
this.label2.Location = new System.Drawing.Point(9, 319); | |||
this.label2.Name = "label2"; | |||
this.label2.Size = new System.Drawing.Size(72, 13); | |||
this.label2.TabIndex = 5; | |||
this.label2.Text = "Running Jobs"; | |||
// | |||
// btnRefreshRunningJobs | |||
// | |||
this.btnRefreshRunningJobs.Location = new System.Drawing.Point(371, 609); | |||
this.btnRefreshRunningJobs.Name = "btnRefreshRunningJobs"; | |||
this.btnRefreshRunningJobs.Size = new System.Drawing.Size(75, 23); | |||
this.btnRefreshRunningJobs.TabIndex = 6; | |||
this.btnRefreshRunningJobs.Text = "Refresh"; | |||
this.btnRefreshRunningJobs.UseVisualStyleBackColor = true; | |||
this.btnRefreshRunningJobs.Click += new System.EventHandler(this.btnRefreshRunningJobs_Click); | |||
// | |||
// btnRefreshJobGroups | |||
// | |||
this.btnRefreshJobGroups.Location = new System.Drawing.Point(284, 306); | |||
this.btnRefreshJobGroups.Name = "btnRefreshJobGroups"; | |||
this.btnRefreshJobGroups.Size = new System.Drawing.Size(75, 23); | |||
this.btnRefreshJobGroups.TabIndex = 7; | |||
this.btnRefreshJobGroups.Text = "Refresh"; | |||
this.btnRefreshJobGroups.UseVisualStyleBackColor = true; | |||
this.btnRefreshJobGroups.Click += new System.EventHandler(this.btnRefreshJobGroups_Click); | |||
// | |||
// btnDeleteJob | |||
// | |||
this.btnDeleteJob.Enabled = false; | |||
this.btnDeleteJob.Location = new System.Drawing.Point(533, 306); | |||
this.btnDeleteJob.Name = "btnDeleteJob"; | |||
this.btnDeleteJob.Size = new System.Drawing.Size(65, 23); | |||
this.btnDeleteJob.TabIndex = 8; | |||
this.btnDeleteJob.Text = "Delete"; | |||
this.btnDeleteJob.UseVisualStyleBackColor = true; | |||
this.btnDeleteJob.Click += new System.EventHandler(this.btnDeleteJob_Click); | |||
// | |||
// btnRunJobNow | |||
// | |||
this.btnRunJobNow.Enabled = false; | |||
this.btnRunJobNow.Location = new System.Drawing.Point(391, 306); | |||
this.btnRunJobNow.Name = "btnRunJobNow"; | |||
this.btnRunJobNow.Size = new System.Drawing.Size(65, 23); | |||
this.btnRunJobNow.TabIndex = 9; | |||
this.btnRunJobNow.Text = "Run"; | |||
this.btnRunJobNow.UseVisualStyleBackColor = true; | |||
this.btnRunJobNow.Click += new System.EventHandler(this.btnRunJobNow_Click); | |||
// | |||
// btnPause | |||
// | |||
this.btnPause.Enabled = false; | |||
this.btnPause.Location = new System.Drawing.Point(462, 306); | |||
this.btnPause.Name = "btnPause"; | |||
this.btnPause.Size = new System.Drawing.Size(65, 23); | |||
this.btnPause.TabIndex = 10; | |||
this.btnPause.Text = "Pause"; | |||
this.btnPause.UseVisualStyleBackColor = true; | |||
this.btnPause.Click += new System.EventHandler(this.btnPause_Click); | |||
// | |||
// pnlDetails | |||
// | |||
this.pnlDetails.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; | |||
this.pnlDetails.Location = new System.Drawing.Point(391, 45); | |||
this.pnlDetails.Name = "pnlDetails"; | |||
this.pnlDetails.Size = new System.Drawing.Size(342, 252); | |||
this.pnlDetails.TabIndex = 11; | |||
// | |||
// label3 | |||
// | |||
this.label3.AutoSize = true; | |||
this.label3.Location = new System.Drawing.Point(388, 29); | |||
this.label3.Name = "label3"; | |||
this.label3.Size = new System.Drawing.Size(39, 13); | |||
this.label3.TabIndex = 12; | |||
this.label3.Text = "Details"; | |||
// | |||
// btnEdit | |||
// | |||
this.btnEdit.Enabled = false; | |||
this.btnEdit.Location = new System.Drawing.Point(604, 306); | |||
this.btnEdit.Name = "btnEdit"; | |||
this.btnEdit.Size = new System.Drawing.Size(65, 23); | |||
this.btnEdit.TabIndex = 13; | |||
this.btnEdit.Text = "Edit"; | |||
this.btnEdit.UseVisualStyleBackColor = true; | |||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); | |||
// | |||
// ctxScheduler | |||
// | |||
this.ctxScheduler.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.backupToolStripMenuItem}); | |||
this.ctxScheduler.Name = "ctxScheduler"; | |||
this.ctxScheduler.Size = new System.Drawing.Size(109, 26); | |||
// | |||
// backupToolStripMenuItem | |||
// | |||
this.backupToolStripMenuItem.Name = "backupToolStripMenuItem"; | |||
this.backupToolStripMenuItem.Size = new System.Drawing.Size(108, 22); | |||
this.backupToolStripMenuItem.Text = "Backup"; | |||
this.backupToolStripMenuItem.Click += new System.EventHandler(this.backupToolStripMenuItem_Click); | |||
// | |||
// timer_Refresh_Running_Jobs | |||
// | |||
this.timer_Refresh_Running_Jobs.Interval = 30000; | |||
this.timer_Refresh_Running_Jobs.Tick += new System.EventHandler(this.timer_Refresh_Running_Jobs_Tick); | |||
// | |||
// listView_RunningJobs | |||
// | |||
this.listView_RunningJobs.AllowColumnReorder = true; | |||
this.listView_RunningJobs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { | |||
this.JobName, | |||
this.JobDuration}); | |||
this.listView_RunningJobs.Location = new System.Drawing.Point(8, 335); | |||
this.listView_RunningJobs.Name = "listView_RunningJobs"; | |||
this.listView_RunningJobs.Size = new System.Drawing.Size(725, 268); | |||
this.listView_RunningJobs.Sorting = System.Windows.Forms.SortOrder.Ascending; | |||
this.listView_RunningJobs.TabIndex = 14; | |||
this.listView_RunningJobs.UseCompatibleStateImageBehavior = false; | |||
this.listView_RunningJobs.View = System.Windows.Forms.View.Details; | |||
// | |||
// JobName | |||
// | |||
this.JobName.Text = "Job Name"; | |||
// | |||
// JobDuration | |||
// | |||
this.JobDuration.Text = "Duration"; | |||
// | |||
// MainForm | |||
// | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.ClientSize = new System.Drawing.Size(913, 661); | |||
this.Controls.Add(this.btnRefreshJobGroups); | |||
this.Controls.Add(this.listView_RunningJobs); | |||
this.Controls.Add(this.pnlDetails); | |||
this.Controls.Add(this.label3); | |||
this.Controls.Add(this.label1); | |||
this.Controls.Add(this.btnEdit); | |||
this.Controls.Add(this.btnRefreshRunningJobs); | |||
this.Controls.Add(this.btnPause); | |||
this.Controls.Add(this.label2); | |||
this.Controls.Add(this.statusStrip1); | |||
this.Controls.Add(this.mainMenuStrip); | |||
this.Controls.Add(this.btnRunJobNow); | |||
this.Controls.Add(this.jobGroupsTreeView); | |||
this.Controls.Add(this.btnDeleteJob); | |||
this.MainMenuStrip = this.mainMenuStrip; | |||
this.Name = "MainForm"; | |||
this.Text = "Quartz Manager"; | |||
this.mainMenuStrip.ResumeLayout(false); | |||
this.mainMenuStrip.PerformLayout(); | |||
this.statusStrip1.ResumeLayout(false); | |||
this.statusStrip1.PerformLayout(); | |||
this.ctxScheduler.ResumeLayout(false); | |||
this.ResumeLayout(false); | |||
this.PerformLayout(); | |||
} | |||
#endregion | |||
private System.Windows.Forms.MenuStrip mainMenuStrip; | |||
private System.Windows.Forms.ToolStripMenuItem schedulerToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem connectToolStripMenuItem; | |||
private System.Windows.Forms.StatusStrip statusStrip1; | |||
private System.Windows.Forms.ToolStripStatusLabel serverConnectStatusLabel; | |||
private System.Windows.Forms.TreeView jobGroupsTreeView; | |||
private System.Windows.Forms.ToolStripMenuItem listenersStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem globalListenersToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addGlobalJobListenerToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addTriggerListenerToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addJobListenerToolStripMenuItem; | |||
private System.Windows.Forms.Label label1; | |||
private System.Windows.Forms.Label label2; | |||
private System.Windows.Forms.ToolStripMenuItem jobsToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addJobToolStripMenuItem; | |||
private System.Windows.Forms.Button btnRefreshRunningJobs; | |||
private System.Windows.Forms.Button btnRefreshJobGroups; | |||
private System.Windows.Forms.Button btnDeleteJob; | |||
private System.Windows.Forms.Button btnRunJobNow; | |||
private System.Windows.Forms.Button btnPause; | |||
private System.Windows.Forms.Panel pnlDetails; | |||
private System.Windows.Forms.Label label3; | |||
private System.Windows.Forms.Button btnEdit; | |||
private System.Windows.Forms.ContextMenuStrip ctxScheduler; | |||
private System.Windows.Forms.ToolStripMenuItem backupToolStripMenuItem; | |||
private System.Windows.Forms.Timer timer_Refresh_Running_Jobs; | |||
private System.Windows.Forms.ToolStripStatusLabel StripStatusLabel_Jobs_Refresh_date; | |||
private System.Windows.Forms.ToolStripStatusLabel StripStatusLabel_Job_Groups; | |||
private System.Windows.Forms.ListView listView_RunningJobs; | |||
private System.Windows.Forms.ColumnHeader JobName; | |||
private System.Windows.Forms.ColumnHeader JobDuration; | |||
} | |||
} | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
partial class MainForm | |||
{ | |||
/// <summary> | |||
/// Required designer variable. | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// Clean up any resources being used. | |||
/// </summary> | |||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region Windows Form Designer generated code | |||
/// <summary> | |||
/// Required method for Designer support - do not modify | |||
/// the contents of this method with the code editor. | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.components = new System.ComponentModel.Container(); | |||
this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); | |||
this.schedulerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.jobsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addJobToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.listenersStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.globalListenersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addGlobalJobListenerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addTriggerListenerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addJobListenerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.statusStrip1 = new System.Windows.Forms.StatusStrip(); | |||
this.serverConnectStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); | |||
this.StripStatusLabel_Job_Groups = new System.Windows.Forms.ToolStripStatusLabel(); | |||
this.StripStatusLabel_Jobs_Refresh_date = new System.Windows.Forms.ToolStripStatusLabel(); | |||
this.jobGroupsTreeView = new System.Windows.Forms.TreeView(); | |||
this.label1 = new System.Windows.Forms.Label(); | |||
this.label2 = new System.Windows.Forms.Label(); | |||
this.btnRefreshRunningJobs = new System.Windows.Forms.Button(); | |||
this.btnRefreshJobGroups = new System.Windows.Forms.Button(); | |||
this.btnDeleteJob = new System.Windows.Forms.Button(); | |||
this.btnRunJobNow = new System.Windows.Forms.Button(); | |||
this.btnPause = new System.Windows.Forms.Button(); | |||
this.pnlDetails = new System.Windows.Forms.Panel(); | |||
this.label3 = new System.Windows.Forms.Label(); | |||
this.btnEdit = new System.Windows.Forms.Button(); | |||
this.ctxScheduler = new System.Windows.Forms.ContextMenuStrip(this.components); | |||
this.backupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.timer_Refresh_Running_Jobs = new System.Windows.Forms.Timer(this.components); | |||
this.listView_RunningJobs = new System.Windows.Forms.ListView(); | |||
this.JobName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |||
this.JobDuration = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |||
this.jobAssembliesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.addAssemblyMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.deleteAssemblyMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |||
this.mainMenuStrip.SuspendLayout(); | |||
this.statusStrip1.SuspendLayout(); | |||
this.ctxScheduler.SuspendLayout(); | |||
this.SuspendLayout(); | |||
// | |||
// mainMenuStrip | |||
// | |||
this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.schedulerToolStripMenuItem, | |||
this.jobsToolStripMenuItem, | |||
this.listenersStripMenuItem, | |||
this.jobAssembliesToolStripMenuItem}); | |||
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0); | |||
this.mainMenuStrip.Name = "mainMenuStrip"; | |||
this.mainMenuStrip.Size = new System.Drawing.Size(913, 24); | |||
this.mainMenuStrip.TabIndex = 0; | |||
this.mainMenuStrip.Text = "menuStrip1"; | |||
// | |||
// schedulerToolStripMenuItem | |||
// | |||
this.schedulerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.connectToolStripMenuItem}); | |||
this.schedulerToolStripMenuItem.Name = "schedulerToolStripMenuItem"; | |||
this.schedulerToolStripMenuItem.Size = new System.Drawing.Size(71, 20); | |||
this.schedulerToolStripMenuItem.Text = "Scheduler"; | |||
// | |||
// connectToolStripMenuItem | |||
// | |||
this.connectToolStripMenuItem.Name = "connectToolStripMenuItem"; | |||
this.connectToolStripMenuItem.Size = new System.Drawing.Size(152, 22); | |||
this.connectToolStripMenuItem.Text = "Connect"; | |||
this.connectToolStripMenuItem.Click += new System.EventHandler(this.connectToolStripMenuItem_Click); | |||
// | |||
// jobsToolStripMenuItem | |||
// | |||
this.jobsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.addJobToolStripMenuItem}); | |||
this.jobsToolStripMenuItem.Enabled = false; | |||
this.jobsToolStripMenuItem.Name = "jobsToolStripMenuItem"; | |||
this.jobsToolStripMenuItem.Size = new System.Drawing.Size(42, 20); | |||
this.jobsToolStripMenuItem.Text = "Jobs"; | |||
// | |||
// addJobToolStripMenuItem | |||
// | |||
this.addJobToolStripMenuItem.Name = "addJobToolStripMenuItem"; | |||
this.addJobToolStripMenuItem.Size = new System.Drawing.Size(96, 22); | |||
this.addJobToolStripMenuItem.Text = "Add"; | |||
this.addJobToolStripMenuItem.Click += new System.EventHandler(this.addJobToolStripMenuItem_Click); | |||
// | |||
// listenersStripMenuItem | |||
// | |||
this.listenersStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.globalListenersToolStripMenuItem, | |||
this.addJobListenerToolStripMenuItem}); | |||
this.listenersStripMenuItem.Enabled = false; | |||
this.listenersStripMenuItem.Name = "listenersStripMenuItem"; | |||
this.listenersStripMenuItem.Size = new System.Drawing.Size(65, 20); | |||
this.listenersStripMenuItem.Text = "Listeners"; | |||
// | |||
// globalListenersToolStripMenuItem | |||
// | |||
this.globalListenersToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.addGlobalJobListenerToolStripMenuItem, | |||
this.addTriggerListenerToolStripMenuItem}); | |||
this.globalListenersToolStripMenuItem.Name = "globalListenersToolStripMenuItem"; | |||
this.globalListenersToolStripMenuItem.Size = new System.Drawing.Size(161, 22); | |||
this.globalListenersToolStripMenuItem.Text = "Global"; | |||
// | |||
// addGlobalJobListenerToolStripMenuItem | |||
// | |||
this.addGlobalJobListenerToolStripMenuItem.Name = "addGlobalJobListenerToolStripMenuItem"; | |||
this.addGlobalJobListenerToolStripMenuItem.Size = new System.Drawing.Size(181, 22); | |||
this.addGlobalJobListenerToolStripMenuItem.Text = "Add Job Listener"; | |||
this.addGlobalJobListenerToolStripMenuItem.Click += new System.EventHandler(this.addGlobalListenerToolStripMenuItem_Click); | |||
// | |||
// addTriggerListenerToolStripMenuItem | |||
// | |||
this.addTriggerListenerToolStripMenuItem.Name = "addTriggerListenerToolStripMenuItem"; | |||
this.addTriggerListenerToolStripMenuItem.Size = new System.Drawing.Size(181, 22); | |||
this.addTriggerListenerToolStripMenuItem.Text = "Add Trigger Listener"; | |||
// | |||
// addJobListenerToolStripMenuItem | |||
// | |||
this.addJobListenerToolStripMenuItem.Name = "addJobListenerToolStripMenuItem"; | |||
this.addJobListenerToolStripMenuItem.Size = new System.Drawing.Size(161, 22); | |||
this.addJobListenerToolStripMenuItem.Text = "Add Job Listener"; | |||
this.addJobListenerToolStripMenuItem.Click += new System.EventHandler(this.addJobListenerToolStripMenuItem_Click); | |||
// | |||
// statusStrip1 | |||
// | |||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.serverConnectStatusLabel, | |||
this.StripStatusLabel_Job_Groups, | |||
this.StripStatusLabel_Jobs_Refresh_date}); | |||
this.statusStrip1.Location = new System.Drawing.Point(0, 639); | |||
this.statusStrip1.Name = "statusStrip1"; | |||
this.statusStrip1.Size = new System.Drawing.Size(913, 22); | |||
this.statusStrip1.TabIndex = 1; | |||
this.statusStrip1.Text = "statusStrip1"; | |||
// | |||
// serverConnectStatusLabel | |||
// | |||
this.serverConnectStatusLabel.Name = "serverConnectStatusLabel"; | |||
this.serverConnectStatusLabel.Size = new System.Drawing.Size(86, 17); | |||
this.serverConnectStatusLabel.Text = "Not connected"; | |||
// | |||
// StripStatusLabel_Job_Groups | |||
// | |||
this.StripStatusLabel_Job_Groups.BackColor = System.Drawing.Color.LightCyan; | |||
this.StripStatusLabel_Job_Groups.Name = "StripStatusLabel_Job_Groups"; | |||
this.StripStatusLabel_Job_Groups.Size = new System.Drawing.Size(157, 17); | |||
this.StripStatusLabel_Job_Groups.Text = "StripStatusLabel_Job_Groups"; | |||
this.StripStatusLabel_Job_Groups.ToolTipText = "Last Refresh of Job Groups"; | |||
// | |||
// StripStatusLabel_Jobs_Refresh_date | |||
// | |||
this.StripStatusLabel_Jobs_Refresh_date.BackColor = System.Drawing.SystemColors.ActiveCaptionText; | |||
this.StripStatusLabel_Jobs_Refresh_date.Name = "StripStatusLabel_Jobs_Refresh_date"; | |||
this.StripStatusLabel_Jobs_Refresh_date.Size = new System.Drawing.Size(191, 17); | |||
this.StripStatusLabel_Jobs_Refresh_date.Text = "StripStatusLabel_Jobs_Refresh_date"; | |||
this.StripStatusLabel_Jobs_Refresh_date.ToolTipText = "Last Refresh Date of Running Jobs"; | |||
// | |||
// jobGroupsTreeView | |||
// | |||
this.jobGroupsTreeView.HideSelection = false; | |||
this.jobGroupsTreeView.Location = new System.Drawing.Point(8, 48); | |||
this.jobGroupsTreeView.Name = "jobGroupsTreeView"; | |||
this.jobGroupsTreeView.Size = new System.Drawing.Size(351, 252); | |||
this.jobGroupsTreeView.TabIndex = 2; | |||
// | |||
// label1 | |||
// | |||
this.label1.AutoSize = true; | |||
this.label1.Location = new System.Drawing.Point(8, 32); | |||
this.label1.Name = "label1"; | |||
this.label1.Size = new System.Drawing.Size(94, 13); | |||
this.label1.TabIndex = 4; | |||
this.label1.Text = "Scheduler Objects"; | |||
// | |||
// label2 | |||
// | |||
this.label2.AutoSize = true; | |||
this.label2.Location = new System.Drawing.Point(9, 319); | |||
this.label2.Name = "label2"; | |||
this.label2.Size = new System.Drawing.Size(72, 13); | |||
this.label2.TabIndex = 5; | |||
this.label2.Text = "Running Jobs"; | |||
// | |||
// btnRefreshRunningJobs | |||
// | |||
this.btnRefreshRunningJobs.Location = new System.Drawing.Point(371, 609); | |||
this.btnRefreshRunningJobs.Name = "btnRefreshRunningJobs"; | |||
this.btnRefreshRunningJobs.Size = new System.Drawing.Size(75, 23); | |||
this.btnRefreshRunningJobs.TabIndex = 6; | |||
this.btnRefreshRunningJobs.Text = "Refresh"; | |||
this.btnRefreshRunningJobs.UseVisualStyleBackColor = true; | |||
this.btnRefreshRunningJobs.Click += new System.EventHandler(this.btnRefreshRunningJobs_Click); | |||
// | |||
// btnRefreshJobGroups | |||
// | |||
this.btnRefreshJobGroups.Location = new System.Drawing.Point(284, 306); | |||
this.btnRefreshJobGroups.Name = "btnRefreshJobGroups"; | |||
this.btnRefreshJobGroups.Size = new System.Drawing.Size(75, 23); | |||
this.btnRefreshJobGroups.TabIndex = 7; | |||
this.btnRefreshJobGroups.Text = "Refresh"; | |||
this.btnRefreshJobGroups.UseVisualStyleBackColor = true; | |||
this.btnRefreshJobGroups.Click += new System.EventHandler(this.btnRefreshJobGroups_Click); | |||
// | |||
// btnDeleteJob | |||
// | |||
this.btnDeleteJob.Enabled = false; | |||
this.btnDeleteJob.Location = new System.Drawing.Point(533, 306); | |||
this.btnDeleteJob.Name = "btnDeleteJob"; | |||
this.btnDeleteJob.Size = new System.Drawing.Size(65, 23); | |||
this.btnDeleteJob.TabIndex = 8; | |||
this.btnDeleteJob.Text = "Delete"; | |||
this.btnDeleteJob.UseVisualStyleBackColor = true; | |||
this.btnDeleteJob.Click += new System.EventHandler(this.btnDeleteJob_Click); | |||
// | |||
// btnRunJobNow | |||
// | |||
this.btnRunJobNow.Enabled = false; | |||
this.btnRunJobNow.Location = new System.Drawing.Point(391, 306); | |||
this.btnRunJobNow.Name = "btnRunJobNow"; | |||
this.btnRunJobNow.Size = new System.Drawing.Size(65, 23); | |||
this.btnRunJobNow.TabIndex = 9; | |||
this.btnRunJobNow.Text = "Run"; | |||
this.btnRunJobNow.UseVisualStyleBackColor = true; | |||
this.btnRunJobNow.Click += new System.EventHandler(this.btnRunJobNow_Click); | |||
// | |||
// btnPause | |||
// | |||
this.btnPause.Enabled = false; | |||
this.btnPause.Location = new System.Drawing.Point(462, 306); | |||
this.btnPause.Name = "btnPause"; | |||
this.btnPause.Size = new System.Drawing.Size(65, 23); | |||
this.btnPause.TabIndex = 10; | |||
this.btnPause.Text = "Pause"; | |||
this.btnPause.UseVisualStyleBackColor = true; | |||
this.btnPause.Click += new System.EventHandler(this.btnPause_Click); | |||
// | |||
// pnlDetails | |||
// | |||
this.pnlDetails.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; | |||
this.pnlDetails.Location = new System.Drawing.Point(391, 45); | |||
this.pnlDetails.Name = "pnlDetails"; | |||
this.pnlDetails.Size = new System.Drawing.Size(342, 252); | |||
this.pnlDetails.TabIndex = 11; | |||
// | |||
// label3 | |||
// | |||
this.label3.AutoSize = true; | |||
this.label3.Location = new System.Drawing.Point(388, 29); | |||
this.label3.Name = "label3"; | |||
this.label3.Size = new System.Drawing.Size(39, 13); | |||
this.label3.TabIndex = 12; | |||
this.label3.Text = "Details"; | |||
// | |||
// btnEdit | |||
// | |||
this.btnEdit.Enabled = false; | |||
this.btnEdit.Location = new System.Drawing.Point(604, 306); | |||
this.btnEdit.Name = "btnEdit"; | |||
this.btnEdit.Size = new System.Drawing.Size(65, 23); | |||
this.btnEdit.TabIndex = 13; | |||
this.btnEdit.Text = "Edit"; | |||
this.btnEdit.UseVisualStyleBackColor = true; | |||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); | |||
// | |||
// ctxScheduler | |||
// | |||
this.ctxScheduler.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.backupToolStripMenuItem}); | |||
this.ctxScheduler.Name = "ctxScheduler"; | |||
this.ctxScheduler.Size = new System.Drawing.Size(109, 26); | |||
// | |||
// backupToolStripMenuItem | |||
// | |||
this.backupToolStripMenuItem.Name = "backupToolStripMenuItem"; | |||
this.backupToolStripMenuItem.Size = new System.Drawing.Size(108, 22); | |||
this.backupToolStripMenuItem.Text = "Backup"; | |||
this.backupToolStripMenuItem.Click += new System.EventHandler(this.backupToolStripMenuItem_Click); | |||
// | |||
// timer_Refresh_Running_Jobs | |||
// | |||
this.timer_Refresh_Running_Jobs.Interval = 30000; | |||
this.timer_Refresh_Running_Jobs.Tick += new System.EventHandler(this.timer_Refresh_Running_Jobs_Tick); | |||
// | |||
// listView_RunningJobs | |||
// | |||
this.listView_RunningJobs.AllowColumnReorder = true; | |||
this.listView_RunningJobs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { | |||
this.JobName, | |||
this.JobDuration}); | |||
this.listView_RunningJobs.Location = new System.Drawing.Point(8, 335); | |||
this.listView_RunningJobs.Name = "listView_RunningJobs"; | |||
this.listView_RunningJobs.Size = new System.Drawing.Size(725, 268); | |||
this.listView_RunningJobs.Sorting = System.Windows.Forms.SortOrder.Ascending; | |||
this.listView_RunningJobs.TabIndex = 14; | |||
this.listView_RunningJobs.UseCompatibleStateImageBehavior = false; | |||
this.listView_RunningJobs.View = System.Windows.Forms.View.Details; | |||
// | |||
// JobName | |||
// | |||
this.JobName.Text = "Job Name"; | |||
// | |||
// JobDuration | |||
// | |||
this.JobDuration.Text = "Duration"; | |||
// | |||
// jobAssembliesToolStripMenuItem | |||
// | |||
this.jobAssembliesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { | |||
this.addAssemblyMenuItem, | |||
this.deleteAssemblyMenuItem}); | |||
this.jobAssembliesToolStripMenuItem.Name = "jobAssembliesToolStripMenuItem"; | |||
this.jobAssembliesToolStripMenuItem.Size = new System.Drawing.Size(99, 20); | |||
this.jobAssembliesToolStripMenuItem.Text = "Job Assemblies"; | |||
// | |||
// addAssemblyMenuItem | |||
// | |||
this.addAssemblyMenuItem.Name = "addAssemblyMenuItem"; | |||
this.addAssemblyMenuItem.Size = new System.Drawing.Size(152, 22); | |||
this.addAssemblyMenuItem.Text = "Add"; | |||
this.addAssemblyMenuItem.Click += new System.EventHandler(this.addAssemblyMenuItem_Click); | |||
// | |||
// deleteAssemblyMenuItem | |||
// | |||
this.deleteAssemblyMenuItem.Name = "deleteAssemblyMenuItem"; | |||
this.deleteAssemblyMenuItem.Size = new System.Drawing.Size(152, 22); | |||
this.deleteAssemblyMenuItem.Text = "Delete"; | |||
this.deleteAssemblyMenuItem.Click += new System.EventHandler(this.deleteAssemblyMenuItem_Click); | |||
// | |||
// MainForm | |||
// | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.ClientSize = new System.Drawing.Size(913, 661); | |||
this.Controls.Add(this.btnRefreshJobGroups); | |||
this.Controls.Add(this.listView_RunningJobs); | |||
this.Controls.Add(this.pnlDetails); | |||
this.Controls.Add(this.label3); | |||
this.Controls.Add(this.label1); | |||
this.Controls.Add(this.btnEdit); | |||
this.Controls.Add(this.btnRefreshRunningJobs); | |||
this.Controls.Add(this.btnPause); | |||
this.Controls.Add(this.label2); | |||
this.Controls.Add(this.statusStrip1); | |||
this.Controls.Add(this.mainMenuStrip); | |||
this.Controls.Add(this.btnRunJobNow); | |||
this.Controls.Add(this.jobGroupsTreeView); | |||
this.Controls.Add(this.btnDeleteJob); | |||
this.MainMenuStrip = this.mainMenuStrip; | |||
this.Name = "MainForm"; | |||
this.Text = "Quartz Manager"; | |||
this.mainMenuStrip.ResumeLayout(false); | |||
this.mainMenuStrip.PerformLayout(); | |||
this.statusStrip1.ResumeLayout(false); | |||
this.statusStrip1.PerformLayout(); | |||
this.ctxScheduler.ResumeLayout(false); | |||
this.ResumeLayout(false); | |||
this.PerformLayout(); | |||
} | |||
#endregion | |||
private System.Windows.Forms.MenuStrip mainMenuStrip; | |||
private System.Windows.Forms.ToolStripMenuItem schedulerToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem connectToolStripMenuItem; | |||
private System.Windows.Forms.StatusStrip statusStrip1; | |||
private System.Windows.Forms.ToolStripStatusLabel serverConnectStatusLabel; | |||
private System.Windows.Forms.TreeView jobGroupsTreeView; | |||
private System.Windows.Forms.ToolStripMenuItem listenersStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem globalListenersToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addGlobalJobListenerToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addTriggerListenerToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addJobListenerToolStripMenuItem; | |||
private System.Windows.Forms.Label label1; | |||
private System.Windows.Forms.Label label2; | |||
private System.Windows.Forms.ToolStripMenuItem jobsToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addJobToolStripMenuItem; | |||
private System.Windows.Forms.Button btnRefreshRunningJobs; | |||
private System.Windows.Forms.Button btnRefreshJobGroups; | |||
private System.Windows.Forms.Button btnDeleteJob; | |||
private System.Windows.Forms.Button btnRunJobNow; | |||
private System.Windows.Forms.Button btnPause; | |||
private System.Windows.Forms.Panel pnlDetails; | |||
private System.Windows.Forms.Label label3; | |||
private System.Windows.Forms.Button btnEdit; | |||
private System.Windows.Forms.ContextMenuStrip ctxScheduler; | |||
private System.Windows.Forms.ToolStripMenuItem backupToolStripMenuItem; | |||
private System.Windows.Forms.Timer timer_Refresh_Running_Jobs; | |||
private System.Windows.Forms.ToolStripStatusLabel StripStatusLabel_Jobs_Refresh_date; | |||
private System.Windows.Forms.ToolStripStatusLabel StripStatusLabel_Job_Groups; | |||
private System.Windows.Forms.ListView listView_RunningJobs; | |||
private System.Windows.Forms.ColumnHeader JobName; | |||
private System.Windows.Forms.ColumnHeader JobDuration; | |||
private System.Windows.Forms.ToolStripMenuItem jobAssembliesToolStripMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem addAssemblyMenuItem; | |||
private System.Windows.Forms.ToolStripMenuItem deleteAssemblyMenuItem; | |||
} | |||
} | |||
@@ -1,377 +1,444 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Data; | |||
using System.Drawing; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Windows.Forms; | |||
using Quartz; | |||
using Quartz.Collection; | |||
using System.Net.Sockets; | |||
//using ClickForensics.Quartz.Jobs; | |||
using System.IO; | |||
using Quartz.Impl; | |||
using Quartz.Impl.Matchers; | |||
using Quartz.Impl.Triggers; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public partial class MainForm : Form | |||
{ | |||
public MainForm() | |||
{ | |||
InitializeComponent(); | |||
jobGroupsTreeView.AfterSelect += new TreeViewEventHandler(jobGroupsTreeView_AfterSelect); | |||
ctxScheduler.Opening += new CancelEventHandler(ctxScheduler_Opening); | |||
jobGroupsTreeView.MouseDown += new MouseEventHandler(jobGroupsTreeView_MouseDown); | |||
} | |||
void ctxScheduler_Opening(object sender, CancelEventArgs e) | |||
{ | |||
} | |||
void jobGroupsTreeView_AfterSelect(object sender, TreeViewEventArgs e) | |||
{ | |||
jobDetailsToggle(false); | |||
if (e.Node is TriggerNode || e.Node is JobNode) | |||
{ | |||
btnDeleteJob.Enabled = true; | |||
} | |||
else | |||
{ | |||
btnDeleteJob.Enabled = false; | |||
} | |||
if (e.Node is JobNode) | |||
{ | |||
btnRunJobNow.Enabled = true; | |||
pnlDetails.Controls.Add(new NativeJobDetailDisplay(((JobNode)e.Node).Detail)); | |||
jobDetailsToggle(true); | |||
} | |||
else | |||
{ | |||
btnRunJobNow.Enabled = false; | |||
} | |||
if (e.Node is TriggerNode) | |||
{ | |||
btnPause.Enabled = true; | |||
setPauseButtonText(); | |||
if (((TriggerNode)e.Node).Trigger is ICronTrigger) | |||
{ | |||
pnlDetails.Controls.Add(new CronTriggerDisplay((ICronTrigger)((TriggerNode)e.Node).Trigger)); | |||
jobDetailsToggle(true); | |||
} | |||
btnEdit.Enabled = true; | |||
} | |||
else | |||
{ | |||
btnEdit.Enabled = false; | |||
btnPause.Enabled = false; | |||
} | |||
} | |||
private void setPauseButtonText() | |||
{ | |||
TriggerNode node = (TriggerNode)jobGroupsTreeView.SelectedNode; | |||
if (Scheduler.GetScheduler().GetTriggerState(node.Trigger.Key) == TriggerState.Paused) | |||
{ | |||
btnPause.Text = "Resume"; | |||
} | |||
else | |||
{ | |||
btnPause.Text = "Pause"; | |||
} | |||
} | |||
private void connectToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
using (ServerConnectForm form = new ServerConnectForm()) | |||
{ | |||
form.ShowDialog(); | |||
try | |||
{ | |||
Scheduler = new QuartzScheduler(form.Server, form.Port, form.Scheduler); | |||
serverConnectStatusLabel.Text = string.Format("Connected to {0}", Scheduler.Address); | |||
connectToolStripMenuItem.Enabled = false; | |||
jobsToolStripMenuItem.Enabled = true; | |||
loadJobGroups(); | |||
updateRunningJobs(); | |||
} | |||
catch (SocketException ex) | |||
{ | |||
ErrorDialog dialog = new ErrorDialog(); | |||
dialog.Message = string.Format("Unable to connect to scheduler {0} on {1}:{2}", form.Scheduler, form.Server, form.Port); | |||
dialog.Description = ex.Message; | |||
dialog.ShowDialog(); | |||
} | |||
form.Close(); | |||
} | |||
//loadGlobalTriggers(); | |||
} | |||
//private void loadGlobalTriggers() | |||
//{ | |||
// foreach (IJobListener jobListener in Scheduler.GetScheduler().GetJobDetail(null,null)..GlobalJobListeners) | |||
// { | |||
// globalTriggersListView.Items.Add(jobListener.Name); | |||
// } | |||
//} | |||
private void loadJobGroups() | |||
{ | |||
try | |||
{ | |||
this.Cursor = Cursors.WaitCursor; | |||
jobDetailsToggle(false); | |||
jobGroupsTreeView.Nodes.Clear(); | |||
SchedulerNode schedulerNode = new SchedulerNode(Scheduler); | |||
schedulerNode.ContextMenuStrip = ctxScheduler; | |||
jobGroupsTreeView.Nodes.Add(schedulerNode); | |||
TreeNode jobGroupsNode = schedulerNode.Nodes.Add("Job Groups"); | |||
var jobGroups = Scheduler.GetScheduler().GetJobGroupNames(); | |||
foreach (string jobGroup in jobGroups) | |||
{ | |||
TreeNode jobGroupNode = jobGroupsNode.Nodes.Add(jobGroup); | |||
TreeNode jobsNode = jobGroupNode.Nodes.Add("Jobs"); | |||
addJobNodes(jobsNode); | |||
} | |||
jobGroupsTreeView.Nodes[0].Expand(); | |||
jobGroupsNode.Expand(); | |||
StripStatusLabel_Job_Groups.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm.ss"); | |||
} | |||
finally | |||
{ | |||
this.Cursor = Cursors.Default; | |||
} | |||
} | |||
private void jobDetailsToggle(bool isVisible) | |||
{ | |||
if (isVisible == false) | |||
{ | |||
pnlDetails.Controls.Clear(); | |||
} | |||
} | |||
void jobGroupsTreeView_MouseDown(object sender, MouseEventArgs e) | |||
{ | |||
if (e.Button == MouseButtons.Right) | |||
{ | |||
TreeNode node = jobGroupsTreeView.GetNodeAt(e.X, e.Y); | |||
if (node != null) | |||
{ | |||
jobGroupsTreeView.SelectedNode = node; | |||
ctxScheduler.Show(jobGroupsTreeView, e.Location); | |||
} | |||
} | |||
} | |||
//private void loadJobs() | |||
//{ | |||
// foreach (TreeNode node in jobGroupsTreeView.Nodes) | |||
// { | |||
// addJobNodes(node); | |||
// } | |||
//} | |||
private void addJobNodes(TreeNode node) | |||
{ | |||
string group = node.Parent.Text; | |||
var groupMatcher = GroupMatcher<JobKey>.GroupContains(group); | |||
var jobKeys = Scheduler.GetScheduler().GetJobKeys(groupMatcher); | |||
foreach (var jobKey in jobKeys) | |||
{ | |||
try | |||
{ | |||
IJobDetail detail = Scheduler.GetScheduler().GetJobDetail(jobKey); | |||
JobNode jobNode = new JobNode(detail); | |||
node.Nodes.Add(jobNode); | |||
addTriggerNodes(jobNode); | |||
addListenerNodes(jobNode); | |||
} | |||
catch (Exception ex) | |||
{ | |||
//TODO: Do something useful with this exception. Most likely cause is the client does not have a copy of a given dll and can't load the type. | |||
} | |||
} | |||
} | |||
private void addListenerNodes(JobNode node) | |||
{ | |||
string jobName = node.Text; | |||
string jobGroupName = node.Parent.Text; | |||
//TODO: see joblistenermanager get listeners | |||
//string[] listenerNames = node.Detail.JobListenerNames; | |||
//foreach (string listener in listenerNames) | |||
//{ | |||
// node.Text = string.Format("JL {0}", listenerNames); | |||
//} | |||
//ISet set = Scheduler.GetScheduler().JobListenerNames; | |||
} | |||
private void addTriggerNodes(TreeNode treeNode) | |||
{ | |||
var triggers = Scheduler.GetScheduler().GetTriggersOfJob(new JobKey(treeNode.Text, treeNode.Parent.Parent.Text)); | |||
TreeNode triggersNode = treeNode.Nodes.Add("Triggers"); | |||
foreach (var trigger in triggers) | |||
{ | |||
TriggerNode node = new TriggerNode(trigger); | |||
triggersNode.Nodes.Add(node); | |||
} | |||
} | |||
private void updateRunningJobs() | |||
{ | |||
try | |||
{ | |||
this.Cursor = Cursors.WaitCursor; | |||
timer_Refresh_Running_Jobs.Stop(); | |||
listView_RunningJobs.Items.Clear(); | |||
DataTable table = Scheduler.GetRunningJobs(); | |||
foreach (DataRow row in table.Rows) | |||
{ | |||
//JobName JobDuration | |||
ListViewItem item = new ListViewItem(new string[] { Convert.ToString(row["JobName"]), Convert.ToString(row["Runtime"]) }); | |||
listView_RunningJobs.Items.Add(item); | |||
} | |||
StripStatusLabel_Jobs_Refresh_date.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm.ss"); | |||
//reset the timer ( documentation not clear if .stop = restart @ 0 in timing, but changing the interval sure should do that. ) | |||
int timer_was = timer_Refresh_Running_Jobs.Interval; | |||
timer_Refresh_Running_Jobs.Interval = timer_was + 1; | |||
timer_Refresh_Running_Jobs.Interval = timer_was; | |||
timer_Refresh_Running_Jobs.Start(); | |||
} | |||
finally | |||
{ | |||
this.Cursor = Cursors.Default; | |||
} | |||
} | |||
public QuartzScheduler Scheduler { get; set; } | |||
private void addGlobalListenerToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
AddListenerForm form = new AddListenerForm(); | |||
form.ListenerInterface = typeof(IJobListener); | |||
form.ShowDialog(); | |||
JobDataMap map = new JobDataMap(); | |||
map.Add("type", form.ListenerType); | |||
//Scheduler.ScheduleOneTimeJob(typeof(AddJobListenerJob), map, 0); | |||
loadJobGroups(); | |||
} | |||
private void addJobListenerToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
TreeNode selectedNode = jobGroupsTreeView.SelectedNode; | |||
if (selectedNode != null && selectedNode is JobNode) | |||
{ | |||
AddListenerForm form = new AddListenerForm(); | |||
form.ListenerInterface = typeof(IJobListener); | |||
form.ShowDialog(); | |||
//JobHistoryListener listener = new JobHistoryListener(); | |||
//listener.Name = null; | |||
//((JobNode)selectedNode).Detail.AddJobListener(); | |||
} | |||
} | |||
private void addJobToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
AddJobForm form = new AddJobForm(); | |||
form.ShowDialog(); | |||
if (form.JobDetail != null && form.Trigger != null) | |||
{ | |||
Scheduler.GetScheduler().ScheduleJob(form.JobDetail, form.Trigger); | |||
loadJobGroups(); | |||
} | |||
} | |||
private void btnRefreshRunningJobs_Click(object sender, EventArgs e) | |||
{ | |||
updateRunningJobs(); | |||
} | |||
private void btnRefreshJobGroups_Click(object sender, EventArgs e) | |||
{ | |||
loadJobGroups(); | |||
} | |||
private void btnRunJobNow_Click(object sender, EventArgs e) | |||
{ | |||
JobNode node = (JobNode)jobGroupsTreeView.SelectedNode; | |||
Scheduler.GetScheduler().TriggerJob(node.Detail.Key); | |||
} | |||
private void btnDeleteJob_Click(object sender, EventArgs e) | |||
{ | |||
TreeNode selectedNode = jobGroupsTreeView.SelectedNode; | |||
if (selectedNode is JobNode) | |||
{ | |||
JobNode node = (JobNode)jobGroupsTreeView.SelectedNode; | |||
Scheduler.GetScheduler().DeleteJob(node.Detail.Key); | |||
jobGroupsTreeView.SelectedNode.Remove(); | |||
} | |||
if (selectedNode is TriggerNode) | |||
{ | |||
Scheduler.GetScheduler().UnscheduleJob(((TriggerNode)selectedNode).Trigger.Key); | |||
} | |||
//loadJobGroups(); | |||
} | |||
private void btnPause_Click(object sender, EventArgs e) | |||
{ | |||
TriggerNode node = (TriggerNode)jobGroupsTreeView.SelectedNode; | |||
if (Scheduler.GetScheduler().GetTriggerState(node.Trigger.Key) == TriggerState.Paused) | |||
{ | |||
Scheduler.GetScheduler().ResumeTrigger(node.Trigger.Key); | |||
} | |||
else | |||
{ | |||
Scheduler.GetScheduler().PauseTrigger(node.Trigger.Key); | |||
} | |||
setPauseButtonText(); | |||
} | |||
private void btnEdit_Click(object sender, EventArgs e) | |||
{ | |||
TriggerNode node = (TriggerNode)jobGroupsTreeView.SelectedNode; | |||
AddJobForm form = new AddJobForm(node); | |||
form.ShowDialog(); | |||
if (form.JobDetail != null && form.Trigger != null) | |||
{ | |||
Scheduler.GetScheduler().RescheduleJob(node.Trigger.Key, form.Trigger); | |||
loadJobGroups(); | |||
} | |||
} | |||
private void backupToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
QuartzScheduler scheduler = ((SchedulerNode)((TreeView)((ContextMenuStrip)((ToolStripMenuItem)sender).Owner).SourceControl).SelectedNode).Scheduler; | |||
FileDialog dialog = new SaveFileDialog(); | |||
dialog.ShowDialog(); | |||
FileInfo file = new FileInfo(dialog.FileName); | |||
scheduler.BackupToFile(file); | |||
} | |||
private void timer_Refresh_Running_Jobs_Tick(object sender, EventArgs e) | |||
{ | |||
updateRunningJobs(); | |||
} | |||
} | |||
} | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Data; | |||
using System.Drawing; | |||
using System.Linq; | |||
using System.Reflection; | |||
using System.Text; | |||
using System.Windows.Forms; | |||
using Quartz; | |||
using Quartz.Collection; | |||
using System.Net.Sockets; | |||
//using ClickForensics.Quartz.Jobs; | |||
using System.IO; | |||
using Quartz.Impl; | |||
using Quartz.Impl.Matchers; | |||
using Quartz.Impl.Triggers; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public partial class MainForm : Form | |||
{ | |||
public MainForm() | |||
{ | |||
InitializeComponent(); | |||
jobGroupsTreeView.AfterSelect += new TreeViewEventHandler(jobGroupsTreeView_AfterSelect); | |||
ctxScheduler.Opening += new CancelEventHandler(ctxScheduler_Opening); | |||
jobGroupsTreeView.MouseDown += new MouseEventHandler(jobGroupsTreeView_MouseDown); | |||
} | |||
void ctxScheduler_Opening(object sender, CancelEventArgs e) | |||
{ | |||
} | |||
void jobGroupsTreeView_AfterSelect(object sender, TreeViewEventArgs e) | |||
{ | |||
jobDetailsToggle(false); | |||
if (e.Node is TriggerNode || e.Node is JobNode) | |||
{ | |||
btnDeleteJob.Enabled = true; | |||
} | |||
else | |||
{ | |||
btnDeleteJob.Enabled = false; | |||
} | |||
if (e.Node is JobNode) | |||
{ | |||
btnRunJobNow.Enabled = true; | |||
pnlDetails.Controls.Add(new NativeJobDetailDisplay(((JobNode)e.Node).Detail)); | |||
jobDetailsToggle(true); | |||
} | |||
else | |||
{ | |||
btnRunJobNow.Enabled = false; | |||
} | |||
if (e.Node is TriggerNode) | |||
{ | |||
btnPause.Enabled = true; | |||
setPauseButtonText(); | |||
if (((TriggerNode)e.Node).Trigger is ICronTrigger) | |||
{ | |||
pnlDetails.Controls.Add(new CronTriggerDisplay((ICronTrigger)((TriggerNode)e.Node).Trigger)); | |||
jobDetailsToggle(true); | |||
} | |||
if (((TriggerNode)e.Node).Trigger is ISimpleTrigger) | |||
{ | |||
pnlDetails.Controls.Add(new SimpleTriggerDisplay((ISimpleTrigger)((TriggerNode)e.Node).Trigger)); | |||
jobDetailsToggle(true); | |||
} | |||
btnEdit.Enabled = true; | |||
} | |||
else | |||
{ | |||
btnEdit.Enabled = false; | |||
btnPause.Enabled = false; | |||
} | |||
} | |||
private void setPauseButtonText() | |||
{ | |||
TriggerNode node = (TriggerNode)jobGroupsTreeView.SelectedNode; | |||
if (Scheduler.GetScheduler().GetTriggerState(node.Trigger.Key) == TriggerState.Paused) | |||
{ | |||
btnPause.Text = "Resume"; | |||
} | |||
else | |||
{ | |||
btnPause.Text = "Pause"; | |||
} | |||
} | |||
private void connectToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
using (ServerConnectForm form = new ServerConnectForm()) | |||
{ | |||
form.ShowDialog(); | |||
if (!form.Cancelled) | |||
{ | |||
try | |||
{ | |||
Scheduler = new QuartzScheduler(form.Server, form.Port, form.Scheduler); | |||
serverConnectStatusLabel.Text = string.Format("Connected to {0}", Scheduler.Address); | |||
connectToolStripMenuItem.Enabled = false; | |||
jobsToolStripMenuItem.Enabled = true; | |||
loadJobGroups(); | |||
updateRunningJobs(); | |||
} | |||
catch (SocketException ex) | |||
{ | |||
ErrorDialog dialog = new ErrorDialog(); | |||
dialog.Message = string.Format("Unable to connect to scheduler {0} on {1}:{2}", form.Scheduler, form.Server, form.Port); | |||
dialog.Description = ex.Message; | |||
dialog.ShowDialog(); | |||
} | |||
} | |||
form.Close(); | |||
} | |||
//loadGlobalTriggers(); | |||
} | |||
//private void loadGlobalTriggers() | |||
//{ | |||
// foreach (IJobListener jobListener in Scheduler.GetScheduler().GetJobDetail(null,null)..GlobalJobListeners) | |||
// { | |||
// globalTriggersListView.Items.Add(jobListener.Name); | |||
// } | |||
//} | |||
private void loadJobGroups() | |||
{ | |||
try | |||
{ | |||
this.Cursor = Cursors.WaitCursor; | |||
jobDetailsToggle(false); | |||
jobGroupsTreeView.Nodes.Clear(); | |||
SchedulerNode schedulerNode = new SchedulerNode(Scheduler); | |||
schedulerNode.ContextMenuStrip = ctxScheduler; | |||
jobGroupsTreeView.Nodes.Add(schedulerNode); | |||
TreeNode jobGroupsNode = schedulerNode.Nodes.Add("Job Groups"); | |||
var jobGroups = Scheduler.GetScheduler().GetJobGroupNames(); | |||
foreach (string jobGroup in jobGroups) | |||
{ | |||
TreeNode jobGroupNode = jobGroupsNode.Nodes.Add(jobGroup); | |||
TreeNode jobsNode = jobGroupNode.Nodes.Add("Jobs"); | |||
addJobNodes(jobsNode); | |||
} | |||
jobGroupsTreeView.Nodes[0].Expand(); | |||
jobGroupsNode.Expand(); | |||
StripStatusLabel_Job_Groups.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm.ss"); | |||
loadOrphanJobs(schedulerNode); | |||
loadStuckTriggers(schedulerNode); | |||
loadCalendars(schedulerNode); | |||
} | |||
finally | |||
{ | |||
this.Cursor = Cursors.Default; | |||
} | |||
} | |||
private static void loadCalendars(SchedulerNode schedulerNode) | |||
{ | |||
TreeNode calendarsNode = schedulerNode.Nodes.Add("Calendars"); | |||
foreach (var calendarName in schedulerNode.Scheduler.GetScheduler().GetCalendarNames()) | |||
{ | |||
//TODO: make this a calendar node instead | |||
calendarsNode.Nodes.Add(calendarName); | |||
} | |||
} | |||
private void loadStuckTriggers(SchedulerNode schedulerNode) | |||
{ | |||
TreeNode jobGroupsNode = schedulerNode.Nodes.Add("Stuck Triggers"); | |||
} | |||
private void loadOrphanJobs(SchedulerNode schedulerNode) | |||
{ | |||
TreeNode jobGroupsNode = schedulerNode.Nodes.Add("Orphan Jobs"); | |||
} | |||
private void jobDetailsToggle(bool isVisible) | |||
{ | |||
if (isVisible == false) | |||
{ | |||
pnlDetails.Controls.Clear(); | |||
} | |||
} | |||
void jobGroupsTreeView_MouseDown(object sender, MouseEventArgs e) | |||
{ | |||
if (e.Button == MouseButtons.Right) | |||
{ | |||
TreeNode node = jobGroupsTreeView.GetNodeAt(e.X, e.Y); | |||
if (node != null) | |||
{ | |||
jobGroupsTreeView.SelectedNode = node; | |||
ctxScheduler.Show(jobGroupsTreeView, e.Location); | |||
} | |||
} | |||
} | |||
//private void loadJobs() | |||
//{ | |||
// foreach (TreeNode node in jobGroupsTreeView.Nodes) | |||
// { | |||
// addJobNodes(node); | |||
// } | |||
//} | |||
private void addJobNodes(TreeNode node) | |||
{ | |||
string group = node.Parent.Text; | |||
var groupMatcher = GroupMatcher<JobKey>.GroupContains(group); | |||
var jobKeys = Scheduler.GetScheduler().GetJobKeys(groupMatcher); | |||
foreach (var jobKey in jobKeys) | |||
{ | |||
try | |||
{ | |||
IJobDetail detail = Scheduler.GetScheduler().GetJobDetail(jobKey); | |||
JobNode jobNode = new JobNode(detail); | |||
node.Nodes.Add(jobNode); | |||
addTriggerNodes(jobNode); | |||
addListenerNodes(jobNode); | |||
} | |||
catch (Exception ex) | |||
{ | |||
node.Nodes.Add(string.Format("Unknown Job Type ({0})", jobKey.Name)); | |||
//TODO: Do something useful with this exception. Most likely cause is the client does not have a copy of a given dll and can't load the type. | |||
} | |||
} | |||
} | |||
private void addListenerNodes(JobNode node) | |||
{ | |||
string jobName = node.Text; | |||
string jobGroupName = node.Parent.Text; | |||
//TODO: see joblistenermanager get listeners | |||
//string[] listenerNames = node.Detail.JobListenerNames; | |||
//foreach (string listener in listenerNames) | |||
//{ | |||
// node.Text = string.Format("JL {0}", listenerNames); | |||
//} | |||
//ISet set = Scheduler.GetScheduler().JobListenerNames; | |||
} | |||
private void addTriggerNodes(TreeNode treeNode) | |||
{ | |||
var triggers = Scheduler.GetScheduler().GetTriggersOfJob(new JobKey(treeNode.Text, treeNode.Parent.Parent.Text)); | |||
TreeNode triggersNode = treeNode.Nodes.Add("Triggers"); | |||
foreach (var trigger in triggers) | |||
{ | |||
TriggerNode node = new TriggerNode(trigger); | |||
triggersNode.Nodes.Add(node); | |||
addCalendarNode(node); | |||
} | |||
} | |||
private void addCalendarNode(TriggerNode node) | |||
{ | |||
if (node.Trigger.CalendarName != null) | |||
{ | |||
//TODO: Convert this to a CalendarNode and implement CalendarDisplay controls | |||
node.Nodes.Add(node.Trigger.CalendarName); | |||
} | |||
else | |||
{ | |||
node.Nodes.Add("No calendar found"); | |||
} | |||
} | |||
private void updateRunningJobs() | |||
{ | |||
try | |||
{ | |||
this.Cursor = Cursors.WaitCursor; | |||
timer_Refresh_Running_Jobs.Stop(); | |||
listView_RunningJobs.Items.Clear(); | |||
DataTable table = Scheduler.GetRunningJobs(); | |||
foreach (DataRow row in table.Rows) | |||
{ | |||
//JobName JobDuration | |||
ListViewItem item = new ListViewItem(new string[] { Convert.ToString(row["JobName"]), Convert.ToString(row["Runtime"]) }); | |||
listView_RunningJobs.Items.Add(item); | |||
} | |||
StripStatusLabel_Jobs_Refresh_date.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm.ss"); | |||
//reset the timer ( documentation not clear if .stop = restart @ 0 in timing, but changing the interval sure should do that. ) | |||
int timer_was = timer_Refresh_Running_Jobs.Interval; | |||
timer_Refresh_Running_Jobs.Interval = timer_was + 1; | |||
timer_Refresh_Running_Jobs.Interval = timer_was; | |||
timer_Refresh_Running_Jobs.Start(); | |||
} | |||
finally | |||
{ | |||
this.Cursor = Cursors.Default; | |||
} | |||
} | |||
public QuartzScheduler Scheduler { get; set; } | |||
private void addGlobalListenerToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
AddListenerForm form = new AddListenerForm(); | |||
form.ListenerInterface = typeof(IJobListener); | |||
form.ShowDialog(); | |||
JobDataMap map = new JobDataMap(); | |||
map.Add("type", form.ListenerType); | |||
//Scheduler.ScheduleOneTimeJob(typeof(AddJobListenerJob), map, 0); | |||
loadJobGroups(); | |||
} | |||
private void addJobListenerToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
TreeNode selectedNode = jobGroupsTreeView.SelectedNode; | |||
if (selectedNode != null && selectedNode is JobNode) | |||
{ | |||
AddListenerForm form = new AddListenerForm(); | |||
form.ListenerInterface = typeof(IJobListener); | |||
form.ShowDialog(); | |||
//JobHistoryListener listener = new JobHistoryListener(); | |||
//listener.Name = null; | |||
//((JobNode)selectedNode).Detail.AddJobListener(); | |||
} | |||
} | |||
private void addJobToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
AddJobForm form = new AddJobForm(); | |||
form.ShowDialog(); | |||
if (form.JobDetail != null && form.Trigger != null) | |||
{ | |||
Scheduler.GetScheduler().ScheduleJob(form.JobDetail, form.Trigger); | |||
loadJobGroups(); | |||
} | |||
} | |||
private void btnRefreshRunningJobs_Click(object sender, EventArgs e) | |||
{ | |||
updateRunningJobs(); | |||
} | |||
private void btnRefreshJobGroups_Click(object sender, EventArgs e) | |||
{ | |||
loadJobGroups(); | |||
} | |||
private void btnRunJobNow_Click(object sender, EventArgs e) | |||
{ | |||
JobNode node = (JobNode)jobGroupsTreeView.SelectedNode; | |||
Scheduler.GetScheduler().TriggerJob(node.Detail.Key); | |||
} | |||
private void btnDeleteJob_Click(object sender, EventArgs e) | |||
{ | |||
TreeNode selectedNode = jobGroupsTreeView.SelectedNode; | |||
if (selectedNode is JobNode) | |||
{ | |||
JobNode node = (JobNode)jobGroupsTreeView.SelectedNode; | |||
Scheduler.GetScheduler().DeleteJob(node.Detail.Key); | |||
jobGroupsTreeView.SelectedNode.Remove(); | |||
} | |||
if (selectedNode is TriggerNode) | |||
{ | |||
Scheduler.GetScheduler().UnscheduleJob(((TriggerNode)selectedNode).Trigger.Key); | |||
} | |||
//loadJobGroups(); | |||
} | |||
private void btnPause_Click(object sender, EventArgs e) | |||
{ | |||
TriggerNode node = (TriggerNode)jobGroupsTreeView.SelectedNode; | |||
if (Scheduler.GetScheduler().GetTriggerState(node.Trigger.Key) == TriggerState.Paused) | |||
{ | |||
Scheduler.GetScheduler().ResumeTrigger(node.Trigger.Key); | |||
} | |||
else | |||
{ | |||
Scheduler.GetScheduler().PauseTrigger(node.Trigger.Key); | |||
} | |||
setPauseButtonText(); | |||
} | |||
private void btnEdit_Click(object sender, EventArgs e) | |||
{ | |||
TriggerNode node = (TriggerNode)jobGroupsTreeView.SelectedNode; | |||
AddJobForm form = new AddJobForm(node); | |||
form.ShowDialog(); | |||
if (form.JobDetail != null && form.Trigger != null) | |||
{ | |||
Scheduler.GetScheduler().RescheduleJob(node.Trigger.Key, form.Trigger); | |||
loadJobGroups(); | |||
} | |||
} | |||
private void backupToolStripMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
QuartzScheduler scheduler = ((SchedulerNode)((TreeView)((ContextMenuStrip)((ToolStripMenuItem)sender).Owner).SourceControl).SelectedNode).Scheduler; | |||
FileDialog dialog = new SaveFileDialog(); | |||
dialog.ShowDialog(); | |||
FileInfo file = new FileInfo(dialog.FileName); | |||
scheduler.BackupToFile(file); | |||
} | |||
private void timer_Refresh_Running_Jobs_Tick(object sender, EventArgs e) | |||
{ | |||
updateRunningJobs(); | |||
} | |||
private void addAssemblyMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
FileDialog dialog = new OpenFileDialog(); | |||
dialog.InitialDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | |||
dialog.Filter = "Assemblies (*.dll)|*.dll"; | |||
dialog.ShowDialog(); | |||
string fileName = Path.GetFileName(dialog.FileName); | |||
AssemblyRepository.AddAssembly(fileName); | |||
} | |||
private void deleteAssemblyMenuItem_Click(object sender, EventArgs e) | |||
{ | |||
using (DeleteAssembliesForm form = new DeleteAssembliesForm()) | |||
{ | |||
form.ShowDialog(); | |||
form.Close(); | |||
} | |||
} | |||
} | |||
} | |||
@@ -1,135 +1,135 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<root> | |||
<!-- | |||
Microsoft ResX Schema | |||
Version 2.0 | |||
The primary goals of this format is to allow a simple XML format | |||
that is mostly human readable. The generation and parsing of the | |||
various data types are done through the TypeConverter classes | |||
associated with the data types. | |||
Example: | |||
... ado.net/XML headers & schema ... | |||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||
<resheader name="version">2.0</resheader> | |||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||
</data> | |||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
<comment>This is a comment</comment> | |||
</data> | |||
There are any number of "resheader" rows that contain simple | |||
name/value pairs. | |||
Each data row contains a name, and value. The row also contains a | |||
type or mimetype. Type corresponds to a .NET class that support | |||
text/value conversion through the TypeConverter architecture. | |||
Classes that don't support this are serialized and stored with the | |||
mimetype set. | |||
The mimetype is used for serialized objects, and tells the | |||
ResXResourceReader how to depersist the object. This is currently not | |||
extensible. For a given mimetype the value must be set accordingly: | |||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||
that the ResXResourceWriter will generate, however the reader can | |||
read any of the formats listed below. | |||
mimetype: application/x-microsoft.net.object.binary.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.soap.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
value : The object must be serialized into a byte array | |||
: using a System.ComponentModel.TypeConverter | |||
: and then encoded with base64 encoding. | |||
--> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<metadata name="mainMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>17, 17</value> | |||
</metadata> | |||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>143, 17</value> | |||
</metadata> | |||
<metadata name="ctxScheduler.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>259, 17</value> | |||
</metadata> | |||
<metadata name="timer_Refresh_Running_Jobs.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>374, 5</value> | |||
</metadata> | |||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>25</value> | |||
</metadata> | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<root> | |||
<!-- | |||
Microsoft ResX Schema | |||
Version 2.0 | |||
The primary goals of this format is to allow a simple XML format | |||
that is mostly human readable. The generation and parsing of the | |||
various data types are done through the TypeConverter classes | |||
associated with the data types. | |||
Example: | |||
... ado.net/XML headers & schema ... | |||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||
<resheader name="version">2.0</resheader> | |||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||
</data> | |||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
<comment>This is a comment</comment> | |||
</data> | |||
There are any number of "resheader" rows that contain simple | |||
name/value pairs. | |||
Each data row contains a name, and value. The row also contains a | |||
type or mimetype. Type corresponds to a .NET class that support | |||
text/value conversion through the TypeConverter architecture. | |||
Classes that don't support this are serialized and stored with the | |||
mimetype set. | |||
The mimetype is used for serialized objects, and tells the | |||
ResXResourceReader how to depersist the object. This is currently not | |||
extensible. For a given mimetype the value must be set accordingly: | |||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||
that the ResXResourceWriter will generate, however the reader can | |||
read any of the formats listed below. | |||
mimetype: application/x-microsoft.net.object.binary.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.soap.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
value : The object must be serialized into a byte array | |||
: using a System.ComponentModel.TypeConverter | |||
: and then encoded with base64 encoding. | |||
--> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<metadata name="mainMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>17, 17</value> | |||
</metadata> | |||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>143, 17</value> | |||
</metadata> | |||
<metadata name="ctxScheduler.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>259, 17</value> | |||
</metadata> | |||
<metadata name="timer_Refresh_Running_Jobs.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||
<value>374, 5</value> | |||
</metadata> | |||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
<value>25</value> | |||
</metadata> | |||
</root> |
@@ -1,318 +1,318 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Web; | |||
using System.Collections.Specialized; | |||
using Quartz.Impl; | |||
using Quartz; | |||
using System.Data; | |||
using System.Configuration; | |||
using System.Collections; | |||
using System.Windows.Forms; | |||
using System.IO; | |||
using System.Xml.Linq; | |||
using Quartz.Impl.Matchers; | |||
using Quartz.Impl.Triggers; | |||
using Quartz.Util; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public class QuartzScheduler | |||
{ | |||
public QuartzScheduler(string server, int port, string scheduler) | |||
{ | |||
Address = string.Format("tcp://{0}:{1}/{2}", server, port, scheduler); | |||
_schedulerFactory = new StdSchedulerFactory(getProperties(Address)); | |||
try | |||
{ | |||
_scheduler = _schedulerFactory.GetScheduler(); | |||
} | |||
catch (SchedulerException se) | |||
{ | |||
MessageBox.Show("Unable to connect to the specified server", "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); | |||
} | |||
} | |||
public string Address { get; private set; } | |||
private NameValueCollection getProperties(string address) | |||
{ | |||
NameValueCollection properties = new NameValueCollection(); | |||
properties["quartz.scheduler.instanceName"] = "RemoteClient"; | |||
properties["quartz.scheduler.proxy"] = "true"; | |||
properties["quartz.threadPool.threadCount"] = "0"; | |||
properties["quartz.scheduler.proxy.address"] = address; | |||
return properties; | |||
} | |||
public IScheduler GetScheduler() | |||
{ | |||
return _scheduler; | |||
} | |||
public DataTable GetJobs() | |||
{ | |||
DataTable table = new DataTable(); | |||
table.Columns.Add("GroupName"); | |||
table.Columns.Add("JobName"); | |||
table.Columns.Add("JobDescription"); | |||
table.Columns.Add("TriggerName"); | |||
table.Columns.Add("TriggerGroupName"); | |||
table.Columns.Add("TriggerType"); | |||
table.Columns.Add("TriggerState"); | |||
table.Columns.Add("NextFireTime"); | |||
table.Columns.Add("PreviousFireTime"); | |||
var jobGroups = GetScheduler().GetJobGroupNames(); | |||
foreach (string group in jobGroups) | |||
{ | |||
var groupMatcher = GroupMatcher<JobKey>.GroupContains(group); | |||
var jobKeys = GetScheduler().GetJobKeys(groupMatcher); | |||
foreach (var jobKey in jobKeys) | |||
{ | |||
var detail = GetScheduler().GetJobDetail(jobKey); | |||
var triggers = GetScheduler().GetTriggersOfJob(jobKey); | |||
foreach (ITrigger trigger in triggers) | |||
{ | |||
DataRow row = table.NewRow(); | |||
row["GroupName"] = group; | |||
row["JobName"] = jobKey.Name; | |||
row["JobDescription"] = detail.Description; | |||
row["TriggerName"] = trigger.Key.Name; | |||
row["TriggerGroupName"] = trigger.Key.Group; | |||
row["TriggerType"] = trigger.GetType().Name; | |||
row["TriggerState"] = GetScheduler().GetTriggerState(trigger.Key); | |||
DateTimeOffset? nextFireTime = trigger.GetNextFireTimeUtc(); | |||
if (nextFireTime.HasValue) | |||
{ | |||
row["NextFireTime"] = TimeZone.CurrentTimeZone.ToLocalTime(nextFireTime.Value.DateTime); | |||
} | |||
DateTimeOffset? previousFireTime = trigger.GetPreviousFireTimeUtc(); | |||
if (previousFireTime.HasValue) | |||
{ | |||
row["PreviousFireTime"] = TimeZone.CurrentTimeZone.ToLocalTime(previousFireTime.Value.DateTime); | |||
} | |||
table.Rows.Add(row); | |||
} | |||
} | |||
} | |||
return table; | |||
} | |||
public void ScheduleOneTimeJob(Type jobType, JobDataMap dataMap, int clientID) | |||
{ | |||
string name = string.Format("{0}-{1}", jobType.Name, clientID); | |||
string group = clientID.ToString(); | |||
IJobDetail jobDetail = JobBuilder. | |||
NewJob(). | |||
OfType(jobType). | |||
WithIdentity(name, group). | |||
WithDescription("One time job"). | |||
UsingJobData(dataMap).Build(); | |||
ITrigger trigger = TriggerBuilder. | |||
Create(). | |||
ForJob(jobDetail). | |||
WithIdentity(name, group). | |||
WithSchedule(SimpleScheduleBuilder.Create().WithRepeatCount(0).WithInterval(TimeSpan.Zero)). | |||
StartNow().Build(); | |||
GetScheduler().ScheduleJob(jobDetail, trigger); | |||
} | |||
private ISchedulerFactory _schedulerFactory; | |||
private IScheduler _scheduler; | |||
public DataTable GetRunningJobs() | |||
{ | |||
DataTable table = new DataTable(); | |||
table.Columns.Add("JobName", typeof(string)); | |||
table.Columns.Add("RunTime", typeof(int)); | |||
try | |||
{ | |||
var contexts = GetScheduler().GetCurrentlyExecutingJobs(); | |||
foreach (var context in contexts) | |||
{ | |||
DataRow row = table.NewRow(); | |||
row["JobName"] = context.JobDetail.Key.Name; | |||
row["RunTime"] = (DateTime.Now.ToUniversalTime() - ((DateTimeOffset)context.FireTimeUtc).DateTime).TotalMinutes; | |||
table.Rows.Add(row); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
//TODO: Let the user know we couldn't load the running jobs. | |||
} | |||
return table; | |||
} | |||
public void BackupToFile(System.IO.FileInfo file) | |||
{ | |||
IScheduler scheduler = GetScheduler(); | |||
var jobGroupNames = scheduler.GetJobGroupNames(); | |||
List<IJobDetail> jobDetails = new List<IJobDetail>(); | |||
foreach (var jobGroup in jobGroupNames) | |||
{ | |||
var groupMatcher = GroupMatcher<JobKey>.GroupContains(jobGroup); | |||
var jobKeys = scheduler.GetJobKeys(groupMatcher); | |||
foreach (var jobKey in jobKeys) | |||
{ | |||
jobDetails.Add(scheduler.GetJobDetail(jobKey)); | |||
} | |||
} | |||
writeToFile(file, jobDetails); | |||
} | |||
private void writeToFile(System.IO.FileInfo file, List<IJobDetail> jobDetails) | |||
{ | |||
using (StreamWriter writer = file.CreateText()) | |||
{ | |||
XNamespace ns = "http://quartznet.sourceforge.net/JobSchedulingData"; | |||
XDocument doc = new XDocument(new XDeclaration("1.0", "UTF-8", "yes") | |||
, new XElement(ns + "quartz" | |||
, new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance") | |||
, new XAttribute("version", "1.0") | |||
, new XAttribute("overwrite-existing-jobs", "true") | |||
) | |||
); | |||
foreach (IJobDetail detail in jobDetails) | |||
{ | |||
doc.Root.Add( | |||
new XElement(ns + "job" | |||
, new XElement(ns + "job-detail" | |||
, new XElement(ns + "name", detail.Key.Name) | |||
, new XElement(ns + "group", detail.Key.Group) | |||
, new XElement(ns + "description", detail.Description) | |||
, new XElement(ns + "job-type", detail.JobType.FullName + "," + detail.JobType.Assembly.FullName) | |||
//TODO: Apparently volatile is no longer available. Check. | |||
//, new XElement(ns + "volatile", detail.Volatile) | |||
, new XElement(ns + "durable", detail.Durable) | |||
, new XElement(ns + "recover", detail.RequestsRecovery) | |||
, getJobDataMap(ns, detail.JobDataMap) | |||
) | |||
, getTriggers(ns, detail) | |||
) | |||
); | |||
} | |||
writer.Write(doc); | |||
writer.Flush(); | |||
writer.Close(); | |||
} | |||
} | |||
private XElement getJobDataMap(XNamespace ns, JobDataMap jobDataMap) | |||
{ | |||
XElement map = new XElement(ns + "job-data-map"); | |||
foreach (var key in jobDataMap.GetKeys()) | |||
{ | |||
map.Add(new XElement(ns + "entry" | |||
, new XElement(ns + "key", key) | |||
, new XElement(ns + "value", jobDataMap[key]) | |||
) | |||
); | |||
} | |||
return map; | |||
} | |||
private XElement[] getTriggers(XNamespace ns, IJobDetail detail) | |||
{ | |||
var triggers = _scheduler.GetTriggersOfJob(detail.Key); | |||
XElement[] elements = new XElement[triggers.Count]; | |||
int i = 0; | |||
foreach (var trigger in triggers) | |||
{ | |||
elements[i] = new XElement(ns + "trigger"); | |||
if (triggers[i] is SimpleTriggerImpl) | |||
{ | |||
elements[i].Add(getSimpleTrigger(ns, (SimpleTriggerImpl)triggers[i])); | |||
} | |||
else if (triggers[i] is CronTriggerImpl) | |||
{ | |||
elements[i].Add(getCronTrigger(ns, (CronTriggerImpl)triggers[i])); | |||
} | |||
i++; | |||
} | |||
return elements; | |||
} | |||
private XElement getCronTrigger(XNamespace ns, CronTriggerImpl trigger) | |||
{ | |||
XElement cronTrigger = new XElement(ns + "cron"); | |||
addCommonTriggerData(ns, cronTrigger, trigger); | |||
cronTrigger.Add( | |||
new XElement(ns + "cron-expression", trigger.CronExpressionString) | |||
); | |||
return cronTrigger; | |||
} | |||
private void addCommonTriggerData(XNamespace ns, XElement rootTriggerElement, AbstractTrigger trigger) | |||
{ | |||
rootTriggerElement.Add( | |||
new XElement(ns + "name", trigger.Key.Name) | |||
, new XElement(ns + "group", trigger.Key.Group) | |||
, new XElement(ns + "description", trigger.Description) | |||
, new XElement(ns + "misfire-instruction", getMisfireInstructionText(trigger)) | |||
//, new XElement(ns + "volatile", trigger.Volatile) | |||
, new XElement(ns + "job-name", trigger.JobName) | |||
, new XElement(ns + "job-group", trigger.JobGroup) | |||
); | |||
} | |||
private string getMisfireInstructionText(AbstractTrigger trigger) | |||
{ | |||
if (trigger is CronTriggerImpl) | |||
{ | |||
return getCronTriggerMisfireInstructionText(trigger.MisfireInstruction); | |||
} | |||
return getSimpleTriggerMisfireInstructionText(trigger.MisfireInstruction); | |||
} | |||
private string getSimpleTriggerMisfireInstructionText(int misfireInstruction) | |||
{ | |||
switch (misfireInstruction) | |||
{ | |||
case 0: | |||
return "SmartPolicy"; | |||
case 1: | |||
return "FireNow"; | |||
case 2: | |||
return "RescheduleNowWithExistingRepeatCount"; | |||
case 3: | |||
return "RescheduleNowWithRemainingRepeatCount"; | |||
case 4: | |||
return "RescheduleNextWithRemainingCount"; | |||
case 5: | |||
return "RescheduleNextWithExistingCount"; | |||
default: | |||
throw new ArgumentOutOfRangeException(string.Format("{0} is not a supported misfire instruction for SimpleTrigger See Quartz.MisfireInstruction for more details.", misfireInstruction)); | |||
} | |||
} | |||
private string getCronTriggerMisfireInstructionText(int misfireInstruction) | |||
{ | |||
switch (misfireInstruction) | |||
{ | |||
case 0: | |||
return "SmartPolicy"; | |||
case 1: | |||
return "FireOnceNow"; | |||
case 2: | |||
return "DoNothing"; | |||
default: | |||
throw new ArgumentOutOfRangeException(string.Format("{0} is not a supported misfire instruction for CronTrigger See Quartz.MisfireInstruction for more details.", misfireInstruction)); | |||
} | |||
} | |||
private XElement getSimpleTrigger(XNamespace ns, SimpleTriggerImpl trigger) | |||
{ | |||
XElement simpleTrigger = new XElement(ns + "simple"); | |||
addCommonTriggerData(ns, simpleTrigger, trigger); | |||
simpleTrigger.Add( | |||
new XElement(ns + "repeat-count", trigger.RepeatCount) | |||
, new XElement(ns + "repeat-interval", trigger.RepeatInterval.Milliseconds) | |||
); | |||
return simpleTrigger; | |||
} | |||
} | |||
} | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Web; | |||
using System.Collections.Specialized; | |||
using Quartz.Impl; | |||
using Quartz; | |||
using System.Data; | |||
using System.Configuration; | |||
using System.Collections; | |||
using System.Windows.Forms; | |||
using System.IO; | |||
using System.Xml.Linq; | |||
using Quartz.Impl.Matchers; | |||
using Quartz.Impl.Triggers; | |||
using Quartz.Util; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public class QuartzScheduler | |||
{ | |||
public QuartzScheduler(string server, int port, string scheduler) | |||
{ | |||
Address = string.Format("tcp://{0}:{1}/{2}", server, port, scheduler); | |||
_schedulerFactory = new StdSchedulerFactory(getProperties(Address)); | |||
try | |||
{ | |||
_scheduler = _schedulerFactory.GetScheduler(); | |||
} | |||
catch (SchedulerException) | |||
{ | |||
MessageBox.Show("Unable to connect to the specified server", "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); | |||
} | |||
} | |||
public string Address { get; private set; } | |||
private NameValueCollection getProperties(string address) | |||
{ | |||
NameValueCollection properties = new NameValueCollection(); | |||
properties["quartz.scheduler.instanceName"] = "RemoteClient"; | |||
properties["quartz.scheduler.proxy"] = "true"; | |||
properties["quartz.threadPool.threadCount"] = "0"; | |||
properties["quartz.scheduler.proxy.address"] = address; | |||
return properties; | |||
} | |||
public IScheduler GetScheduler() | |||
{ | |||
return _scheduler; | |||
} | |||
public DataTable GetJobs() | |||
{ | |||
DataTable table = new DataTable(); | |||
table.Columns.Add("GroupName"); | |||
table.Columns.Add("JobName"); | |||
table.Columns.Add("JobDescription"); | |||
table.Columns.Add("TriggerName"); | |||
table.Columns.Add("TriggerGroupName"); | |||
table.Columns.Add("TriggerType"); | |||
table.Columns.Add("TriggerState"); | |||
table.Columns.Add("NextFireTime"); | |||
table.Columns.Add("PreviousFireTime"); | |||
var jobGroups = GetScheduler().GetJobGroupNames(); | |||
foreach (string group in jobGroups) | |||
{ | |||
var groupMatcher = GroupMatcher<JobKey>.GroupContains(group); | |||
var jobKeys = GetScheduler().GetJobKeys(groupMatcher); | |||
foreach (var jobKey in jobKeys) | |||
{ | |||
var detail = GetScheduler().GetJobDetail(jobKey); | |||
var triggers = GetScheduler().GetTriggersOfJob(jobKey); | |||
foreach (ITrigger trigger in triggers) | |||
{ | |||
DataRow row = table.NewRow(); | |||
row["GroupName"] = group; | |||
row["JobName"] = jobKey.Name; | |||
row["JobDescription"] = detail.Description; | |||
row["TriggerName"] = trigger.Key.Name; | |||
row["TriggerGroupName"] = trigger.Key.Group; | |||
row["TriggerType"] = trigger.GetType().Name; | |||
row["TriggerState"] = GetScheduler().GetTriggerState(trigger.Key); | |||
DateTimeOffset? nextFireTime = trigger.GetNextFireTimeUtc(); | |||
if (nextFireTime.HasValue) | |||
{ | |||
row["NextFireTime"] = TimeZone.CurrentTimeZone.ToLocalTime(nextFireTime.Value.DateTime); | |||
} | |||
DateTimeOffset? previousFireTime = trigger.GetPreviousFireTimeUtc(); | |||
if (previousFireTime.HasValue) | |||
{ | |||
row["PreviousFireTime"] = TimeZone.CurrentTimeZone.ToLocalTime(previousFireTime.Value.DateTime); | |||
} | |||
table.Rows.Add(row); | |||
} | |||
} | |||
} | |||
return table; | |||
} | |||
public void ScheduleOneTimeJob(Type jobType, JobDataMap dataMap, int clientID) | |||
{ | |||
string name = string.Format("{0}-{1}", jobType.Name, clientID); | |||
string group = clientID.ToString(); | |||
IJobDetail jobDetail = JobBuilder. | |||
NewJob(). | |||
OfType(jobType). | |||
WithIdentity(name, group). | |||
WithDescription("One time job"). | |||
UsingJobData(dataMap).Build(); | |||
ITrigger trigger = TriggerBuilder. | |||
Create(). | |||
ForJob(jobDetail). | |||
WithIdentity(name, group). | |||
WithSchedule(SimpleScheduleBuilder.Create().WithRepeatCount(0).WithInterval(TimeSpan.Zero)). | |||
StartNow().Build(); | |||
GetScheduler().ScheduleJob(jobDetail, trigger); | |||
} | |||
private ISchedulerFactory _schedulerFactory; | |||
private IScheduler _scheduler; | |||
public DataTable GetRunningJobs() | |||
{ | |||
DataTable table = new DataTable(); | |||
table.Columns.Add("JobName", typeof(string)); | |||
table.Columns.Add("RunTime", typeof(int)); | |||
try | |||
{ | |||
var contexts = GetScheduler().GetCurrentlyExecutingJobs(); | |||
foreach (var context in contexts) | |||
{ | |||
DataRow row = table.NewRow(); | |||
row["JobName"] = context.JobDetail.Key.Name; | |||
row["RunTime"] = (DateTime.Now.ToUniversalTime() - ((DateTimeOffset)context.FireTimeUtc).DateTime).TotalMinutes; | |||
table.Rows.Add(row); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
//TODO: Let the user know we couldn't load the running jobs. | |||
} | |||
return table; | |||
} | |||
public void BackupToFile(System.IO.FileInfo file) | |||
{ | |||
IScheduler scheduler = GetScheduler(); | |||
var jobGroupNames = scheduler.GetJobGroupNames(); | |||
List<IJobDetail> jobDetails = new List<IJobDetail>(); | |||
foreach (var jobGroup in jobGroupNames) | |||
{ | |||
var groupMatcher = GroupMatcher<JobKey>.GroupContains(jobGroup); | |||
var jobKeys = scheduler.GetJobKeys(groupMatcher); | |||
foreach (var jobKey in jobKeys) | |||
{ | |||
jobDetails.Add(scheduler.GetJobDetail(jobKey)); | |||
} | |||
} | |||
writeToFile(file, jobDetails); | |||
} | |||
private void writeToFile(System.IO.FileInfo file, List<IJobDetail> jobDetails) | |||
{ | |||
using (StreamWriter writer = file.CreateText()) | |||
{ | |||
XNamespace ns = "http://quartznet.sourceforge.net/JobSchedulingData"; | |||
XDocument doc = new XDocument(new XDeclaration("1.0", "UTF-8", "yes") | |||
, new XElement(ns + "quartz" | |||
, new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance") | |||
, new XAttribute("version", "1.0") | |||
, new XAttribute("overwrite-existing-jobs", "true") | |||
) | |||
); | |||
foreach (IJobDetail detail in jobDetails) | |||
{ | |||
doc.Root.Add( | |||
new XElement(ns + "job" | |||
, new XElement(ns + "job-detail" | |||
, new XElement(ns + "name", detail.Key.Name) | |||
, new XElement(ns + "group", detail.Key.Group) | |||
, new XElement(ns + "description", detail.Description) | |||
, new XElement(ns + "job-type", detail.JobType.FullName + "," + detail.JobType.Assembly.FullName) | |||
//TODO: Apparently volatile is no longer available. Check. | |||
//, new XElement(ns + "volatile", detail.Volatile) | |||
, new XElement(ns + "durable", detail.Durable) | |||
, new XElement(ns + "recover", detail.RequestsRecovery) | |||
, getJobDataMap(ns, detail.JobDataMap) | |||
) | |||
, getTriggers(ns, detail) | |||
) | |||
); | |||
} | |||
writer.Write(doc); | |||
writer.Flush(); | |||
writer.Close(); | |||
} | |||
} | |||
private XElement getJobDataMap(XNamespace ns, JobDataMap jobDataMap) | |||
{ | |||
XElement map = new XElement(ns + "job-data-map"); | |||
foreach (var key in jobDataMap.GetKeys()) | |||
{ | |||
map.Add(new XElement(ns + "entry" | |||
, new XElement(ns + "key", key) | |||
, new XElement(ns + "value", jobDataMap[key]) | |||
) | |||
); | |||
} | |||
return map; | |||
} | |||
private XElement[] getTriggers(XNamespace ns, IJobDetail detail) | |||
{ | |||
var triggers = _scheduler.GetTriggersOfJob(detail.Key); | |||
XElement[] elements = new XElement[triggers.Count]; | |||
int i = 0; | |||
foreach (var trigger in triggers) | |||
{ | |||
elements[i] = new XElement(ns + "trigger"); | |||
if (triggers[i] is SimpleTriggerImpl) | |||
{ | |||
elements[i].Add(getSimpleTrigger(ns, (SimpleTriggerImpl)triggers[i])); | |||
} | |||
else if (triggers[i] is CronTriggerImpl) | |||
{ | |||
elements[i].Add(getCronTrigger(ns, (CronTriggerImpl)triggers[i])); | |||
} | |||
i++; | |||
} | |||
return elements; | |||
} | |||
private XElement getCronTrigger(XNamespace ns, CronTriggerImpl trigger) | |||
{ | |||
XElement cronTrigger = new XElement(ns + "cron"); | |||
addCommonTriggerData(ns, cronTrigger, trigger); | |||
cronTrigger.Add( | |||
new XElement(ns + "cron-expression", trigger.CronExpressionString) | |||
); | |||
return cronTrigger; | |||
} | |||
private void addCommonTriggerData(XNamespace ns, XElement rootTriggerElement, AbstractTrigger trigger) | |||
{ | |||
rootTriggerElement.Add( | |||
new XElement(ns + "name", trigger.Key.Name) | |||
, new XElement(ns + "group", trigger.Key.Group) | |||
, new XElement(ns + "description", trigger.Description) | |||
, new XElement(ns + "misfire-instruction", getMisfireInstructionText(trigger)) | |||
//, new XElement(ns + "volatile", trigger.Volatile) | |||
, new XElement(ns + "job-name", trigger.JobName) | |||
, new XElement(ns + "job-group", trigger.JobGroup) | |||
); | |||
} | |||
private string getMisfireInstructionText(AbstractTrigger trigger) | |||
{ | |||
if (trigger is CronTriggerImpl) | |||
{ | |||
return getCronTriggerMisfireInstructionText(trigger.MisfireInstruction); | |||
} | |||
return getSimpleTriggerMisfireInstructionText(trigger.MisfireInstruction); | |||
} | |||
private string getSimpleTriggerMisfireInstructionText(int misfireInstruction) | |||
{ | |||
switch (misfireInstruction) | |||
{ | |||
case 0: | |||
return "SmartPolicy"; | |||
case 1: | |||
return "FireNow"; | |||
case 2: | |||
return "RescheduleNowWithExistingRepeatCount"; | |||
case 3: | |||
return "RescheduleNowWithRemainingRepeatCount"; | |||
case 4: | |||
return "RescheduleNextWithRemainingCount"; | |||
case 5: | |||
return "RescheduleNextWithExistingCount"; | |||
default: | |||
throw new ArgumentOutOfRangeException(string.Format("{0} is not a supported misfire instruction for SimpleTrigger See Quartz.MisfireInstruction for more details.", misfireInstruction)); | |||
} | |||
} | |||
private string getCronTriggerMisfireInstructionText(int misfireInstruction) | |||
{ | |||
switch (misfireInstruction) | |||
{ | |||
case 0: | |||
return "SmartPolicy"; | |||
case 1: | |||
return "FireOnceNow"; | |||
case 2: | |||
return "DoNothing"; | |||
default: | |||
throw new ArgumentOutOfRangeException(string.Format("{0} is not a supported misfire instruction for CronTrigger See Quartz.MisfireInstruction for more details.", misfireInstruction)); | |||
} | |||
} | |||
private XElement getSimpleTrigger(XNamespace ns, SimpleTriggerImpl trigger) | |||
{ | |||
XElement simpleTrigger = new XElement(ns + "simple"); | |||
addCommonTriggerData(ns, simpleTrigger, trigger); | |||
simpleTrigger.Add( | |||
new XElement(ns + "repeat-count", trigger.RepeatCount) | |||
, new XElement(ns + "repeat-interval", trigger.RepeatInterval.Milliseconds) | |||
); | |||
return simpleTrigger; | |||
} | |||
} | |||
} |
@@ -0,0 +1,75 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using Microsoft.Win32; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public class RegistryStore | |||
{ | |||
public static List<ConnectionInfo> GetLastConnections() | |||
{ | |||
List<ConnectionInfo> lastConnections = new List<ConnectionInfo>(); | |||
RegistryKey managerKey = Registry.CurrentUser.CreateSubKey("QuartzNetManager"); | |||
RegistryKey key = null; | |||
if (managerKey == null) | |||
{ | |||
return lastConnections; | |||
} | |||
key = managerKey.CreateSubKey("MRUList"); | |||
if (key == null) | |||
{ | |||
return lastConnections; | |||
} | |||
for (int i = 0; i < 5; i++) | |||
{ | |||
ConnectionInfo info = ConnectionInfo.Parse((key.GetValue(string.Format("connection{0}", i), null) as string)); | |||
if (info != null) | |||
{ | |||
lastConnections.Add(info); | |||
} | |||
} | |||
key.Close(); | |||
managerKey.Close(); | |||
return lastConnections; | |||
} | |||
public static void AddConnection(ConnectionInfo info) | |||
{ | |||
RegistryKey managerKey = Registry.CurrentUser.CreateSubKey("QuartzNetManager"); | |||
RegistryKey key = null; | |||
if (managerKey == null) | |||
{ | |||
return; | |||
} | |||
key = managerKey.CreateSubKey("MRUList"); | |||
if (key == null) | |||
{ | |||
return; | |||
} | |||
//TODO: check that the key doesn't exist before trying to add. if it exists, move it to the top, but don't add it | |||
//for (int i = 4; i > 0; i--) | |||
//{ | |||
// var previous = key.GetValue(string.Format("connection{0}", i - 1), null); | |||
// if (previous != null) | |||
// { | |||
// key.SetValue(string.Format("connection{0}", i), previous); | |||
// } | |||
//} | |||
key.SetValue("connection0", info, RegistryValueKind.String); | |||
} | |||
private static object lockObject = new object(); | |||
} | |||
} |
@@ -1,143 +1,148 @@ | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
partial class ServerConnectForm | |||
{ | |||
/// <summary> | |||
/// Required designer variable. | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// Clean up any resources being used. | |||
/// </summary> | |||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region Windows Form Designer generated code | |||
/// <summary> | |||
/// Required method for Designer support - do not modify | |||
/// the contents of this method with the code editor. | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.btnConnect = new System.Windows.Forms.Button(); | |||
this.btnCancel = new System.Windows.Forms.Button(); | |||
this.label1 = new System.Windows.Forms.Label(); | |||
this.txtServer = new System.Windows.Forms.TextBox(); | |||
this.txtPort = new System.Windows.Forms.TextBox(); | |||
this.label2 = new System.Windows.Forms.Label(); | |||
this.txtScheduler = new System.Windows.Forms.TextBox(); | |||
this.label3 = new System.Windows.Forms.Label(); | |||
this.SuspendLayout(); | |||
// | |||
// btnConnect | |||
// | |||
this.btnConnect.Location = new System.Drawing.Point(32, 87); | |||
this.btnConnect.Name = "btnConnect"; | |||
this.btnConnect.Size = new System.Drawing.Size(75, 23); | |||
this.btnConnect.TabIndex = 3; | |||
this.btnConnect.Text = "Connect"; | |||
this.btnConnect.UseVisualStyleBackColor = true; | |||
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click); | |||
// | |||
// btnCancel | |||
// | |||
this.btnCancel.Location = new System.Drawing.Point(115, 87); | |||
this.btnCancel.Name = "btnCancel"; | |||
this.btnCancel.Size = new System.Drawing.Size(75, 23); | |||
this.btnCancel.TabIndex = 4; | |||
this.btnCancel.Text = "Cancel"; | |||
this.btnCancel.UseVisualStyleBackColor = true; | |||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); | |||
// | |||
// label1 | |||
// | |||
this.label1.AutoSize = true; | |||
this.label1.Location = new System.Drawing.Point(29, 12); | |||
this.label1.Name = "label1"; | |||
this.label1.Size = new System.Drawing.Size(41, 13); | |||
this.label1.TabIndex = 2; | |||
this.label1.Text = "Server:"; | |||
// | |||
// txtServer | |||
// | |||
this.txtServer.Location = new System.Drawing.Point(90, 9); | |||
this.txtServer.Name = "txtServer"; | |||
this.txtServer.Size = new System.Drawing.Size(100, 20); | |||
this.txtServer.TabIndex = 0; | |||
// | |||
// txtPort | |||
// | |||
this.txtPort.Location = new System.Drawing.Point(90, 35); | |||
this.txtPort.Name = "txtPort"; | |||
this.txtPort.Size = new System.Drawing.Size(100, 20); | |||
this.txtPort.TabIndex = 1; | |||
this.txtPort.Text = "555"; | |||
// | |||
// label2 | |||
// | |||
this.label2.AutoSize = true; | |||
this.label2.Location = new System.Drawing.Point(29, 38); | |||
this.label2.Name = "label2"; | |||
this.label2.Size = new System.Drawing.Size(29, 13); | |||
this.label2.TabIndex = 8; | |||
this.label2.Text = "Port:"; | |||
// | |||
// txtScheduler | |||
// | |||
this.txtScheduler.Location = new System.Drawing.Point(90, 61); | |||
this.txtScheduler.Name = "txtScheduler"; | |||
this.txtScheduler.Size = new System.Drawing.Size(100, 20); | |||
this.txtScheduler.TabIndex = 2; | |||
this.txtScheduler.Text = "QuartzScheduler"; | |||
// | |||
// label3 | |||
// | |||
this.label3.AutoSize = true; | |||
this.label3.Location = new System.Drawing.Point(29, 64); | |||
this.label3.Name = "label3"; | |||
this.label3.Size = new System.Drawing.Size(55, 13); | |||
this.label3.TabIndex = 10; | |||
this.label3.Text = "Scheduler"; | |||
// | |||
// ServerConnectForm | |||
// | |||
this.AcceptButton = this.btnConnect; | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.ClientSize = new System.Drawing.Size(227, 141); | |||
this.Controls.Add(this.txtScheduler); | |||
this.Controls.Add(this.label3); | |||
this.Controls.Add(this.txtPort); | |||
this.Controls.Add(this.label2); | |||
this.Controls.Add(this.txtServer); | |||
this.Controls.Add(this.label1); | |||
this.Controls.Add(this.btnCancel); | |||
this.Controls.Add(this.btnConnect); | |||
this.Name = "ServerConnectForm"; | |||
this.Text = "ServerConnectForm"; | |||
this.ResumeLayout(false); | |||
this.PerformLayout(); | |||
} | |||
#endregion | |||
private System.Windows.Forms.Button btnConnect; | |||
private System.Windows.Forms.Button btnCancel; | |||
private System.Windows.Forms.Label label1; | |||
private System.Windows.Forms.TextBox txtServer; | |||
private System.Windows.Forms.TextBox txtPort; | |||
private System.Windows.Forms.Label label2; | |||
private System.Windows.Forms.TextBox txtScheduler; | |||
private System.Windows.Forms.Label label3; | |||
} | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
partial class ServerConnectForm | |||
{ | |||
/// <summary> | |||
/// Required designer variable. | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// Clean up any resources being used. | |||
/// </summary> | |||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region Windows Form Designer generated code | |||
/// <summary> | |||
/// Required method for Designer support - do not modify | |||
/// the contents of this method with the code editor. | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.btnConnect = new System.Windows.Forms.Button(); | |||
this.btnCancel = new System.Windows.Forms.Button(); | |||
this.label1 = new System.Windows.Forms.Label(); | |||
this.txtPort = new System.Windows.Forms.TextBox(); | |||
this.label2 = new System.Windows.Forms.Label(); | |||
this.txtScheduler = new System.Windows.Forms.TextBox(); | |||
this.label3 = new System.Windows.Forms.Label(); | |||
this.cboServer = new System.Windows.Forms.ComboBox(); | |||
this.SuspendLayout(); | |||
// | |||
// btnConnect | |||
// | |||
this.btnConnect.Location = new System.Drawing.Point(32, 87); | |||
this.btnConnect.Name = "btnConnect"; | |||
this.btnConnect.Size = new System.Drawing.Size(75, 23); | |||
this.btnConnect.TabIndex = 3; | |||
this.btnConnect.Text = "Connect"; | |||
this.btnConnect.UseVisualStyleBackColor = true; | |||
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click); | |||
// | |||
// btnCancel | |||
// | |||
this.btnCancel.Location = new System.Drawing.Point(115, 87); | |||
this.btnCancel.Name = "btnCancel"; | |||
this.btnCancel.Size = new System.Drawing.Size(75, 23); | |||
this.btnCancel.TabIndex = 4; | |||
this.btnCancel.Text = "Cancel"; | |||
this.btnCancel.UseVisualStyleBackColor = true; | |||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); | |||
// | |||
// label1 | |||
// | |||
this.label1.AutoSize = true; | |||
this.label1.Location = new System.Drawing.Point(29, 12); | |||
this.label1.Name = "label1"; | |||
this.label1.Size = new System.Drawing.Size(41, 13); | |||
this.label1.TabIndex = 2; | |||
this.label1.Text = "Server:"; | |||
// | |||
// txtPort | |||
// | |||
this.txtPort.Location = new System.Drawing.Point(90, 35); | |||
this.txtPort.Name = "txtPort"; | |||
this.txtPort.Size = new System.Drawing.Size(100, 20); | |||
this.txtPort.TabIndex = 1; | |||
this.txtPort.Text = "555"; | |||
// | |||
// label2 | |||
// | |||
this.label2.AutoSize = true; | |||
this.label2.Location = new System.Drawing.Point(29, 38); | |||
this.label2.Name = "label2"; | |||
this.label2.Size = new System.Drawing.Size(29, 13); | |||
this.label2.TabIndex = 8; | |||
this.label2.Text = "Port:"; | |||
// | |||
// txtScheduler | |||
// | |||
this.txtScheduler.Location = new System.Drawing.Point(90, 61); | |||
this.txtScheduler.Name = "txtScheduler"; | |||
this.txtScheduler.Size = new System.Drawing.Size(100, 20); | |||
this.txtScheduler.TabIndex = 2; | |||
this.txtScheduler.Text = "QuartzScheduler"; | |||
// | |||
// label3 | |||
// | |||
this.label3.AutoSize = true; | |||
this.label3.Location = new System.Drawing.Point(29, 64); | |||
this.label3.Name = "label3"; | |||
this.label3.Size = new System.Drawing.Size(55, 13); | |||
this.label3.TabIndex = 10; | |||
this.label3.Text = "Scheduler"; | |||
// | |||
// cboServer | |||
// | |||
this.cboServer.FormattingEnabled = true; | |||
this.cboServer.Location = new System.Drawing.Point(90, 8); | |||
this.cboServer.Name = "cboServer"; | |||
this.cboServer.Size = new System.Drawing.Size(100, 21); | |||
this.cboServer.TabIndex = 1; | |||
this.cboServer.SelectedIndexChanged += new System.EventHandler(cboServer_SelectedIndexChanged); | |||
// | |||
// ServerConnectForm | |||
// | |||
this.AcceptButton = this.btnConnect; | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.ClientSize = new System.Drawing.Size(227, 141); | |||
this.Controls.Add(this.cboServer); | |||
this.Controls.Add(this.txtScheduler); | |||
this.Controls.Add(this.label3); | |||
this.Controls.Add(this.txtPort); | |||
this.Controls.Add(this.label2); | |||
this.Controls.Add(this.label1); | |||
this.Controls.Add(this.btnCancel); | |||
this.Controls.Add(this.btnConnect); | |||
this.Name = "ServerConnectForm"; | |||
this.Text = "ServerConnectForm"; | |||
this.Load += new System.EventHandler(this.ServerConnectForm_Load); | |||
this.ResumeLayout(false); | |||
this.PerformLayout(); | |||
} | |||
#endregion | |||
private System.Windows.Forms.Button btnConnect; | |||
private System.Windows.Forms.Button btnCancel; | |||
private System.Windows.Forms.Label label1; | |||
private System.Windows.Forms.TextBox txtPort; | |||
private System.Windows.Forms.Label label2; | |||
private System.Windows.Forms.TextBox txtScheduler; | |||
private System.Windows.Forms.Label label3; | |||
private System.Windows.Forms.ComboBox cboServer; | |||
} | |||
} |
@@ -1,37 +1,51 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Data; | |||
using System.Drawing; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Windows.Forms; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public partial class ServerConnectForm : Form | |||
{ | |||
public ServerConnectForm() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private void btnCancel_Click(object sender, EventArgs e) | |||
{ | |||
this.Close(); | |||
} | |||
private void btnConnect_Click(object sender, EventArgs e) | |||
{ | |||
Server = txtServer.Text; | |||
Port = int.Parse(txtPort.Text); | |||
Scheduler = txtScheduler.Text; | |||
this.Close(); | |||
} | |||
public string Server { get; set; } | |||
public int Port { get; set; } | |||
public string Scheduler { get; set; } | |||
} | |||
} | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Data; | |||
using System.Drawing; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Windows.Forms; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public partial class ServerConnectForm : Form | |||
{ | |||
public ServerConnectForm() | |||
{ | |||
InitializeComponent(); | |||
cboServer.DataSource = RegistryStore.GetLastConnections(); | |||
cboServer.DisplayMember = "ServerName"; | |||
} | |||
private void btnCancel_Click(object sender, EventArgs e) | |||
{ | |||
this.Close(); | |||
} | |||
private void btnConnect_Click(object sender, EventArgs e) | |||
{ | |||
Cancelled = false; | |||
Server = cboServer.Text; | |||
Port = int.Parse(txtPort.Text); | |||
Scheduler = txtScheduler.Text; | |||
RegistryStore.AddConnection(new ConnectionInfo { ServerName = Server, Port = Port, SchedulerName = Scheduler }); | |||
this.Close(); | |||
} | |||
public string Server { get; set; } | |||
public int Port { get; set; } | |||
public string Scheduler { get; set; } | |||
public bool Cancelled { get; set; } | |||
private void ServerConnectForm_Load(object sender, EventArgs e) | |||
{ | |||
Cancelled = true; | |||
} | |||
private void cboServer_SelectedIndexChanged(object sender, System.EventArgs e) | |||
{ | |||
//TODO: Implement this | |||
} | |||
} | |||
} |
@@ -1,120 +1,120 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<root> | |||
<!-- | |||
Microsoft ResX Schema | |||
Version 2.0 | |||
The primary goals of this format is to allow a simple XML format | |||
that is mostly human readable. The generation and parsing of the | |||
various data types are done through the TypeConverter classes | |||
associated with the data types. | |||
Example: | |||
... ado.net/XML headers & schema ... | |||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||
<resheader name="version">2.0</resheader> | |||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||
</data> | |||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
<comment>This is a comment</comment> | |||
</data> | |||
There are any number of "resheader" rows that contain simple | |||
name/value pairs. | |||
Each data row contains a name, and value. The row also contains a | |||
type or mimetype. Type corresponds to a .NET class that support | |||
text/value conversion through the TypeConverter architecture. | |||
Classes that don't support this are serialized and stored with the | |||
mimetype set. | |||
The mimetype is used for serialized objects, and tells the | |||
ResXResourceReader how to depersist the object. This is currently not | |||
extensible. For a given mimetype the value must be set accordingly: | |||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||
that the ResXResourceWriter will generate, however the reader can | |||
read any of the formats listed below. | |||
mimetype: application/x-microsoft.net.object.binary.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.soap.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
value : The object must be serialized into a byte array | |||
: using a System.ComponentModel.TypeConverter | |||
: and then encoded with base64 encoding. | |||
--> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<root> | |||
<!-- | |||
Microsoft ResX Schema | |||
Version 2.0 | |||
The primary goals of this format is to allow a simple XML format | |||
that is mostly human readable. The generation and parsing of the | |||
various data types are done through the TypeConverter classes | |||
associated with the data types. | |||
Example: | |||
... ado.net/XML headers & schema ... | |||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||
<resheader name="version">2.0</resheader> | |||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||
</data> | |||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
<comment>This is a comment</comment> | |||
</data> | |||
There are any number of "resheader" rows that contain simple | |||
name/value pairs. | |||
Each data row contains a name, and value. The row also contains a | |||
type or mimetype. Type corresponds to a .NET class that support | |||
text/value conversion through the TypeConverter architecture. | |||
Classes that don't support this are serialized and stored with the | |||
mimetype set. | |||
The mimetype is used for serialized objects, and tells the | |||
ResXResourceReader how to depersist the object. This is currently not | |||
extensible. For a given mimetype the value must be set accordingly: | |||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||
that the ResXResourceWriter will generate, however the reader can | |||
read any of the formats listed below. | |||
mimetype: application/x-microsoft.net.object.binary.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.soap.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
value : The object must be serialized into a byte array | |||
: using a System.ComponentModel.TypeConverter | |||
: and then encoded with base64 encoding. | |||
--> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
</root> |
@@ -0,0 +1,215 @@ | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
partial class SimpleTriggerDisplay | |||
{ | |||
/// <summary> | |||
/// Required designer variable. | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// Clean up any resources being used. | |||
/// </summary> | |||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region Component Designer generated code | |||
/// <summary> | |||
/// Required method for Designer support - do not modify | |||
/// the contents of this method with the code editor. | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.lblName = new System.Windows.Forms.Label(); | |||
this.label3 = new System.Windows.Forms.Label(); | |||
this.lblGroup = new System.Windows.Forms.Label(); | |||
this.label5 = new System.Windows.Forms.Label(); | |||
this.lblDescription = new System.Windows.Forms.Label(); | |||
this.label7 = new System.Windows.Forms.Label(); | |||
this.lblPreviousFireTime = new System.Windows.Forms.Label(); | |||
this.label9 = new System.Windows.Forms.Label(); | |||
this.lblNextFireTime = new System.Windows.Forms.Label(); | |||
this.label11 = new System.Windows.Forms.Label(); | |||
this.lblRepeatCount = new System.Windows.Forms.Label(); | |||
this.label2 = new System.Windows.Forms.Label(); | |||
this.lblRepeatInterval = new System.Windows.Forms.Label(); | |||
this.label6 = new System.Windows.Forms.Label(); | |||
this.SuspendLayout(); | |||
// | |||
// lblName | |||
// | |||
this.lblName.AutoSize = true; | |||
this.lblName.Location = new System.Drawing.Point(116, 15); | |||
this.lblName.Name = "lblName"; | |||
this.lblName.Size = new System.Drawing.Size(35, 13); | |||
this.lblName.TabIndex = 3; | |||
this.lblName.Text = "label2"; | |||
// | |||
// label3 | |||
// | |||
this.label3.AutoSize = true; | |||
this.label3.Location = new System.Drawing.Point(14, 15); | |||
this.label3.Name = "label3"; | |||
this.label3.Size = new System.Drawing.Size(38, 13); | |||
this.label3.TabIndex = 2; | |||
this.label3.Text = "Name:"; | |||
// | |||
// lblGroup | |||
// | |||
this.lblGroup.AutoSize = true; | |||
this.lblGroup.Location = new System.Drawing.Point(116, 36); | |||
this.lblGroup.Name = "lblGroup"; | |||
this.lblGroup.Size = new System.Drawing.Size(35, 13); | |||
this.lblGroup.TabIndex = 5; | |||
this.lblGroup.Text = "label4"; | |||
// | |||
// label5 | |||
// | |||
this.label5.AutoSize = true; | |||
this.label5.Location = new System.Drawing.Point(14, 36); | |||
this.label5.Name = "label5"; | |||
this.label5.Size = new System.Drawing.Size(39, 13); | |||
this.label5.TabIndex = 4; | |||
this.label5.Text = "Group:"; | |||
// | |||
// lblDescription | |||
// | |||
this.lblDescription.AutoSize = true; | |||
this.lblDescription.Location = new System.Drawing.Point(116, 57); | |||
this.lblDescription.Name = "lblDescription"; | |||
this.lblDescription.Size = new System.Drawing.Size(35, 13); | |||
this.lblDescription.TabIndex = 7; | |||
this.lblDescription.Text = "label6"; | |||
// | |||
// label7 | |||
// | |||
this.label7.AutoSize = true; | |||
this.label7.Location = new System.Drawing.Point(14, 57); | |||
this.label7.Name = "label7"; | |||
this.label7.Size = new System.Drawing.Size(63, 13); | |||
this.label7.TabIndex = 6; | |||
this.label7.Text = "Description:"; | |||
// | |||
// lblPreviousFireTime | |||
// | |||
this.lblPreviousFireTime.AutoSize = true; | |||
this.lblPreviousFireTime.Location = new System.Drawing.Point(116, 99); | |||
this.lblPreviousFireTime.Name = "lblPreviousFireTime"; | |||
this.lblPreviousFireTime.Size = new System.Drawing.Size(35, 13); | |||
this.lblPreviousFireTime.TabIndex = 9; | |||
this.lblPreviousFireTime.Text = "label8"; | |||
// | |||
// label9 | |||
// | |||
this.label9.AutoSize = true; | |||
this.label9.Location = new System.Drawing.Point(14, 99); | |||
this.label9.Name = "label9"; | |||
this.label9.Size = new System.Drawing.Size(97, 13); | |||
this.label9.TabIndex = 8; | |||
this.label9.Text = "Previous Fire Time:"; | |||
// | |||
// lblNextFireTime | |||
// | |||
this.lblNextFireTime.AutoSize = true; | |||
this.lblNextFireTime.Location = new System.Drawing.Point(116, 78); | |||
this.lblNextFireTime.Name = "lblNextFireTime"; | |||
this.lblNextFireTime.Size = new System.Drawing.Size(41, 13); | |||
this.lblNextFireTime.TabIndex = 11; | |||
this.lblNextFireTime.Text = "label10"; | |||
// | |||
// label11 | |||
// | |||
this.label11.AutoSize = true; | |||
this.label11.Location = new System.Drawing.Point(14, 78); | |||
this.label11.Name = "label11"; | |||
this.label11.Size = new System.Drawing.Size(78, 13); | |||
this.label11.TabIndex = 10; | |||
this.label11.Text = "Next Fire Time:"; | |||
// | |||
// lblRepeatCount | |||
// | |||
this.lblRepeatCount.AutoSize = true; | |||
this.lblRepeatCount.Location = new System.Drawing.Point(116, 121); | |||
this.lblRepeatCount.Name = "lblRepeatCount"; | |||
this.lblRepeatCount.Size = new System.Drawing.Size(35, 13); | |||
this.lblRepeatCount.TabIndex = 13; | |||
this.lblRepeatCount.Text = "label8"; | |||
// | |||
// label2 | |||
// | |||
this.label2.AutoSize = true; | |||
this.label2.Location = new System.Drawing.Point(14, 121); | |||
this.label2.Name = "label2"; | |||
this.label2.Size = new System.Drawing.Size(76, 13); | |||
this.label2.TabIndex = 12; | |||
this.label2.Text = "Repeat Count:"; | |||
// | |||
// lblRepeatInterval | |||
// | |||
this.lblRepeatInterval.AutoSize = true; | |||
this.lblRepeatInterval.Location = new System.Drawing.Point(116, 144); | |||
this.lblRepeatInterval.Name = "lblRepeatInterval"; | |||
this.lblRepeatInterval.Size = new System.Drawing.Size(35, 13); | |||
this.lblRepeatInterval.TabIndex = 15; | |||
this.lblRepeatInterval.Text = "label8"; | |||
// | |||
// label6 | |||
// | |||
this.label6.AutoSize = true; | |||
this.label6.Location = new System.Drawing.Point(14, 144); | |||
this.label6.Name = "label6"; | |||
this.label6.Size = new System.Drawing.Size(83, 13); | |||
this.label6.TabIndex = 14; | |||
this.label6.Text = "Repeat Interval:"; | |||
// | |||
// SimpleTriggerDisplay | |||
// | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.Controls.Add(this.lblRepeatInterval); | |||
this.Controls.Add(this.label6); | |||
this.Controls.Add(this.lblRepeatCount); | |||
this.Controls.Add(this.label2); | |||
this.Controls.Add(this.lblNextFireTime); | |||
this.Controls.Add(this.label11); | |||
this.Controls.Add(this.lblPreviousFireTime); | |||
this.Controls.Add(this.label9); | |||
this.Controls.Add(this.lblDescription); | |||
this.Controls.Add(this.label7); | |||
this.Controls.Add(this.lblGroup); | |||
this.Controls.Add(this.label5); | |||
this.Controls.Add(this.lblName); | |||
this.Controls.Add(this.label3); | |||
this.Name = "SimpleTriggerDisplay"; | |||
this.Size = new System.Drawing.Size(324, 168); | |||
this.ResumeLayout(false); | |||
this.PerformLayout(); | |||
} | |||
#endregion | |||
private System.Windows.Forms.Label lblName; | |||
private System.Windows.Forms.Label label3; | |||
private System.Windows.Forms.Label lblGroup; | |||
private System.Windows.Forms.Label label5; | |||
private System.Windows.Forms.Label lblDescription; | |||
private System.Windows.Forms.Label label7; | |||
private System.Windows.Forms.Label lblPreviousFireTime; | |||
private System.Windows.Forms.Label label9; | |||
private System.Windows.Forms.Label lblNextFireTime; | |||
private System.Windows.Forms.Label label11; | |||
private System.Windows.Forms.Label lblRepeatCount; | |||
private System.Windows.Forms.Label label2; | |||
private System.Windows.Forms.Label lblRepeatInterval; | |||
private System.Windows.Forms.Label label6; | |||
} | |||
} |
@@ -0,0 +1,55 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Drawing; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Windows.Forms; | |||
using Quartz; | |||
namespace ClickForensics.Quartz.Manager | |||
{ | |||
public partial class SimpleTriggerDisplay : UserControl | |||
{ | |||
public SimpleTriggerDisplay() | |||
{ | |||
InitializeComponent(); | |||
this.Load += new EventHandler(SimpleTriggerDisplay_Load); | |||
} | |||
void SimpleTriggerDisplay_Load(object sender, EventArgs e) | |||
{ | |||
lblDescription.Text = _trigger.Description; | |||
lblGroup.Text = _trigger.Key.Group; | |||
lblName.Text = _trigger.Key.Name; | |||
if (_trigger.GetNextFireTimeUtc().HasValue) | |||
{ | |||
lblNextFireTime.Text = _trigger.GetNextFireTimeUtc().Value.ToLocalTime().ToString(); | |||
} | |||
else | |||
{ | |||
lblNextFireTime.Text = "Unknown"; | |||
} | |||
if (_trigger.GetPreviousFireTimeUtc().HasValue) | |||
{ | |||
lblPreviousFireTime.Text = _trigger.GetPreviousFireTimeUtc().Value.ToLocalTime().ToString(); | |||
} | |||
else | |||
{ | |||
lblPreviousFireTime.Text = "Unknown"; | |||
} | |||
lblRepeatCount.Text = _trigger.RepeatCount.ToString(); | |||
lblRepeatInterval.Text = _trigger.RepeatInterval.ToString(); | |||
} | |||
public SimpleTriggerDisplay(ISimpleTrigger trigger) | |||
: this() | |||
{ | |||
_trigger = trigger; | |||
} | |||
private ISimpleTrigger _trigger; | |||
} | |||
} |
@@ -0,0 +1,120 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<root> | |||
<!-- | |||
Microsoft ResX Schema | |||
Version 2.0 | |||
The primary goals of this format is to allow a simple XML format | |||
that is mostly human readable. The generation and parsing of the | |||
various data types are done through the TypeConverter classes | |||
associated with the data types. | |||
Example: | |||
... ado.net/XML headers & schema ... | |||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||
<resheader name="version">2.0</resheader> | |||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||
</data> | |||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
<comment>This is a comment</comment> | |||
</data> | |||
There are any number of "resheader" rows that contain simple | |||
name/value pairs. | |||
Each data row contains a name, and value. The row also contains a | |||
type or mimetype. Type corresponds to a .NET class that support | |||
text/value conversion through the TypeConverter architecture. | |||
Classes that don't support this are serialized and stored with the | |||
mimetype set. | |||
The mimetype is used for serialized objects, and tells the | |||
ResXResourceReader how to depersist the object. This is currently not | |||
extensible. For a given mimetype the value must be set accordingly: | |||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||
that the ResXResourceWriter will generate, however the reader can | |||
read any of the formats listed below. | |||
mimetype: application/x-microsoft.net.object.binary.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.soap.base64 | |||
value : The object must be serialized with | |||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
: and then encoded with base64 encoding. | |||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
value : The object must be serialized into a byte array | |||
: using a System.ComponentModel.TypeConverter | |||
: and then encoded with base64 encoding. | |||
--> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
</root> |
@@ -12,7 +12,7 @@ namespace ClickForensics.Quartz.Manager | |||
{ | |||
public TriggerNode(ITrigger trigger) | |||
{ | |||
Text = Trigger.Key.Name; | |||
Text = trigger.Key.Name; | |||
Trigger = trigger; | |||
} | |||
@@ -5,10 +5,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClickForensics.Quartz.Manag | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClickForensics.Quartz.Manager.Tests", "ClickForensics.Quartz.Manager.Tests\ClickForensics.Quartz.Manager.Tests.csproj", "{B8B682CC-3E41-4810-86BF-B6728FB26D3A}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClickForensics.Quartz.Manager.Wpf", "ClickForensics.Quartz.Manager.Wpf\ClickForensics.Quartz.Manager.Wpf.csproj", "{E690105C-C13C-4DA3-A98D-74C701BBBEDD}" | |||
EndProject | |||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "ClickForensics.Quartz.Manager.Setup", "ClickForensics.Quartz.Manager.Setup\ClickForensics.Quartz.Manager.Setup.vdproj", "{756A6A07-BC4D-4812-997F-B06FED5D6B41}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClickForensics.Quartz.Manager.Wpf", "ClickForensics.Quartz.Manager.Wpf\ClickForensics.Quartz.Manager.Wpf.csproj", "{E690105C-C13C-4DA3-A98D-74C701BBBEDD}" | |||
EndProject | |||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "ClickForensics.Quartz.Manager.Setup", "ClickForensics.Quartz.Manager.Setup\ClickForensics.Quartz.Manager.Setup.vdproj", "{756A6A07-BC4D-4812-997F-B06FED5D6B41}" | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
Debug|Any CPU = Debug|Any CPU | |||
@@ -30,33 +30,32 @@ Global | |||
{D23DACFA-11A1-480E-A6C4-1F37B564523D}.Release|Mixed Platforms.Build.0 = Release|Any CPU | |||
{D23DACFA-11A1-480E-A6C4-1F37B564523D}.Release|x86.ActiveCfg = Release|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Debug|x86.ActiveCfg = Debug|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Release|Mixed Platforms.Build.0 = Release|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Release|x86.ActiveCfg = Release|Any CPU | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|Any CPU.ActiveCfg = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|Mixed Platforms.Build.0 = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|x86.ActiveCfg = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|x86.Build.0 = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|Any CPU.ActiveCfg = Release|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|Mixed Platforms.ActiveCfg = Release|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|Mixed Platforms.Build.0 = Release|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|x86.ActiveCfg = Release|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|x86.Build.0 = Release|x86 | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Debug|Any CPU.ActiveCfg = Debug | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Debug|Mixed Platforms.ActiveCfg = Debug | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Debug|x86.ActiveCfg = Debug | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Release|Any CPU.ActiveCfg = Release | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Release|Mixed Platforms.ActiveCfg = Release | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Release|x86.ActiveCfg = Release | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Release|Mixed Platforms.Build.0 = Release|Any CPU | |||
{B8B682CC-3E41-4810-86BF-B6728FB26D3A}.Release|x86.ActiveCfg = Release|Any CPU | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|Any CPU.ActiveCfg = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|Mixed Platforms.Build.0 = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|x86.ActiveCfg = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Debug|x86.Build.0 = Debug|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|Any CPU.ActiveCfg = Release|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|Mixed Platforms.ActiveCfg = Release|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|Mixed Platforms.Build.0 = Release|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|x86.ActiveCfg = Release|x86 | |||
{E690105C-C13C-4DA3-A98D-74C701BBBEDD}.Release|x86.Build.0 = Release|x86 | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Debug|Any CPU.ActiveCfg = Debug | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Debug|Mixed Platforms.ActiveCfg = Debug | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Debug|x86.ActiveCfg = Debug | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Release|Any CPU.ActiveCfg = Release | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Release|Mixed Platforms.ActiveCfg = Release | |||
{756A6A07-BC4D-4812-997F-B06FED5D6B41}.Release|x86.ActiveCfg = Release | |||
EndGlobalSection | |||
GlobalSection(SolutionProperties) = preSolution | |||
HideSolutionNode = FALSE | |||
EndGlobalSection | |||
EndGlobal | |||
EndGlobal |