commit be000f96a5a67949db4717c661177076f4d4efa9 Author: don <––don@kronosinvestments.net> Date: Thu Jan 16 17:01:41 2025 +0800 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b956f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,133 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.svclog +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml +*.azurePubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +packages/ +## TODO: If the tool you use requires repositories.config, also uncomment the next line +!packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +![Ss]tyle[Cc]op.targets +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml + +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +_NCrunch* \ No newline at end of file diff --git a/AboutBox1.Designer.cs b/AboutBox1.Designer.cs new file mode 100644 index 0000000..5a1d3e3 --- /dev/null +++ b/AboutBox1.Designer.cs @@ -0,0 +1,160 @@ +namespace iMonitorApp +{ + // Token: 0x02000002 RID: 2 + internal partial class AboutBox1 : global::System.Windows.Forms.Form + { + // Token: 0x06000009 RID: 9 RVA: 0x000022E0 File Offset: 0x000004E0 + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x0600000A RID: 10 RVA: 0x00002318 File Offset: 0x00000518 + private void InitializeComponent() + { + global::System.ComponentModel.ComponentResourceManager componentResourceManager = new global::System.ComponentModel.ComponentResourceManager(typeof(global::iMonitorApp.AboutBox1)); + this.tableLayoutPanel = new global::System.Windows.Forms.TableLayoutPanel(); + this.logoPictureBox = new global::System.Windows.Forms.PictureBox(); + this.labelProductName = new global::System.Windows.Forms.Label(); + this.labelVersion = new global::System.Windows.Forms.Label(); + this.labelCopyright = new global::System.Windows.Forms.Label(); + this.okButton = new global::System.Windows.Forms.Button(); + this.labelCompanyName = new global::System.Windows.Forms.Label(); + this.linkLabel1 = new global::System.Windows.Forms.LinkLabel(); + this.tableLayoutPanel.SuspendLayout(); + ((global::System.ComponentModel.ISupportInitialize)this.logoPictureBox).BeginInit(); + base.SuspendLayout(); + this.tableLayoutPanel.ColumnCount = 2; + this.tableLayoutPanel.ColumnStyles.Add(new global::System.Windows.Forms.ColumnStyle(global::System.Windows.Forms.SizeType.Percent, 33f)); + this.tableLayoutPanel.ColumnStyles.Add(new global::System.Windows.Forms.ColumnStyle(global::System.Windows.Forms.SizeType.Percent, 67f)); + this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0); + this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); + this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); + this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); + this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); + this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3); + this.tableLayoutPanel.Controls.Add(this.linkLabel1, 1, 4); + this.tableLayoutPanel.Dock = global::System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel.Location = new global::System.Drawing.Point(9, 9); + this.tableLayoutPanel.Name = "tableLayoutPanel"; + this.tableLayoutPanel.RowCount = 6; + this.tableLayoutPanel.RowStyles.Add(new global::System.Windows.Forms.RowStyle(global::System.Windows.Forms.SizeType.Percent, 10f)); + this.tableLayoutPanel.RowStyles.Add(new global::System.Windows.Forms.RowStyle(global::System.Windows.Forms.SizeType.Percent, 10f)); + this.tableLayoutPanel.RowStyles.Add(new global::System.Windows.Forms.RowStyle(global::System.Windows.Forms.SizeType.Percent, 10f)); + this.tableLayoutPanel.RowStyles.Add(new global::System.Windows.Forms.RowStyle(global::System.Windows.Forms.SizeType.Percent, 37.35849f)); + this.tableLayoutPanel.RowStyles.Add(new global::System.Windows.Forms.RowStyle(global::System.Windows.Forms.SizeType.Percent, 22.26415f)); + this.tableLayoutPanel.RowStyles.Add(new global::System.Windows.Forms.RowStyle(global::System.Windows.Forms.SizeType.Percent, 10f)); + this.tableLayoutPanel.Size = new global::System.Drawing.Size(417, 265); + this.tableLayoutPanel.TabIndex = 0; + this.logoPictureBox.Dock = global::System.Windows.Forms.DockStyle.Fill; + this.logoPictureBox.Image = (global::System.Drawing.Image)componentResourceManager.GetObject("logoPictureBox.Image"); + this.logoPictureBox.Location = new global::System.Drawing.Point(3, 3); + this.logoPictureBox.Name = "logoPictureBox"; + this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); + this.logoPictureBox.Size = new global::System.Drawing.Size(131, 259); + this.logoPictureBox.SizeMode = global::System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.logoPictureBox.TabIndex = 12; + this.logoPictureBox.TabStop = false; + this.labelProductName.Dock = global::System.Windows.Forms.DockStyle.Fill; + this.labelProductName.Location = new global::System.Drawing.Point(143, 0); + this.labelProductName.Margin = new global::System.Windows.Forms.Padding(6, 0, 3, 0); + this.labelProductName.MaximumSize = new global::System.Drawing.Size(0, 17); + this.labelProductName.Name = "labelProductName"; + this.labelProductName.Size = new global::System.Drawing.Size(271, 17); + this.labelProductName.TabIndex = 19; + this.labelProductName.Text = "Product Name"; + this.labelProductName.TextAlign = global::System.Drawing.ContentAlignment.MiddleLeft; + this.labelVersion.Dock = global::System.Windows.Forms.DockStyle.Fill; + this.labelVersion.Location = new global::System.Drawing.Point(143, 26); + this.labelVersion.Margin = new global::System.Windows.Forms.Padding(6, 0, 3, 0); + this.labelVersion.MaximumSize = new global::System.Drawing.Size(0, 17); + this.labelVersion.Name = "labelVersion"; + this.labelVersion.Size = new global::System.Drawing.Size(271, 17); + this.labelVersion.TabIndex = 0; + this.labelVersion.Text = "Version"; + this.labelVersion.TextAlign = global::System.Drawing.ContentAlignment.MiddleLeft; + this.labelCopyright.Dock = global::System.Windows.Forms.DockStyle.Fill; + this.labelCopyright.Location = new global::System.Drawing.Point(143, 52); + this.labelCopyright.Margin = new global::System.Windows.Forms.Padding(6, 0, 3, 0); + this.labelCopyright.MaximumSize = new global::System.Drawing.Size(0, 17); + this.labelCopyright.Name = "labelCopyright"; + this.labelCopyright.Size = new global::System.Drawing.Size(271, 17); + this.labelCopyright.TabIndex = 21; + this.labelCopyright.Text = "Copyright"; + this.labelCopyright.TextAlign = global::System.Drawing.ContentAlignment.MiddleLeft; + this.okButton.Anchor = (global::System.Windows.Forms.AnchorStyles.Bottom | global::System.Windows.Forms.AnchorStyles.Right); + this.okButton.DialogResult = global::System.Windows.Forms.DialogResult.Cancel; + this.okButton.Location = new global::System.Drawing.Point(339, 239); + this.okButton.Name = "okButton"; + this.okButton.Size = new global::System.Drawing.Size(75, 23); + this.okButton.TabIndex = 24; + this.okButton.Text = "&OK"; + this.labelCompanyName.Dock = global::System.Windows.Forms.DockStyle.Fill; + this.labelCompanyName.Location = new global::System.Drawing.Point(143, 78); + this.labelCompanyName.Margin = new global::System.Windows.Forms.Padding(6, 0, 3, 0); + this.labelCompanyName.MaximumSize = new global::System.Drawing.Size(0, 17); + this.labelCompanyName.Name = "labelCompanyName"; + this.labelCompanyName.Size = new global::System.Drawing.Size(271, 17); + this.labelCompanyName.TabIndex = 22; + this.labelCompanyName.Text = "Company Name"; + this.labelCompanyName.TextAlign = global::System.Drawing.ContentAlignment.MiddleLeft; + this.linkLabel1.AutoSize = true; + this.linkLabel1.Location = new global::System.Drawing.Point(140, 177); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new global::System.Drawing.Size(55, 13); + this.linkLabel1.TabIndex = 25; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "linkLabel1"; + base.AcceptButton = this.okButton; + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + base.ClientSize = new global::System.Drawing.Size(435, 283); + base.Controls.Add(this.tableLayoutPanel); + base.FormBorderStyle = global::System.Windows.Forms.FormBorderStyle.FixedDialog; + base.MaximizeBox = false; + base.MinimizeBox = false; + base.Name = "AboutBox1"; + base.Padding = new global::System.Windows.Forms.Padding(9); + base.ShowIcon = false; + base.ShowInTaskbar = false; + base.StartPosition = global::System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "AboutBox1"; + this.tableLayoutPanel.ResumeLayout(false); + this.tableLayoutPanel.PerformLayout(); + ((global::System.ComponentModel.ISupportInitialize)this.logoPictureBox).EndInit(); + base.ResumeLayout(false); + } + + // Token: 0x04000001 RID: 1 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x04000002 RID: 2 + private global::System.Windows.Forms.TableLayoutPanel tableLayoutPanel; + + // Token: 0x04000003 RID: 3 + private global::System.Windows.Forms.PictureBox logoPictureBox; + + // Token: 0x04000004 RID: 4 + private global::System.Windows.Forms.Label labelProductName; + + // Token: 0x04000005 RID: 5 + private global::System.Windows.Forms.Label labelVersion; + + // Token: 0x04000006 RID: 6 + private global::System.Windows.Forms.Label labelCopyright; + + // Token: 0x04000007 RID: 7 + private global::System.Windows.Forms.Label labelCompanyName; + + // Token: 0x04000008 RID: 8 + private global::System.Windows.Forms.Button okButton; + + // Token: 0x04000009 RID: 9 + private global::System.Windows.Forms.LinkLabel linkLabel1; + } +} diff --git a/AboutBox1.cs b/AboutBox1.cs new file mode 100644 index 0000000..b09ae89 --- /dev/null +++ b/AboutBox1.cs @@ -0,0 +1,156 @@ +using System; +using System.ComponentModel; +using System.Deployment.Application; +using System.Drawing; +using System.IO; +using System.Reflection; +using System.Windows.Forms; + +namespace iMonitorApp +{ + // Token: 0x02000002 RID: 2 + internal partial class AboutBox1 : Form + { + // Token: 0x06000001 RID: 1 RVA: 0x00002048 File Offset: 0x00000248 + public AboutBox1() + { + this.InitializeComponent(); + this.Text = string.Format("About {0}", this.AssemblyTitle); + this.labelProductName.Text = this.AssemblyProduct; + this.labelVersion.Text = string.Format("Version {0}", this.getVersion()); + this.labelCopyright.Text = this.AssemblyCopyright; + this.linkLabel1.Text = "http://wiki.4ecap.com/4ECwiki/Alarm_Concept"; + this.labelCompanyName.Text = this.AssemblyCompany; + } + + // Token: 0x06000002 RID: 2 RVA: 0x000020E8 File Offset: 0x000002E8 + private Version getVersion() + { + Version result; + try + { + result = ApplicationDeployment.CurrentDeployment.CurrentVersion; + } + catch + { + result = Assembly.GetExecutingAssembly().GetName().Version; + } + return result; + } + + // Token: 0x17000001 RID: 1 + // (get) Token: 0x06000003 RID: 3 RVA: 0x0000212C File Offset: 0x0000032C + public string AssemblyTitle + { + get + { + object[] customAttributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); + bool flag = customAttributes.Length != 0; + if (flag) + { + AssemblyTitleAttribute assemblyTitleAttribute = (AssemblyTitleAttribute)customAttributes[0]; + bool flag2 = assemblyTitleAttribute.Title != ""; + if (flag2) + { + return assemblyTitleAttribute.Title; + } + } + return Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); + } + } + + // Token: 0x17000002 RID: 2 + // (get) Token: 0x06000004 RID: 4 RVA: 0x00002198 File Offset: 0x00000398 + public string AssemblyVersion + { + get + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + } + + // Token: 0x17000003 RID: 3 + // (get) Token: 0x06000005 RID: 5 RVA: 0x000021C0 File Offset: 0x000003C0 + public string AssemblyDescription + { + get + { + object[] customAttributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); + bool flag = customAttributes.Length == 0; + string result; + if (flag) + { + result = ""; + } + else + { + result = ((AssemblyDescriptionAttribute)customAttributes[0]).Description; + } + return result; + } + } + + // Token: 0x17000004 RID: 4 + // (get) Token: 0x06000006 RID: 6 RVA: 0x00002208 File Offset: 0x00000408 + public string AssemblyProduct + { + get + { + object[] customAttributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); + bool flag = customAttributes.Length == 0; + string result; + if (flag) + { + result = ""; + } + else + { + result = ((AssemblyProductAttribute)customAttributes[0]).Product; + } + return result; + } + } + + // Token: 0x17000005 RID: 5 + // (get) Token: 0x06000007 RID: 7 RVA: 0x00002250 File Offset: 0x00000450 + public string AssemblyCopyright + { + get + { + object[] customAttributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + bool flag = customAttributes.Length == 0; + string result; + if (flag) + { + result = ""; + } + else + { + result = ((AssemblyCopyrightAttribute)customAttributes[0]).Copyright; + } + return result; + } + } + + // Token: 0x17000006 RID: 6 + // (get) Token: 0x06000008 RID: 8 RVA: 0x00002298 File Offset: 0x00000498 + public string AssemblyCompany + { + get + { + object[] customAttributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); + bool flag = customAttributes.Length == 0; + string result; + if (flag) + { + result = ""; + } + else + { + result = ((AssemblyCompanyAttribute)customAttributes[0]).Company; + } + return result; + } + } + } +} diff --git a/AboutBox1.resources b/AboutBox1.resources new file mode 100644 index 0000000..55cec0d Binary files /dev/null and b/AboutBox1.resources differ diff --git a/AsyncBindingList.cs b/AsyncBindingList.cs new file mode 100644 index 0000000..e805ab7 --- /dev/null +++ b/AsyncBindingList.cs @@ -0,0 +1,39 @@ +using System; +using System.ComponentModel; + +namespace iMonitorApp +{ + // Token: 0x02000019 RID: 25 + public class AsyncBindingList : BindingList + { + // Token: 0x060000BA RID: 186 RVA: 0x00008400 File Offset: 0x00006600 + public AsyncBindingList(ISynchronizeInvoke invoke) + { + this.invoke = invoke; + } + + // Token: 0x060000BB RID: 187 RVA: 0x00008414 File Offset: 0x00006614 + protected override void OnListChanged(ListChangedEventArgs e) + { + bool invokeRequired = this.invoke.InvokeRequired; + if (invokeRequired) + { + IAsyncResult asyncResult = this.invoke.BeginInvoke(new AsyncBindingList.ListChangedDelegate(base.OnListChanged), new object[] + { + e + }); + } + else + { + base.OnListChanged(e); + } + } + + // Token: 0x04000077 RID: 119 + private ISynchronizeInvoke invoke; + + // Token: 0x0200003F RID: 63 + // (Invoke) Token: 0x06000217 RID: 535 + private delegate void ListChangedDelegate(ListChangedEventArgs e); + } +} diff --git a/AsynchronousSocketListener.cs b/AsynchronousSocketListener.cs new file mode 100644 index 0000000..7256d2f --- /dev/null +++ b/AsynchronousSocketListener.cs @@ -0,0 +1,141 @@ +using System; +using System.Diagnostics; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; + +namespace iMonitorApp +{ + // Token: 0x0200001F RID: 31 + public class AsynchronousSocketListener + { + // Token: 0x1700001F RID: 31 + // (get) Token: 0x060000E5 RID: 229 RVA: 0x0000A24C File Offset: 0x0000844C + // (set) Token: 0x060000E6 RID: 230 RVA: 0x0000A253 File Offset: 0x00008453 + public static int Port { get; set; } + + // Token: 0x17000020 RID: 32 + // (get) Token: 0x060000E7 RID: 231 RVA: 0x0000A25B File Offset: 0x0000845B + // (set) Token: 0x060000E8 RID: 232 RVA: 0x0000A262 File Offset: 0x00008462 + public static string IPAddress { get; set; } + + // Token: 0x14000003 RID: 3 + // (add) Token: 0x060000E9 RID: 233 RVA: 0x0000A26C File Offset: 0x0000846C + // (remove) Token: 0x060000EA RID: 234 RVA: 0x0000A2A0 File Offset: 0x000084A0 + // [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static event EventHandler Received; + + // Token: 0x060000EB RID: 235 RVA: 0x0000A2D3 File Offset: 0x000084D3 + public AsynchronousSocketListener(string ipaddress, int port) + { + AsynchronousSocketListener.IPAddress = ipaddress; + AsynchronousSocketListener.Port = port; + } + + // Token: 0x060000EC RID: 236 RVA: 0x0000A2EC File Offset: 0x000084EC + protected static void OnReceived(string s, EventArgs e) + { + bool flag = AsynchronousSocketListener.Received != null; + if (flag) + { + AsynchronousSocketListener.Received(s, e); + } + } + + // Token: 0x060000ED RID: 237 RVA: 0x0000A314 File Offset: 0x00008514 + public static void StartListening() + { + byte[] array = new byte[150000000]; + string hostName = Dns.GetHostName(); + Debug.WriteLine("Server socket IP is: " + AsynchronousSocketListener.IPAddress.ToString()); + IPHostEntry iphostEntry = Dns.Resolve(AsynchronousSocketListener.IPAddress.ToString()); + + IPAddress address = iphostEntry.AddressList[0]; + IPEndPoint localEP = new IPEndPoint(address, AsynchronousSocketListener.Port); + Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + try + { + socket.Bind(localEP); + socket.Listen(10); + for (;;) + { + AsynchronousSocketListener.allDone.Reset(); + Debug.WriteLine("Waiting for Clients..."); + socket.BeginAccept(new AsyncCallback(AsynchronousSocketListener.AcceptCallback), socket); + AsynchronousSocketListener.allDone.WaitOne(); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + Console.WriteLine("\nPress ENTER to continue..."); + Console.Read(); + } + + // Token: 0x060000EE RID: 238 RVA: 0x0000A408 File Offset: 0x00008608 + public static void AcceptCallback(IAsyncResult ar) + { + AsynchronousSocketListener.allDone.Set(); + Socket socket = (Socket)ar.AsyncState; + Socket socket2 = socket.EndAccept(ar); + StateObject stateObject = new StateObject(); + stateObject.workSocket = socket2; + socket2.BeginReceive(stateObject.buffer, 0, 20480, SocketFlags.None, new AsyncCallback(AsynchronousSocketListener.ReadCallback), stateObject); + } + + // Token: 0x060000EF RID: 239 RVA: 0x0000A464 File Offset: 0x00008664 + public static void ReadCallback(IAsyncResult ar) + { + string text = string.Empty; + StateObject stateObject = (StateObject)ar.AsyncState; + Socket workSocket = stateObject.workSocket; + int num = workSocket.EndReceive(ar); + bool flag = num > 0; + if (flag) + { + stateObject.sb.Append(Encoding.ASCII.GetString(stateObject.buffer, 0, num)); + text = stateObject.sb.ToString(); + bool flag2 = text.IndexOf("") > -1; + if (flag2) + { + Console.WriteLine("Read {0} bytes from socket (sender:" + workSocket.RemoteEndPoint.ToString() + "). \n Data : {1}", text.Length, text); + Debug.WriteLine(text); + AsynchronousSocketListener.OnReceived(text, EventArgs.Empty); + } + else + { + workSocket.BeginReceive(stateObject.buffer, 0, 20480, SocketFlags.None, new AsyncCallback(AsynchronousSocketListener.ReadCallback), stateObject); + } + } + } + + // Token: 0x060000F0 RID: 240 RVA: 0x0000A548 File Offset: 0x00008748 + private static void Send(Socket handler, string data) + { + byte[] bytes = Encoding.ASCII.GetBytes(data); + handler.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(AsynchronousSocketListener.SendCallback), handler); + } + + // Token: 0x060000F1 RID: 241 RVA: 0x0000A57C File Offset: 0x0000877C + private static void SendCallback(IAsyncResult ar) + { + try + { + Socket socket = (Socket)ar.AsyncState; + int num = socket.EndSend(ar); + Console.WriteLine("Sent {0} bytes to client.", num); + socket.Shutdown(SocketShutdown.Both); + socket.Close(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + // Token: 0x040000B2 RID: 178 + public static ManualResetEvent allDone = new ManualResetEvent(false); + } +} diff --git a/AsynchronousSocketListenerSMS.cs b/AsynchronousSocketListenerSMS.cs new file mode 100644 index 0000000..c1be6e8 --- /dev/null +++ b/AsynchronousSocketListenerSMS.cs @@ -0,0 +1,140 @@ +using System; +using System.Diagnostics; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; + +namespace iMonitorApp +{ + // Token: 0x02000005 RID: 5 + public class AsynchronousSocketListenerSMS + { + // Token: 0x17000007 RID: 7 + // (get) Token: 0x0600000F RID: 15 RVA: 0x00002B4E File Offset: 0x00000D4E + // (set) Token: 0x06000010 RID: 16 RVA: 0x00002B55 File Offset: 0x00000D55 + public static int Port { get; set; } + + // Token: 0x17000008 RID: 8 + // (get) Token: 0x06000011 RID: 17 RVA: 0x00002B5D File Offset: 0x00000D5D + // (set) Token: 0x06000012 RID: 18 RVA: 0x00002B64 File Offset: 0x00000D64 + public static string IPAddress { get; set; } + + // Token: 0x14000001 RID: 1 + // (add) Token: 0x06000013 RID: 19 RVA: 0x00002B6C File Offset: 0x00000D6C + // (remove) Token: 0x06000014 RID: 20 RVA: 0x00002BA0 File Offset: 0x00000DA0 + // [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static event EventHandler Received; + + // Token: 0x06000015 RID: 21 RVA: 0x00002BD3 File Offset: 0x00000DD3 + public AsynchronousSocketListenerSMS(string ipaddress, int port) + { + AsynchronousSocketListenerSMS.IPAddress = ipaddress; + AsynchronousSocketListenerSMS.Port = port; + } + + // Token: 0x06000016 RID: 22 RVA: 0x00002BEC File Offset: 0x00000DEC + protected static void OnReceived(string s, EventArgs e) + { + bool flag = AsynchronousSocketListenerSMS.Received != null; + if (flag) + { + AsynchronousSocketListenerSMS.Received(s, e); + } + } + + // Token: 0x06000017 RID: 23 RVA: 0x00002C14 File Offset: 0x00000E14 + public static void StartListening() + { + byte[] array = new byte[150000000]; + string hostName = Dns.GetHostName(); + Debug.WriteLine("Server socket IP is: " + AsynchronousSocketListenerSMS.IPAddress.ToString()); + IPHostEntry iphostEntry = Dns.Resolve(AsynchronousSocketListenerSMS.IPAddress.ToString()); + IPAddress address = iphostEntry.AddressList[0]; + IPEndPoint localEP = new IPEndPoint(address, AsynchronousSocketListenerSMS.Port); + Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + try + { + socket.Bind(localEP); + socket.Listen(10); + for (;;) + { + AsynchronousSocketListenerSMS.allDone.Reset(); + Debug.WriteLine("Waiting for Clients..."); + socket.BeginAccept(new AsyncCallback(AsynchronousSocketListenerSMS.AcceptCallback), socket); + AsynchronousSocketListenerSMS.allDone.WaitOne(); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + Console.WriteLine("\nPress ENTER to continue..."); + Console.Read(); + } + + // Token: 0x06000018 RID: 24 RVA: 0x00002D08 File Offset: 0x00000F08 + public static void AcceptCallback(IAsyncResult ar) + { + AsynchronousSocketListenerSMS.allDone.Set(); + Socket socket = (Socket)ar.AsyncState; + Socket socket2 = socket.EndAccept(ar); + StateObjectSMS stateObjectSMS = new StateObjectSMS(); + stateObjectSMS.workSocket = socket2; + socket2.BeginReceive(stateObjectSMS.buffer, 0, 20480, SocketFlags.None, new AsyncCallback(AsynchronousSocketListenerSMS.ReadCallback), stateObjectSMS); + } + + // Token: 0x06000019 RID: 25 RVA: 0x00002D64 File Offset: 0x00000F64 + public static void ReadCallback(IAsyncResult ar) + { + string text = string.Empty; + StateObjectSMS stateObjectSMS = (StateObjectSMS)ar.AsyncState; + Socket workSocket = stateObjectSMS.workSocket; + int num = workSocket.EndReceive(ar); + bool flag = num > 0; + if (flag) + { + stateObjectSMS.sb.Append(Encoding.ASCII.GetString(stateObjectSMS.buffer, 0, num)); + text = stateObjectSMS.sb.ToString(); + bool flag2 = text.IndexOf("") > -1; + if (flag2) + { + Console.WriteLine("Read {0} bytes from socket (sender:" + workSocket.RemoteEndPoint.ToString() + "). \n Data : {1}", text.Length, text); + Debug.WriteLine(text); + AsynchronousSocketListenerSMS.OnReceived(text, EventArgs.Empty); + } + else + { + workSocket.BeginReceive(stateObjectSMS.buffer, 0, 20480, SocketFlags.None, new AsyncCallback(AsynchronousSocketListenerSMS.ReadCallback), stateObjectSMS); + } + } + } + + // Token: 0x0600001A RID: 26 RVA: 0x00002E48 File Offset: 0x00001048 + private static void Send(Socket handler, string data) + { + byte[] bytes = Encoding.ASCII.GetBytes(data); + handler.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(AsynchronousSocketListenerSMS.SendCallback), handler); + } + + // Token: 0x0600001B RID: 27 RVA: 0x00002E7C File Offset: 0x0000107C + private static void SendCallback(IAsyncResult ar) + { + try + { + Socket socket = (Socket)ar.AsyncState; + int num = socket.EndSend(ar); + Console.WriteLine("Sent {0} bytes to client.", num); + socket.Shutdown(SocketShutdown.Both); + socket.Close(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + // Token: 0x0400000E RID: 14 + public static ManualResetEvent allDone = new ManualResetEvent(false); + } +} diff --git a/AsynchronousSocketListenerStackAlarms.cs b/AsynchronousSocketListenerStackAlarms.cs new file mode 100644 index 0000000..24d2f11 --- /dev/null +++ b/AsynchronousSocketListenerStackAlarms.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; +using _4ELogger; + +namespace iMonitorApp +{ + // Token: 0x0200000B RID: 11 + public class AsynchronousSocketListenerStackAlarms + { + // Token: 0x17000017 RID: 23 + // (get) Token: 0x06000045 RID: 69 RVA: 0x000032D9 File Offset: 0x000014D9 + // (set) Token: 0x06000046 RID: 70 RVA: 0x000032E0 File Offset: 0x000014E0 + public static int Port { get; set; } + + // Token: 0x17000018 RID: 24 + // (get) Token: 0x06000047 RID: 71 RVA: 0x000032E8 File Offset: 0x000014E8 + // (set) Token: 0x06000048 RID: 72 RVA: 0x000032EF File Offset: 0x000014EF + public static string IPAddress { get; set; } + + // Token: 0x14000002 RID: 2 + // (add) Token: 0x06000049 RID: 73 RVA: 0x000032F8 File Offset: 0x000014F8 + // (remove) Token: 0x0600004A RID: 74 RVA: 0x0000332C File Offset: 0x0000152C + // [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static event EventHandler Received; + + // Token: 0x0600004B RID: 75 RVA: 0x0000335F File Offset: 0x0000155F + public AsynchronousSocketListenerStackAlarms(string ipaddress, int port) + { + AsynchronousSocketListenerStackAlarms.IPAddress = ipaddress; + AsynchronousSocketListenerStackAlarms.Port = port; + } + + // Token: 0x0600004C RID: 76 RVA: 0x00003378 File Offset: 0x00001578 + protected static void OnReceived(string s, EventArgs e) + { + bool flag = AsynchronousSocketListenerStackAlarms.Received != null; + if (flag) + { + AsynchronousSocketListenerStackAlarms.Received(s, e); + } + } + + // Token: 0x0600004D RID: 77 RVA: 0x000033A0 File Offset: 0x000015A0 + public static void StartListening() + { + // byte[] array = new byte[150000000]; + // string hostName = Dns.GetHostName(); + Debug.WriteLine("Server socket IP is: " + AsynchronousSocketListenerStackAlarms.IPAddress.ToString()); + IPHostEntry iphostEntry = Dns.Resolve(AsynchronousSocketListenerStackAlarms.IPAddress.ToString()); + IPAddress address = iphostEntry.AddressList[0]; + IPEndPoint localEP = new IPEndPoint(address, AsynchronousSocketListenerStackAlarms.Port); + Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + try + { + socket.Bind(localEP); + socket.Listen(10); + for (;;) + { + AsynchronousSocketListenerStackAlarms.allDone.Reset(); + Debug.WriteLine("Waiting for Clients..."); + socket.BeginAccept(new AsyncCallback(AsynchronousSocketListenerStackAlarms.AcceptCallback), socket); + AsynchronousSocketListenerStackAlarms.allDone.WaitOne(); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + Console.WriteLine("\nPress ENTER to continue..."); + Console.Read(); + } + + // Token: 0x0600004E RID: 78 RVA: 0x00003494 File Offset: 0x00001694 + public static void AcceptCallback(IAsyncResult ar) + { + AsynchronousSocketListenerStackAlarms.allDone.Set(); + Socket socket = (Socket)ar.AsyncState; + Socket socket2 = socket.EndAccept(ar); + StateObjectStackAlarms stateObjectStackAlarms = new StateObjectStackAlarms(); + stateObjectStackAlarms.workSocket = socket2; + socket2.BeginReceive(stateObjectStackAlarms.buffer, 0, 20480, SocketFlags.None, new AsyncCallback(AsynchronousSocketListenerStackAlarms.ReadCallback), stateObjectStackAlarms); + } + + // Token: 0x0600004F RID: 79 RVA: 0x000034F0 File Offset: 0x000016F0 + public static void ReadCallback(IAsyncResult ar) + { + string text = string.Empty; + bool flag = AsynchronousSocketListenerStackAlarms.alarms_received.Count >= 999; + if (flag) + { + AsynchronousSocketListenerStackAlarms.alarms_received.Clear(); + } + StateObjectStackAlarms stateObjectStackAlarms = (StateObjectStackAlarms)ar.AsyncState; + Socket workSocket = stateObjectStackAlarms.workSocket; + int num = workSocket.EndReceive(ar); + bool flag2 = num > 0; + if (flag2) + { + stateObjectStackAlarms.sb.Append(Encoding.Default.GetString(stateObjectStackAlarms.buffer, 0, num)); + text = stateObjectStackAlarms.sb.ToString(); + bool flag3 = text.IndexOf("") > -1; + if (flag3) + { + Console.WriteLine("Read {0} bytes from socket (sender:" + workSocket.RemoteEndPoint.ToString() + "). \n Data : {1}", text.Length, text); + Logger.Log(string.Concat(new string[] + { + "Read {", + text.Length.ToString(), + "} bytes from socket (sender:", + workSocket.RemoteEndPoint.ToString(), + "). \n Data : ", + text.Substring(0, 100) + }), "iMonitor_Receiver", "iMonitor"); + Debug.WriteLine(text); + bool flag4 = text.Contains("Basket overloaded"); + if (!flag4) + { + bool flag5 = AsynchronousSocketListenerStackAlarms.alarms_received.ContainsKey(workSocket.RemoteEndPoint.AddressFamily.ToString() + text); + if (flag5) + { + bool flag6 = (DateTime.Now - AsynchronousSocketListenerStackAlarms.alarms_received[workSocket.RemoteEndPoint.AddressFamily.ToString() + text]).TotalSeconds <= 600.0; + if (!flag6) + { + AsynchronousSocketListenerStackAlarms.alarms_received[workSocket.RemoteEndPoint.AddressFamily.ToString() + text] = DateTime.Now; + AsynchronousSocketListenerStackAlarms.OnReceived(text, EventArgs.Empty); + } + } + else + { + AsynchronousSocketListenerStackAlarms.alarms_received.Add(workSocket.RemoteEndPoint.AddressFamily.ToString() + text, DateTime.Now); + AsynchronousSocketListenerStackAlarms.OnReceived(text, EventArgs.Empty); + } + AsynchronousSocketListenerStackAlarms.Send(workSocket, "Instruction Received"); + } + } + else + { + workSocket.BeginReceive(stateObjectStackAlarms.buffer, 0, 20480, SocketFlags.None, new AsyncCallback(AsynchronousSocketListenerStackAlarms.ReadCallback), stateObjectStackAlarms); + } + } + } + + // Token: 0x06000050 RID: 80 RVA: 0x00003778 File Offset: 0x00001978 + private static void Send(Socket handler, string data) + { + byte[] bytes = Encoding.ASCII.GetBytes(data); + handler.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(AsynchronousSocketListenerStackAlarms.SendCallback), handler); + } + + // Token: 0x06000051 RID: 81 RVA: 0x000037AC File Offset: 0x000019AC + private static void SendCallback(IAsyncResult ar) + { + try + { + Socket socket = (Socket)ar.AsyncState; + int num = socket.EndSend(ar); + Console.WriteLine("Sent {0} bytes to client.", num); + socket.Shutdown(SocketShutdown.Both); + socket.Close(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + // Token: 0x04000024 RID: 36 + public static ManualResetEvent allDone = new ManualResetEvent(false); + + // Token: 0x04000028 RID: 40 + private static Dictionary alarms_received = new Dictionary(); + } +} diff --git a/BindingListInvoked.cs b/BindingListInvoked.cs new file mode 100644 index 0000000..55fb39e --- /dev/null +++ b/BindingListInvoked.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; + +namespace iMonitorApp +{ + // Token: 0x02000017 RID: 23 + public class BindingListInvoked : BindingList + { + // Token: 0x060000A4 RID: 164 RVA: 0x000075F3 File Offset: 0x000057F3 + public BindingListInvoked() + { + } + + // Token: 0x060000A5 RID: 165 RVA: 0x000075FD File Offset: 0x000057FD + public BindingListInvoked(ISynchronizeInvoke invoke) + { + this._invoke = invoke; + } + + // Token: 0x060000A6 RID: 166 RVA: 0x0000760E File Offset: 0x0000580E + public BindingListInvoked(IList items) + { + this.DataSource = items; + } + + // Token: 0x060000A7 RID: 167 RVA: 0x00007620 File Offset: 0x00005820 + protected override void OnListChanged(ListChangedEventArgs e) + { + bool flag = this._invoke != null && this._invoke.InvokeRequired; + if (flag) + { + IAsyncResult asyncResult = this._invoke.BeginInvoke(new BindingListInvoked.ListChangedDelegate(base.OnListChanged), new object[] + { + e + }); + } + else + { + base.OnListChanged(e); + } + } + + // Token: 0x1700001B RID: 27 + // (get) Token: 0x060000A8 RID: 168 RVA: 0x00007678 File Offset: 0x00005878 + // (set) Token: 0x060000A9 RID: 169 RVA: 0x0000768C File Offset: 0x0000588C + public IList DataSource + { + get + { + return this; + } + set + { + bool flag = value != null; + if (flag) + { + this.ClearItems(); + base.RaiseListChangedEvents = false; + foreach (T item in value) + { + base.Add(item); + } + base.RaiseListChangedEvents = true; + this.OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); + } + } + } + + // Token: 0x0400006A RID: 106 + private ISynchronizeInvoke _invoke; + + // Token: 0x0200003A RID: 58 + // (Invoke) Token: 0x0600020A RID: 522 + private delegate void ListChangedDelegate(ListChangedEventArgs e); + } +} diff --git a/Classes/DataAccess/Alert.cs b/Classes/DataAccess/Alert.cs new file mode 100644 index 0000000..5e80584 --- /dev/null +++ b/Classes/DataAccess/Alert.cs @@ -0,0 +1,305 @@ +using System; +using System.ComponentModel; +using System.Data.Linq.Mapping; +using System.Diagnostics; + +namespace iMonitorApp.Classes.DataAccess +{ + // Token: 0x0200002D RID: 45 + [Table(Name = "dbo.tblAlerts")] + public class Alert : INotifyPropertyChanging, INotifyPropertyChanged + { + // Token: 0x17000072 RID: 114 + // (get) Token: 0x060001C6 RID: 454 RVA: 0x0000F294 File Offset: 0x0000D494 + // (set) Token: 0x060001C7 RID: 455 RVA: 0x0000F2AC File Offset: 0x0000D4AC + [Column(Storage = "_Instrument", DbType = "VarChar(50) NOT NULL", CanBeNull = false, IsPrimaryKey = true)] + public string Instrument + { + get + { + return this._Instrument; + } + set + { + bool flag = this._Instrument != value; + if (flag) + { + this.SendPropertyChanging(); + this._Instrument = value; + this.SendPropertyChanged("Instrument"); + } + } + } + + // Token: 0x17000073 RID: 115 + // (get) Token: 0x060001C8 RID: 456 RVA: 0x0000F2E8 File Offset: 0x0000D4E8 + // (set) Token: 0x060001C9 RID: 457 RVA: 0x0000F300 File Offset: 0x0000D500 + [Column(Storage = "_Field", DbType = "VarChar(50) NOT NULL", CanBeNull = false, IsPrimaryKey = true)] + public string Field + { + get + { + return this._Field; + } + set + { + bool flag = this._Field != value; + if (flag) + { + this.SendPropertyChanging(); + this._Field = value; + this.SendPropertyChanged("Field"); + } + } + } + + // Token: 0x17000074 RID: 116 + // (get) Token: 0x060001CA RID: 458 RVA: 0x0000F33C File Offset: 0x0000D53C + // (set) Token: 0x060001CB RID: 459 RVA: 0x0000F354 File Offset: 0x0000D554 + [Column(Storage = "_Up", DbType = "Decimal(18,4) NOT NULL")] + public decimal Up + { + get + { + return this._Up; + } + set + { + bool flag = this._Up != value; + if (flag) + { + this.SendPropertyChanging(); + this._Up = value; + this.SendPropertyChanged("Up"); + } + } + } + + // Token: 0x17000075 RID: 117 + // (get) Token: 0x060001CC RID: 460 RVA: 0x0000F390 File Offset: 0x0000D590 + // (set) Token: 0x060001CD RID: 461 RVA: 0x0000F3A8 File Offset: 0x0000D5A8 + [Column(Storage = "_Down", DbType = "Decimal(18,4) NOT NULL")] + public decimal Down + { + get + { + return this._Down; + } + set + { + bool flag = this._Down != value; + if (flag) + { + this.SendPropertyChanging(); + this._Down = value; + this.SendPropertyChanged("Down"); + } + } + } + + // Token: 0x17000076 RID: 118 + // (get) Token: 0x060001CE RID: 462 RVA: 0x0000F3E4 File Offset: 0x0000D5E4 + // (set) Token: 0x060001CF RID: 463 RVA: 0x0000F3FC File Offset: 0x0000D5FC + [Column(Storage = "_Enabled", DbType = "Bit NOT NULL")] + public bool Enabled + { + get + { + return this._Enabled; + } + set + { + bool flag = this._Enabled != value; + if (flag) + { + this.SendPropertyChanging(); + this._Enabled = value; + this.SendPropertyChanged("Enabled"); + } + } + } + + // Token: 0x17000077 RID: 119 + // (get) Token: 0x060001D0 RID: 464 RVA: 0x0000F438 File Offset: 0x0000D638 + // (set) Token: 0x060001D1 RID: 465 RVA: 0x0000F450 File Offset: 0x0000D650 + [Column(Storage = "_Notification", DbType = "Int")] + public int? Notification + { + get + { + return this._Notification; + } + set + { + int? notification = this._Notification; + int? num = value; + bool flag = !(notification.GetValueOrDefault() == num.GetValueOrDefault() & notification != null == (num != null)); + if (flag) + { + this.SendPropertyChanging(); + this._Notification = value; + this.SendPropertyChanged("Notification"); + } + } + } + + // Token: 0x17000078 RID: 120 + // (get) Token: 0x060001D2 RID: 466 RVA: 0x0000F4AC File Offset: 0x0000D6AC + // (set) Token: 0x060001D3 RID: 467 RVA: 0x0000F4C4 File Offset: 0x0000D6C4 + [Column(Storage = "_Email", DbType = "Bit")] + public bool? Email + { + get + { + return this._Email; + } + set + { + bool? email = this._Email; + bool? flag = value; + bool flag2 = !(email.GetValueOrDefault() == flag.GetValueOrDefault() & email != null == (flag != null)); + if (flag2) + { + this.SendPropertyChanging(); + this._Email = value; + this.SendPropertyChanged("Email"); + } + } + } + + // Token: 0x17000079 RID: 121 + // (get) Token: 0x060001D4 RID: 468 RVA: 0x0000F520 File Offset: 0x0000D720 + // (set) Token: 0x060001D5 RID: 469 RVA: 0x0000F538 File Offset: 0x0000D738 + [Column(Storage = "_Phonecall", DbType = "Bit")] + public bool? Phonecall + { + get + { + return this._Phonecall; + } + set + { + bool? phonecall = this._Phonecall; + bool? flag = value; + bool flag2 = !(phonecall.GetValueOrDefault() == flag.GetValueOrDefault() & phonecall != null == (flag != null)); + if (flag2) + { + this.SendPropertyChanging(); + this._Phonecall = value; + this.SendPropertyChanged("Phonecall"); + } + } + } + + // Token: 0x1700007A RID: 122 + // (get) Token: 0x060001D6 RID: 470 RVA: 0x0000F594 File Offset: 0x0000D794 + // (set) Token: 0x060001D7 RID: 471 RVA: 0x0000F5AC File Offset: 0x0000D7AC + [Column(Storage = "_Sound", DbType = "Bit")] + public bool? Sound + { + get + { + return this._Sound; + } + set + { + bool? sound = this._Sound; + bool? flag = value; + bool flag2 = !(sound.GetValueOrDefault() == flag.GetValueOrDefault() & sound != null == (flag != null)); + if (flag2) + { + this.SendPropertyChanging(); + this._Sound = value; + this.SendPropertyChanged("Sound"); + } + } + } + + // Token: 0x1700007B RID: 123 + // (get) Token: 0x060001D8 RID: 472 RVA: 0x0000F608 File Offset: 0x0000D808 + // (set) Token: 0x060001D9 RID: 473 RVA: 0x0000F620 File Offset: 0x0000D820 + [Column(Storage = "_Themes", DbType = "VarChar(250)")] + public string Themes + { + get + { + return this._Themes; + } + set + { + bool flag = this._Themes != value; + if (flag) + { + this.SendPropertyChanging(); + this._Themes = value; + this.SendPropertyChanged("Themes"); + } + } + } + + // Token: 0x14000005 RID: 5 + // (add) Token: 0x060001DA RID: 474 RVA: 0x0000F65C File Offset: 0x0000D85C + // (remove) Token: 0x060001DB RID: 475 RVA: 0x0000F694 File Offset: 0x0000D894 + // [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public event PropertyChangingEventHandler PropertyChanging; + + // Token: 0x14000006 RID: 6 + // (add) Token: 0x060001DC RID: 476 RVA: 0x0000F6CC File Offset: 0x0000D8CC + // (remove) Token: 0x060001DD RID: 477 RVA: 0x0000F704 File Offset: 0x0000D904 + // [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public event PropertyChangedEventHandler PropertyChanged; + + // Token: 0x060001DE RID: 478 RVA: 0x0000F73C File Offset: 0x0000D93C + protected virtual void SendPropertyChanging() + { + bool flag = this.PropertyChanging != null; + if (flag) + { + this.PropertyChanging(this, Alert.emptyChangingEventArgs); + } + } + + // Token: 0x060001DF RID: 479 RVA: 0x0000F76C File Offset: 0x0000D96C + protected virtual void SendPropertyChanged(string propertyName) + { + bool flag = this.PropertyChanged != null; + if (flag) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + // Token: 0x040000EB RID: 235 + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(string.Empty); + + // Token: 0x040000EC RID: 236 + private string _Instrument; + + // Token: 0x040000ED RID: 237 + private string _Field; + + // Token: 0x040000EE RID: 238 + private decimal _Up; + + // Token: 0x040000EF RID: 239 + private decimal _Down; + + // Token: 0x040000F0 RID: 240 + private bool _Enabled; + + // Token: 0x040000F1 RID: 241 + private int? _Notification; + + // Token: 0x040000F2 RID: 242 + private bool? _Email; + + // Token: 0x040000F3 RID: 243 + private bool? _Phonecall; + + // Token: 0x040000F4 RID: 244 + private bool? _Sound; + + // Token: 0x040000F5 RID: 245 + private string _Themes; + } +} diff --git a/Classes/DataAccess/TradingReferenceDataContext.cs b/Classes/DataAccess/TradingReferenceDataContext.cs new file mode 100644 index 0000000..b6d1927 --- /dev/null +++ b/Classes/DataAccess/TradingReferenceDataContext.cs @@ -0,0 +1,51 @@ +using System; +using System.Data; +using System.Data.Linq; +using System.Data.Linq.Mapping; +using iMonitorApp.Properties; + +namespace iMonitorApp.Classes.DataAccess +{ + // Token: 0x0200002C RID: 44 + [Database(Name = "tradingRef")] + public class TradingReferenceDataContext : DataContext + { + // Token: 0x060001BE RID: 446 RVA: 0x0000F21E File Offset: 0x0000D41E + public TradingReferenceDataContext() : base(Settings.Default.tradingRefConnectionString, TradingReferenceDataContext.mappingSource) + { + } + + // Token: 0x060001BF RID: 447 RVA: 0x0000F237 File Offset: 0x0000D437 + public TradingReferenceDataContext(string connection) : base(connection, TradingReferenceDataContext.mappingSource) + { + } + + // Token: 0x060001C0 RID: 448 RVA: 0x0000F247 File Offset: 0x0000D447 + public TradingReferenceDataContext(IDbConnection connection) : base(connection, TradingReferenceDataContext.mappingSource) + { + } + + // Token: 0x060001C1 RID: 449 RVA: 0x0000F257 File Offset: 0x0000D457 + public TradingReferenceDataContext(string connection, MappingSource mappingSource) : base(connection, mappingSource) + { + } + + // Token: 0x060001C2 RID: 450 RVA: 0x0000F263 File Offset: 0x0000D463 + public TradingReferenceDataContext(IDbConnection connection, MappingSource mappingSource) : base(connection, mappingSource) + { + } + + // Token: 0x17000071 RID: 113 + // (get) Token: 0x060001C3 RID: 451 RVA: 0x0000F270 File Offset: 0x0000D470 + public Table Alerts + { + get + { + return base.GetTable(); + } + } + + // Token: 0x040000EA RID: 234 + private static MappingSource mappingSource = new AttributeMappingSource(); + } +} diff --git a/Classes/ExternalPhoneCalls.cs b/Classes/ExternalPhoneCalls.cs new file mode 100644 index 0000000..72a8d6d --- /dev/null +++ b/Classes/ExternalPhoneCalls.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using iMonitorApp.Properties; +using MySql.Data.MySqlClient; + +namespace iMonitorApp.Classes +{ + // Token: 0x02000026 RID: 38 + public class ExternalPhoneCalls + { + // Token: 0x060001A6 RID: 422 RVA: 0x0000CFBC File Offset: 0x0000B1BC + public static void SendPhoneCalls(BindingListInvoked li) + { + try + { + IEnumerable enumerable = from p in li + where p.Phoneit + select p; + bool flag = enumerable.Count() == 0; + if (!flag) + { + enumerable = (from t in enumerable + orderby t.ReceivingTime descending + select t).Take(Settings.Default.ExternalPhoneCallLimit); + string text = "10.153.65.44"; + string text2 = "external"; + string connectionString = string.Concat(new string[] + { + "SERVER=", + text, + ";DATABASE=", + text2, + ";UID=mktData;PASSWORD=yVayWrqT5Tjce3Nt;" + }); + MySqlConnection mySqlConnection = new MySqlConnection(connectionString); + mySqlConnection.Open(); + string text3 = "DELETE FROM phonecalls"; + MySqlCommand mySqlCommand = new MySqlCommand(text3, mySqlConnection); + mySqlCommand.ExecuteNonQuery(); + text3 = "INSERT INTO phonecalls(alarmtext,call_time) VALUES "; + string text4 = ""; + foreach (ParseStackAlarms parseStackAlarms in enumerable) + { + text4 = string.Concat(new string[] + { + text4, + "('", + parseStackAlarms.Subject, + "','", + parseStackAlarms.ReceivingTime.ToString("yyyy-MM-dd HH:mm:ss"), + "')," + }); + } + text4 = text4.Substring(0, text4.Length - 1); + mySqlCommand = new MySqlCommand(text3 + text4, mySqlConnection); + mySqlCommand.ExecuteNonQuery(); + mySqlConnection.Close(); + } + } + catch + { + } + } + } +} diff --git a/Classes/Fixings.cs b/Classes/Fixings.cs new file mode 100644 index 0000000..49752d9 --- /dev/null +++ b/Classes/Fixings.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using TradingLib; + +namespace iMonitorApp.Classes +{ + // Token: 0x02000027 RID: 39 + public class Fixings + { + // Token: 0x060001A8 RID: 424 RVA: 0x0000D198 File Offset: 0x0000B398 + public Fixings() + { + bool flag = this.commodityNames == null || this.commodityNames.Keys.Count == 0; + if (flag) + { + this.commodityNames = this.GetFullNames(); + } + this.fixings = new Dictionary>(); + } + + // Token: 0x060001A9 RID: 425 RVA: 0x0000D1E8 File Offset: 0x0000B3E8 + public void GetFixings(string account = "EE02") + { + string selectCommandText = string.Concat(new string[] + { + "SELECT * FROM iTools_commodity_fixings_", + account, + " WHERE tablerownames IN (SELECT researchTicker FROM tradingRef..CommodityMappingStrategies WHERE tradingRef.dbo.CommodityMappingStrategies.initAlloc<>0 AND tradingRef.dbo.CommodityMappingStrategies.strategy = (SELECT strategy from tradingRef..tblStrategyAccountMapping WHERE tradingRef..tblStrategyAccountMapping.account='", + account, + "'))" + }); + SqlConnection sqlConnection = new SqlConnection("server=4ecapsvsg1\\;Initial Catalog=customRef;User ID=dbuser;Password=dbuser;"); + sqlConnection.Open(); + DataTable dataTable = new DataTable(); + SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommandText, sqlConnection); + sqlDataAdapter.Fill(dataTable); + foreach (object obj in dataTable.Rows) + { + DataRow dataRow = (DataRow)obj; + DateTime key = Convert.ToDateTime(dataRow["timeFixing"]); + List list = new List(); + List list2 = new List(); + for (int i = 0; i < 5; i++) + { + bool flag = dataRow.Table.Columns.Contains("Contract" + (i + 1).ToString()); + if (!flag) + { + break; + } + bool flag2 = dataRow["Contract" + (i + 1).ToString()].ToString() != ""; + if (!flag2) + { + break; + } + list.Add(dataRow["Contract" + (i + 1).ToString()].ToString()); + } + foreach (string ins in list) + { + Contract contract = new Contract(ins); + try + { + bool flag3 = !list2.Contains(this.commodityNames[contract.Commodity].ToString()); + if (flag3) + { + list2.Add(this.commodityNames[contract.Commodity].ToString()); + } + } + catch + { + } + } + bool flag4 = this.fixings.ContainsKey(key); + if (flag4) + { + this.fixings[key].AddRange(list2); + this.fixings[key] = this.fixings[key].Distinct().ToList(); + } + else + { + this.fixings.Add(key, list2); + } + } + sqlConnection.Close(); + } + + // Token: 0x060001AA RID: 426 RVA: 0x0000D4A8 File Offset: 0x0000B6A8 + public Hashtable GetFullNames() + { + SqlConnection sqlConnection = new SqlConnection("server=4ecapsvsg1\\;Initial Catalog=tradingRef;User ID=dbuser;Password=dbuser;"); + sqlConnection.Open(); + DataTable dataTable = new DataTable(); + string selectCommandText = "SELECT commodity,name from commodityRef"; + SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommandText, sqlConnection); + sqlDataAdapter.Fill(dataTable); + Hashtable hashtable = new Hashtable(); + foreach (object obj in dataTable.Rows) + { + DataRow dataRow = (DataRow)obj; + hashtable.Add(dataRow["commodity"], dataRow["name"]); + } + sqlConnection.Close(); + return hashtable; + } + + // Token: 0x040000E6 RID: 230 + public Dictionary> fixings; + + // Token: 0x040000E7 RID: 231 + public Hashtable commodityNames; + } +} diff --git a/Classes/MSMQ.cs b/Classes/MSMQ.cs new file mode 100644 index 0000000..c0b3666 --- /dev/null +++ b/Classes/MSMQ.cs @@ -0,0 +1,30 @@ +using System; +using System.Messaging; + +namespace iMonitorApp.Classes +{ + // Token: 0x02000028 RID: 40 + public class MSMQ + { + // Token: 0x060001AB RID: 427 RVA: 0x0000D56C File Offset: 0x0000B76C + public MSMQ() + { + string path = ".\\private$\\iMonitorQueue"; + bool flag = !MessageQueue.Exists(path); + MessageQueue messageQueue; + if (flag) + { + messageQueue = MessageQueue.Create(path); + } + else + { + messageQueue = new MessageQueue(path); + } + DateTime now = DateTime.Now; + ParseStackAlarms parseStackAlarms = new ParseStackAlarms("test"); + Console.WriteLine("Message to send: " + now.ToString()); + Message message = new Message(parseStackAlarms, new XmlMessageFormatter()); + messageQueue.Send(parseStackAlarms, "StackAlarm"); + } + } +} diff --git a/Classes/PhoneScheduleCheck.cs b/Classes/PhoneScheduleCheck.cs new file mode 100644 index 0000000..fb2aca7 --- /dev/null +++ b/Classes/PhoneScheduleCheck.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using iMonitorApp.Properties; + +namespace iMonitorApp.Classes +{ + // Token: 0x02000029 RID: 41 + public class PhoneScheduleCheck + { + // Token: 0x060001AC RID: 428 RVA: 0x0000D5E8 File Offset: 0x0000B7E8 + public static bool IsPhoneActive() + { + return PhoneScheduleCheck.IsPhoneActive(DateTime.Now); + } + + // Token: 0x060001AD RID: 429 RVA: 0x0000D604 File Offset: 0x0000B804 + public static bool IsPhoneActive(DateTime currentTime) + { + string text = Settings.Default["Phone" + currentTime.Date.DayOfWeek.ToString() + "Time"].ToString(); + List list = text.Split(new char[] + { + ',' + }).ToList(); + foreach (string text2 in list) + { + string text3 = text2.Replace("(", "").Replace(")", ""); + string[] array = text3.Split(new char[] + { + '-' + }); + DateTime t = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, Convert.ToInt32(array[0].Trim().Substring(0, 2)), Convert.ToInt32(array[0].Trim().Substring(2)), 0); + DateTime t2 = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, Convert.ToInt32(array[1].Trim().Substring(0, 2)), Convert.ToInt32(array[1].Trim().Substring(2)), 59); + bool flag = currentTime >= t && currentTime <= t2; + if (flag) + { + return true; + } + } + return false; + } + + // Token: 0x060001AE RID: 430 RVA: 0x0000D7A4 File Offset: 0x0000B9A4 + public static bool CheckSyntax(DayOfWeek day) + { + bool result; + try + { + string text = Settings.Default["Phone" + day.ToString() + "Time"].ToString(); + List list = text.Split(new char[] + { + ',' + }).ToList(); + foreach (string text2 in list) + { + string text3 = text2.Trim().Replace("(", "").Replace(")", ""); + string[] array = text3.Trim().Split(new char[] + { + '-' + }); + DateTime dateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, Convert.ToInt32(array[0].Trim().Substring(0, 2)), Convert.ToInt32(array[0].Trim().Substring(2)), 0); + DateTime dateTime2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, Convert.ToInt32(array[1].Trim().Substring(0, 2)), Convert.ToInt32(array[1].Trim().Substring(2)), 59); + } + result = true; + } + catch + { + result = false; + } + return result; + } + } +} diff --git a/Classes/TOM.cs b/Classes/TOM.cs new file mode 100644 index 0000000..8a5e302 --- /dev/null +++ b/Classes/TOM.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace iMonitorApp.Classes +{ + // Token: 0x0200002A RID: 42 + public class TOM + { + // Token: 0x060001B0 RID: 432 RVA: 0x0000D964 File Offset: 0x0000BB64 + public static string GetUsersPerTheme(string themes) + { + List list = (from t in themes.Split(new char[] + { + ',' + }).ToList() + select t.Trim()).ToList(); + string selectCommandText = "SELECT * from tblTeamOrganization2"; + SqlConnection sqlConnection = new SqlConnection("server=10.153.64.3\\;Initial Catalog=infrastructure;User ID=dbuser;Password=dbuser;"); + sqlConnection.Open(); + DataTable dataTable = new DataTable(); + SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommandText, sqlConnection); + sqlDataAdapter.Fill(dataTable); + sqlConnection.Close(); + List list2 = new List(); + foreach (string text in list) + { + bool flag = !dataTable.Columns.Contains(text); + if (flag) + { + return ""; + } + foreach (object obj in dataTable.Rows) + { + DataRow dataRow = (DataRow)obj; + bool flag2 = dataRow[text] != null && dataRow[text].ToString() != ""; + if (flag2) + { + list2.Add(dataRow["user"].ToString() + "@4ecap.com"); + } + } + } + return string.Join(",", list2.Distinct().ToList()); + } + + // Token: 0x060001B1 RID: 433 RVA: 0x0000DB10 File Offset: 0x0000BD10 + public static List GetUsersPerThemeList(string themes) + { + List list = (from t in themes.Split(new char[] + { + ',' + }).ToList() + select t.Trim()).ToList(); + string selectCommandText = "SELECT * from tblTeamOrganization2"; + SqlConnection sqlConnection = new SqlConnection("server=10.153.64.3\\;Initial Catalog=infrastructure;User ID=dbuser;Password=dbuser;"); + sqlConnection.Open(); + DataTable dataTable = new DataTable(); + SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommandText, sqlConnection); + sqlDataAdapter.Fill(dataTable); + sqlConnection.Close(); + List list2 = new List(); + foreach (string text in list) + { + bool flag = !dataTable.Columns.Contains(text); + if (flag) + { + return new List(); + } + foreach (object obj in dataTable.Rows) + { + DataRow dataRow = (DataRow)obj; + bool flag2 = dataRow[text] != null && dataRow[text].ToString() != ""; + if (flag2) + { + list2.Add(dataRow["user"].ToString() + "@4ecap.com"); + } + } + } + return list2.Distinct().ToList(); + } + + // Token: 0x060001B2 RID: 434 RVA: 0x0000DCB4 File Offset: 0x0000BEB4 + public static string GetPhoneNumbersPerTheme(string themes) + { + List usersPerThemeList = TOM.GetUsersPerThemeList(themes); + string selectCommandText = "SELECT * from tblContactDetails"; + SqlConnection sqlConnection = new SqlConnection("server=10.153.64.3\\;Initial Catalog=infrastructure;User ID=dbuser;Password=dbuser;"); + sqlConnection.Open(); + DataTable dataTable = new DataTable(); + SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommandText, sqlConnection); + sqlDataAdapter.Fill(dataTable); + sqlConnection.Close(); + List list = new List(); + foreach (object obj in dataTable.Rows) + { + DataRow dataRow = (DataRow)obj; + bool flag = usersPerThemeList.Contains(dataRow["username"].ToString() + "@4ecap.com"); + if (flag) + { + list.Add(dataRow["phonenumber"].ToString()); + } + } + return string.Join(",", list.Distinct().ToList()); + } + } +} diff --git a/Classes/TradeAlerts.cs b/Classes/TradeAlerts.cs new file mode 100644 index 0000000..c4776ee --- /dev/null +++ b/Classes/TradeAlerts.cs @@ -0,0 +1,419 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Data.Linq; +using DataAccessLayer.MySql; +using DataAccessLayer.TradingDB; +using DataAccessLayer.Utils; +using iMonitorAPI; +using iMonitorApp.Properties; +using TradingReference.DAL; + +namespace iMonitorApp.Classes +{ + // Token: 0x0200002B RID: 43 + public class TradeAlerts + { + // Token: 0x060001B5 RID: 437 RVA: 0x0000DDB4 File Offset: 0x0000BFB4 + public static string CheckNewOrders() + { + string result; + try + { + string text = "New Orders OK"; + IQueryable source = from p in new TradingDataClassesDataContext + { + CommandTimeout = 5 + }.DBTrades + where p.source == "ORDERS" && p.cdateonly == (DateTime?)DateTime.Now.AddHours(-7.0).Date + select p; + string[] array = Settings.Default.StatusKeywordsNewOrders.Split(new char[] + { + ',' + }); + for (int i = 0; i < array.Length; i++) + { + string item = array[i]; + bool flag = !TradeAlerts.dick_new_orders.ContainsKey(item); + if (flag) + { + TradeAlerts.dick_new_orders.Add(item, 0); + } + int num = (from t in source + where t.status.ToUpper().Contains(item.Trim().ToUpper()) && !t.status.Contains("NEWEDGE") + select t).Count(); + bool flag2 = num > 0; + if (flag2) + { + bool email = false; + string phone = "FALSE"; + TradeAlerts.dick_new_orders[item] = TradeAlerts.dick_new_orders[item] + 1; + bool flag3 = TradeAlerts.dick_new_orders[item] > Settings.Default.TradeEmailCounter; + if (flag3) + { + email = true; + bool flag4 = item == "PENDING"; + if (flag4) + { + phone = "AUTO-h"; + } + } + iMonitor.SendAlarm(num.ToString() + " " + item + " orders in i-Trade", new List + { + "etrading" + }, "", "l", true, email, phone, 5, 15, "http://10.153.64.31:5001/iMonitor/Responder.aspx"); + } + else + { + TradeAlerts.dick_new_orders[item] = 0; + } + } + result = text; + } + catch (Exception ex) + { + result = "Error: " + ex.Message; + } + return result; + } + + // Token: 0x060001B6 RID: 438 RVA: 0x0000E190 File Offset: 0x0000C390 + public static string CheckWorkingOrders() + { + return TradeAlerts.CheckWorkingOrders2(); + } + + // Token: 0x060001B7 RID: 439 RVA: 0x0000E1A8 File Offset: 0x0000C3A8 + public static string CheckWorkingOrders2() + { + bool flag = TradeAlerts.IsWeekend(); + string result; + if (flag) + { + result = "Working Orders-Weekend"; + } + else + { + try + { + IQueryable source = from p in new TradingDBDataContext + { + CommandTimeout = 10 + }.DBTrades + where p.source == "ORDERS" && p.status.Contains("WORKING") && p.cdateonly == (DateTime?)DateTime.Now.AddHours(-7.0).Date + select p; + string text = "No orders Disabled."; + string[] array = Settings.Default.StatusKeywordsWorkingOrders.Split(new char[] + { + ',' + }); + for (int i = 0; i < array.Length; i++) + { + string item = array[i]; + bool flag2 = !TradeAlerts.dick_working_orders2.ContainsKey(item); + if (flag2) + { + TradeAlerts.dick_working_orders2.Add(item, 0); + } + int num = (from t in source + where t.validity.ToUpper().Contains(item.Trim().ToUpper()) + select t).Count(); + bool flag3 = num > 0; + if (flag3) + { + bool email = false; + string phone = "FALSE"; + string overridealarmlevel = "l"; + TradeAlerts.dick_working_orders2[item] = TradeAlerts.dick_working_orders2[item] + 1; + bool flag4 = TradeAlerts.dick_working_orders2[item] >= Convert.ToInt32(Settings.Default[item + "EmailCounter"]); + if (flag4) + { + email = true; + } + bool flag5 = TradeAlerts.dick_working_orders2[item] >= Convert.ToInt32(Settings.Default[item + "PhoneCounter"]); + if (flag5) + { + phone = "TRUE"; + } + bool flag6 = TradeAlerts.dick_working_orders2[item] >= Convert.ToInt32(Settings.Default[item + "EscalationCounter"]); + if (flag6) + { + overridealarmlevel = "m"; + } + bool flag7 = TradeAlerts.dick_working_orders2[item] >= 2 * Convert.ToInt32(Settings.Default[item + "EscalationCounter"]); + if (flag7) + { + overridealarmlevel = "h"; + } + string text2 = ""; + List list = new List(); + foreach (TradingReference.DAL.DBTrade dbtrade in from t in source + where t.validity.ToUpper().Contains(item.Trim().ToUpper()) + select t) + { + text2 = string.Concat(new string[] + { + text2, + "Contract: ", + dbtrade.contract, + " Strategy: ", + dbtrade.strategy, + " Account: ", + dbtrade.account, + " Basket: ", + dbtrade.high_low_price, + "
" + }); + list.Add(dbtrade.high_low_price); + } + iMonitor.SendAlarm(string.Concat(new string[] + { + num.ToString(), + " Orders are ", + item, + " on ", + string.Join(",", list.Distinct().ToList()) + }), new List + { + "etrading" + }, "", overridealarmlevel, true, email, phone, 5, 15, "http://10.153.64.31:5001/iMonitor/Responder.aspx"); + text = num.ToString() + " Working Orders are " + item; + } + else + { + TradeAlerts.dick_working_orders2[item] = 0; + } + } + result = text; + } + catch (Exception ex) + { + result = "Error: " + ex.Message; + } + } + return result; + } + + // Token: 0x060001B8 RID: 440 RVA: 0x0000E84C File Offset: 0x0000CA4C + public static string CheckOutbox() + { + bool flag = TradeAlerts.IsWeekend(); + string result; + if (flag) + { + result = "Order Outbox-Weekend"; + } + else + { + try + { + IQueryable source = from p in new TradingDataClassesDataContext + { + CommandTimeout = 10 + }.Outboxes + where p.createdOn >= (DateTime?)DateTime.Now.AddHours(-7.0).Date && (!p.isSent.HasValue || !p.isSent.Value) + select p; + bool flag2 = source.Count() > 0; + if (flag2) + { + iMonitor.SendAlarm(source.Count().ToString() + " Unsent emails in the outbox.", new List + { + "etrading" + }, "", "NULL", true, true, "AUTO-m", 5, 15, "http://10.153.64.31:5001/iMonitor/Responder.aspx"); + } + result = "No Emails in Outbox"; + } + catch (Exception ex) + { + result = "Error: " + ex.Message; + } + } + return result; + } + + // Token: 0x060001B9 RID: 441 RVA: 0x0000EA58 File Offset: 0x0000CC58 + public static string CheckDataRecorders() + { + bool flag = TradeAlerts.IsWeekend(); + string result; + if (flag) + { + result = "Data Recorders-Weekend"; + } + else + { + string text = ""; + bool flag2 = false; + try + { + ConnectionHandler connectionHandler = new ConnectionHandler(Settings.Default.IntradayDatabaseName, Settings.Default.IntradayDatabase); + connectionHandler.Open(); + bool flag3 = !DataLogger.IsAlive(connectionHandler, TimeSpan.FromMinutes(Settings.Default.DataRecorderLatencyMinutes), Settings.Default.PrimaryDataRecorder); + if (flag3) + { + string alarmXML = ParseStackAlarms.GetAlarmXML("Primary Data Recorder not working", new List + { + "mktdata" + }, "", "NULL", true, true, "AUTO-h", 20, 60, "http://4ecappcsg11:5001/Convertor.aspx"); + ParseStackAlarms parseStackAlarms = new ParseStackAlarms(alarmXML); + parseStackAlarms.Process(); + text = " Primary "; + flag2 = true; + } + bool flag4 = !DataLogger.IsAlive(connectionHandler, TimeSpan.FromMinutes(Settings.Default.DataRecorderLatencyMinutes), Settings.Default.SecondaryDataRecorder); + if (flag4) + { + string alarmXML2 = ParseStackAlarms.GetAlarmXML("Secondary Data Recorder not working", new List + { + "mktdata" + }, "", "NULL", true, true, "FALSE", 20, 60, "http://4ecappcsg11:5001/Convertor.aspx"); + ParseStackAlarms parseStackAlarms2 = new ParseStackAlarms(alarmXML2); + parseStackAlarms2.Process(); + text += " Secondary "; + flag2 = true; + } + connectionHandler.Close(); + bool flag5 = flag2; + if (flag5) + { + result = text.Trim() + " Data Recorders not working"; + } + else + { + result = "Data Recorders OK"; + } + } + catch (Exception ex) + { + result = "Error Checking DataRecorder Activity:" + ex.Message; + } + } + return result; + } + + // Token: 0x060001BA RID: 442 RVA: 0x0000EC00 File Offset: 0x0000CE00 + public static string CheckBaskets() + { + bool flag = TradeAlerts.IsWeekend(); + string result; + if (flag) + { + result = "Basket Check-Weekend"; + } + else + { + try + { + Dictionary basketListComplete = Baskets.GetBasketListComplete(); + List list = new List(); + double num = 0.0; + foreach (BasketConfig basketConfig in basketListComplete.Keys) + { + bool flag2 = basketConfig.enabled != null; + if (flag2) + { + bool value = basketConfig.enabled.Value; + if (value) + { + TimeSpan timeSpan = DateTime.Now - basketConfig.heartbeat.Value; + bool flag3 = timeSpan.TotalMinutes > Settings.Default.BasketSyncThresholdMinutes; + if (flag3) + { + list.Add(basketConfig.name); + bool flag4 = num < timeSpan.TotalMinutes; + if (flag4) + { + num = timeSpan.TotalMinutes; + } + } + } + } + } + bool flag5 = list.Count > 0; + if (flag5) + { + iMonitor.SendAlarm(string.Concat(new string[] + { + "Baskets ", + string.Join(",", list), + " is not enabled for the last ", + Settings.Default.BasketSyncThresholdMinutes.ToString(), + " minutes" + }), new List + { + "etrading" + }, "Not enabled for the last " + num.ToString() + " minutes", "NULL", true, true, "AUTO-h", 10, 20, "http://10.153.64.31:5001/iMonitor/Responder.aspx"); + result = string.Join(",", list); + } + else + { + result = "Baskets OK."; + } + } + catch (Exception ex) + { + result = "Error: " + ex.Message; + } + } + return result; + } + + // Token: 0x060001BB RID: 443 RVA: 0x0000EE04 File Offset: 0x0000D004 + public static string CheckGun() + { + string result; + try + { + IQueryable queryable = from p in new TradingDataClassesDataContext + { + CommandTimeout = 5 + }.DBTrades + where p.source == "ORDERS" && p.cdateonly == (DateTime?)DateTime.Now.AddHours(-7.0).Date && (p.status.ToLower().Contains("w automate") || p.status.ToLower().Contains("working fidessa")) && Math.Abs(p.qty) <= 1m + select p; + List list = (from t in Settings.Default.EmptyGunStrategues.Split(new char[] + { + ',' + }) + select t.Trim()).ToList(); + foreach (DataAccessLayer.TradingDB.DBTrade dbtrade in queryable) + { + bool flag = list.Contains(dbtrade.tblAllOrders.order1); + if (flag) + { + string subject = string.Concat(new string[] + { + "Attention! Please fill the gun for ", + dbtrade.contract, + " strategy ", + dbtrade.tblAllOrders.order1, + " account ", + dbtrade.account + }); + iMonitor.SendAlarm(subject, new List + { + "etrading" + }, "", "l", true, true, "TRUE", 10, 20, "http://10.153.64.31:5001/iMonitor/Responder.aspx"); + } + } + result = "Check Gun OK."; + } + catch (Exception ex) + { + result = "Error: " + ex.Message; + } + return result; + } + + // Token: 0x060001BC RID: 444 RVA: 0x0000F1A8 File Offset: 0x0000D3A8 + public static bool IsWeekend() + { + return DateTime.Now.AddHours(-7.0).DayOfWeek == DayOfWeek.Saturday || DateTime.Now.AddHours(-7.0).DayOfWeek == DayOfWeek.Sunday; + } + + // Token: 0x040000E8 RID: 232 + private static Dictionary dick_new_orders = new Dictionary(); + + // Token: 0x040000E9 RID: 233 + private static Dictionary dick_working_orders2 = new Dictionary(); + } +} diff --git a/Config.cs b/Config.cs new file mode 100644 index 0000000..958305d --- /dev/null +++ b/Config.cs @@ -0,0 +1,32 @@ +using System; +using System.Net; +using System.Net.Sockets; + +namespace iMonitorApp +{ + // Token: 0x02000003 RID: 3 + public class Config + { + // Token: 0x0600000C RID: 12 RVA: 0x00002AB8 File Offset: 0x00000CB8 + public static string GetIP4Address() + { + string result = string.Empty; + foreach (IPAddress ipaddress in Dns.GetHostAddresses(Dns.GetHostName())) + { + bool flag = ipaddress.AddressFamily == AddressFamily.InterNetwork; + if (flag) + { + result = ipaddress.ToString(); + break; + } + } + return result; + } + + // Token: 0x0600000D RID: 13 RVA: 0x00002B0C File Offset: 0x00000D0C + public static int GetPortNumber() + { + return 5659; + } + } +} diff --git a/DashBoard.Designer.cs b/DashBoard.Designer.cs new file mode 100644 index 0000000..af6f29a --- /dev/null +++ b/DashBoard.Designer.cs @@ -0,0 +1,260 @@ +namespace iMonitorApp +{ + // Token: 0x0200000C RID: 12 + public partial class DashBoard : global::System.Windows.Forms.Form + { + // Token: 0x06000063 RID: 99 RVA: 0x0000410C File Offset: 0x0000230C + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x06000064 RID: 100 RVA: 0x00004144 File Offset: 0x00002344 + private void InitializeComponent() + { + global::System.ComponentModel.ComponentResourceManager componentResourceManager = new global::System.ComponentModel.ComponentResourceManager(typeof(global::iMonitorApp.DashBoard)); + this.groupBox1 = new global::System.Windows.Forms.GroupBox(); + this.groupBox2 = new global::System.Windows.Forms.GroupBox(); + this.lbl_server_received = new global::System.Windows.Forms.Label(); + this.lbl_call_status = new global::System.Windows.Forms.Label(); + this.lbl_skype_status = new global::System.Windows.Forms.Label(); + this.lbl_check_skype = new global::System.Windows.Forms.Label(); + this.pictureBox1 = new global::System.Windows.Forms.PictureBox(); + this.groupBox3 = new global::System.Windows.Forms.GroupBox(); + this.groupBox4 = new global::System.Windows.Forms.GroupBox(); + this.lbl_phone_finished = new global::System.Windows.Forms.Label(); + this.lbl_phone_working = new global::System.Windows.Forms.Label(); + this.lbl_phone_queued = new global::System.Windows.Forms.Label(); + this.btn_check_baskets = new global::System.Windows.Forms.Button(); + this.btn_check_outbox = new global::System.Windows.Forms.Button(); + this.btn_checkGun = new global::System.Windows.Forms.Button(); + this.btn_check_new_orders = new global::System.Windows.Forms.Button(); + this.btn_check_working_orders = new global::System.Windows.Forms.Button(); + this.btn_check_data_recorders = new global::System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + ((global::System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit(); + base.SuspendLayout(); + this.groupBox1.Controls.Add(this.btn_check_data_recorders); + this.groupBox1.Controls.Add(this.btn_check_working_orders); + this.groupBox1.Controls.Add(this.btn_check_new_orders); + this.groupBox1.Controls.Add(this.btn_checkGun); + this.groupBox1.Controls.Add(this.btn_check_outbox); + this.groupBox1.Controls.Add(this.btn_check_baskets); + this.groupBox1.ForeColor = global::System.Drawing.Color.SteelBlue; + this.groupBox1.Location = new global::System.Drawing.Point(12, 25); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new global::System.Drawing.Size(280, 229); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "iTools Alarms"; + this.groupBox2.Controls.Add(this.lbl_phone_queued); + this.groupBox2.Controls.Add(this.lbl_phone_working); + this.groupBox2.Controls.Add(this.lbl_phone_finished); + this.groupBox2.Controls.Add(this.lbl_server_received); + this.groupBox2.Controls.Add(this.lbl_call_status); + this.groupBox2.Controls.Add(this.lbl_skype_status); + this.groupBox2.Controls.Add(this.lbl_check_skype); + this.groupBox2.Controls.Add(this.pictureBox1); + this.groupBox2.ForeColor = global::System.Drawing.Color.SteelBlue; + this.groupBox2.Location = new global::System.Drawing.Point(12, 260); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new global::System.Drawing.Size(280, 264); + this.groupBox2.TabIndex = 1; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Phone Dialer"; + this.lbl_server_received.AutoSize = true; + this.lbl_server_received.Font = new global::System.Drawing.Font("Consolas", 9.75f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.lbl_server_received.Location = new global::System.Drawing.Point(6, 117); + this.lbl_server_received.Name = "lbl_server_received"; + this.lbl_server_received.Size = new global::System.Drawing.Size(84, 15); + this.lbl_server_received.TabIndex = 4; + this.lbl_server_received.Text = "check skype"; + this.lbl_call_status.AutoSize = true; + this.lbl_call_status.Font = new global::System.Drawing.Font("Consolas", 9.75f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.lbl_call_status.Location = new global::System.Drawing.Point(6, 95); + this.lbl_call_status.Name = "lbl_call_status"; + this.lbl_call_status.Size = new global::System.Drawing.Size(84, 15); + this.lbl_call_status.TabIndex = 3; + this.lbl_call_status.Text = "check skype"; + this.lbl_skype_status.AutoSize = true; + this.lbl_skype_status.Font = new global::System.Drawing.Font("Consolas", 9.75f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.lbl_skype_status.Location = new global::System.Drawing.Point(6, 73); + this.lbl_skype_status.Name = "lbl_skype_status"; + this.lbl_skype_status.Size = new global::System.Drawing.Size(84, 15); + this.lbl_skype_status.TabIndex = 2; + this.lbl_skype_status.Text = "check skype"; + this.lbl_check_skype.AutoSize = true; + this.lbl_check_skype.Font = new global::System.Drawing.Font("Consolas", 9.75f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.lbl_check_skype.Location = new global::System.Drawing.Point(5, 51); + this.lbl_check_skype.Name = "lbl_check_skype"; + this.lbl_check_skype.Size = new global::System.Drawing.Size(84, 15); + this.lbl_check_skype.TabIndex = 1; + this.lbl_check_skype.Text = "check skype"; + this.pictureBox1.Image = global::iMonitorApp.Properties.Resources.loading; + this.pictureBox1.Location = new global::System.Drawing.Point(242, 11); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new global::System.Drawing.Size(32, 32); + this.pictureBox1.SizeMode = global::System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + this.groupBox3.ForeColor = global::System.Drawing.Color.SteelBlue; + this.groupBox3.Location = new global::System.Drawing.Point(737, 25); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new global::System.Drawing.Size(280, 229); + this.groupBox3.TabIndex = 1; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Market Data Alarms"; + this.groupBox4.ForeColor = global::System.Drawing.Color.SteelBlue; + this.groupBox4.Location = new global::System.Drawing.Point(737, 260); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new global::System.Drawing.Size(280, 264); + this.groupBox4.TabIndex = 2; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "Email Server"; + this.lbl_phone_finished.AutoSize = true; + this.lbl_phone_finished.Font = new global::System.Drawing.Font("Consolas", 9.75f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.lbl_phone_finished.Location = new global::System.Drawing.Point(6, 217); + this.lbl_phone_finished.Name = "lbl_phone_finished"; + this.lbl_phone_finished.Size = new global::System.Drawing.Size(84, 15); + this.lbl_phone_finished.TabIndex = 5; + this.lbl_phone_finished.Text = "check skype"; + this.lbl_phone_working.AutoSize = true; + this.lbl_phone_working.Font = new global::System.Drawing.Font("Consolas", 9.75f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.lbl_phone_working.Location = new global::System.Drawing.Point(6, 239); + this.lbl_phone_working.Name = "lbl_phone_working"; + this.lbl_phone_working.Size = new global::System.Drawing.Size(84, 15); + this.lbl_phone_working.TabIndex = 6; + this.lbl_phone_working.Text = "check skype"; + this.lbl_phone_queued.AutoSize = true; + this.lbl_phone_queued.Font = new global::System.Drawing.Font("Consolas", 9.75f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.lbl_phone_queued.Location = new global::System.Drawing.Point(6, 195); + this.lbl_phone_queued.Name = "lbl_phone_queued"; + this.lbl_phone_queued.Size = new global::System.Drawing.Size(84, 15); + this.lbl_phone_queued.TabIndex = 7; + this.lbl_phone_queued.Text = "check skype"; + this.btn_check_baskets.Location = new global::System.Drawing.Point(19, 43); + this.btn_check_baskets.Name = "btn_check_baskets"; + this.btn_check_baskets.Size = new global::System.Drawing.Size(238, 23); + this.btn_check_baskets.TabIndex = 0; + this.btn_check_baskets.Text = "Check Baskets"; + this.btn_check_baskets.UseVisualStyleBackColor = true; + this.btn_check_baskets.Click += new global::System.EventHandler(this.btn_check_baskets_Click); + this.btn_check_outbox.Location = new global::System.Drawing.Point(19, 72); + this.btn_check_outbox.Name = "btn_check_outbox"; + this.btn_check_outbox.Size = new global::System.Drawing.Size(238, 23); + this.btn_check_outbox.TabIndex = 0; + this.btn_check_outbox.Text = "Check Outbox"; + this.btn_check_outbox.UseVisualStyleBackColor = true; + this.btn_check_outbox.Click += new global::System.EventHandler(this.btn_check_outbox_Click); + this.btn_checkGun.Location = new global::System.Drawing.Point(19, 101); + this.btn_checkGun.Name = "btn_checkGun"; + this.btn_checkGun.Size = new global::System.Drawing.Size(238, 23); + this.btn_checkGun.TabIndex = 0; + this.btn_checkGun.Text = "Check Gun"; + this.btn_checkGun.UseVisualStyleBackColor = true; + this.btn_check_new_orders.Location = new global::System.Drawing.Point(19, 130); + this.btn_check_new_orders.Name = "btn_check_new_orders"; + this.btn_check_new_orders.Size = new global::System.Drawing.Size(238, 23); + this.btn_check_new_orders.TabIndex = 0; + this.btn_check_new_orders.Text = "Check New Orders"; + this.btn_check_new_orders.UseVisualStyleBackColor = true; + this.btn_check_working_orders.Location = new global::System.Drawing.Point(19, 159); + this.btn_check_working_orders.Name = "btn_check_working_orders"; + this.btn_check_working_orders.Size = new global::System.Drawing.Size(238, 23); + this.btn_check_working_orders.TabIndex = 0; + this.btn_check_working_orders.Text = "Check Working Orders"; + this.btn_check_working_orders.UseVisualStyleBackColor = true; + this.btn_check_data_recorders.Location = new global::System.Drawing.Point(19, 188); + this.btn_check_data_recorders.Name = "btn_check_data_recorders"; + this.btn_check_data_recorders.Size = new global::System.Drawing.Size(238, 23); + this.btn_check_data_recorders.TabIndex = 0; + this.btn_check_data_recorders.Text = "Check Data Recorders"; + this.btn_check_data_recorders.UseVisualStyleBackColor = true; + base.AutoScaleDimensions = new global::System.Drawing.SizeF(7f, 14f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = global::System.Drawing.Color.White; + this.BackgroundImage = (global::System.Drawing.Image)componentResourceManager.GetObject("$this.BackgroundImage"); + this.BackgroundImageLayout = global::System.Windows.Forms.ImageLayout.Center; + base.ClientSize = new global::System.Drawing.Size(1029, 536); + base.Controls.Add(this.groupBox4); + base.Controls.Add(this.groupBox3); + base.Controls.Add(this.groupBox2); + base.Controls.Add(this.groupBox1); + this.DoubleBuffered = true; + this.Font = new global::System.Drawing.Font("Consolas", 9f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.ForeColor = global::System.Drawing.Color.Gold; + base.Icon = (global::System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon"); + base.Name = "DashBoard"; + this.Text = "iMonitor"; + base.Load += new global::System.EventHandler(this.DashBoard_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + ((global::System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit(); + base.ResumeLayout(false); + } + + // Token: 0x0400002C RID: 44 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x0400002D RID: 45 + private global::System.Windows.Forms.GroupBox groupBox1; + + // Token: 0x0400002E RID: 46 + private global::System.Windows.Forms.GroupBox groupBox2; + + // Token: 0x0400002F RID: 47 + private global::System.Windows.Forms.GroupBox groupBox3; + + // Token: 0x04000030 RID: 48 + private global::System.Windows.Forms.GroupBox groupBox4; + + // Token: 0x04000031 RID: 49 + private global::System.Windows.Forms.PictureBox pictureBox1; + + // Token: 0x04000032 RID: 50 + private global::System.Windows.Forms.Label lbl_check_skype; + + // Token: 0x04000033 RID: 51 + private global::System.Windows.Forms.Label lbl_server_received; + + // Token: 0x04000034 RID: 52 + private global::System.Windows.Forms.Label lbl_call_status; + + // Token: 0x04000035 RID: 53 + private global::System.Windows.Forms.Label lbl_skype_status; + + // Token: 0x04000036 RID: 54 + private global::System.Windows.Forms.Label lbl_phone_finished; + + // Token: 0x04000037 RID: 55 + private global::System.Windows.Forms.Label lbl_phone_queued; + + // Token: 0x04000038 RID: 56 + private global::System.Windows.Forms.Label lbl_phone_working; + + // Token: 0x04000039 RID: 57 + private global::System.Windows.Forms.Button btn_check_data_recorders; + + // Token: 0x0400003A RID: 58 + private global::System.Windows.Forms.Button btn_check_working_orders; + + // Token: 0x0400003B RID: 59 + private global::System.Windows.Forms.Button btn_check_new_orders; + + // Token: 0x0400003C RID: 60 + private global::System.Windows.Forms.Button btn_checkGun; + + // Token: 0x0400003D RID: 61 + private global::System.Windows.Forms.Button btn_check_outbox; + + // Token: 0x0400003E RID: 62 + private global::System.Windows.Forms.Button btn_check_baskets; + } +} diff --git a/DashBoard.cs b/DashBoard.cs new file mode 100644 index 0000000..425740d --- /dev/null +++ b/DashBoard.cs @@ -0,0 +1,361 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Threading; +using System.Windows.Forms; +using iMonitorApp.Classes; +using iMonitorApp.Properties; + +namespace iMonitorApp +{ + // Token: 0x0200000C RID: 12 + public partial class DashBoard : Form + { + // Token: 0x06000053 RID: 83 RVA: 0x0000382B File Offset: 0x00001A2B + public DashBoard() + { + this.InitializeComponent(); + } + + // Token: 0x06000054 RID: 84 RVA: 0x00003844 File Offset: 0x00001A44 + private void DashBoard_Load(object sender, EventArgs e) + { + new Thread(delegate() + { + this.InitializePhoneSystem(); + }).Start(); + new Thread(delegate() + { + this.InitializeTradeAlerts(); + }).Start(); + new Thread(delegate() + { + this.InitializeEmailAlerts(); + }).Start(); + new Thread(delegate() + { + this.InitializeMarketDataAlerts(); + }).Start(); + } + + // Token: 0x06000055 RID: 85 RVA: 0x000038AE File Offset: 0x00001AAE + private void InitializeMarketDataAlerts() + { + } + + // Token: 0x06000056 RID: 86 RVA: 0x000038AE File Offset: 0x00001AAE + private void InitializeEmailAlerts() + { + } + + // Token: 0x06000057 RID: 87 RVA: 0x000038B1 File Offset: 0x00001AB1 + private void InitializeTradeAlerts() + { + this._tradeTimer = new System.Threading.Timer(new TimerCallback(this.TradeAlertProc), null, 100, Settings.Default.TimerTradeChecks * 1000); + } + + // Token: 0x06000058 RID: 88 RVA: 0x000038E0 File Offset: 0x00001AE0 + private void TradeAlertProc(object state) + { + CountdownEvent countdownEvent = new CountdownEvent(5); + new Thread(delegate() + { + this.UpdateButton(this.btn_check_working_orders, TradeAlerts.CheckWorkingOrders()); + countdownEvent.Signal(); + }).Start(); + new Thread(delegate() + { + this.UpdateButton(this.btn_check_new_orders, TradeAlerts.CheckNewOrders()); + countdownEvent.Signal(); + }).Start(); + new Thread(delegate() + { + this.UpdateButton(this.btn_check_baskets, TradeAlerts.CheckBaskets()); + countdownEvent.Signal(); + }).Start(); + new Thread(delegate() + { + this.UpdateButton(this.btn_check_outbox, TradeAlerts.CheckOutbox()); + countdownEvent.Signal(); + }).Start(); + new Thread(delegate() + { + this.UpdateButton(this.btn_checkGun, TradeAlerts.CheckGun()); + countdownEvent.Signal(); + }).Start(); + countdownEvent.Wait(); + } + + // Token: 0x06000059 RID: 89 RVA: 0x00003986 File Offset: 0x00001B86 + private void btn_check_baskets_Click(object sender, EventArgs e) + { + new Thread(delegate() + { + this.UpdateButton(this.btn_check_baskets, TradeAlerts.CheckBaskets()); + }).Start(); + } + + // Token: 0x0600005A RID: 90 RVA: 0x000039A0 File Offset: 0x00001BA0 + private void InitializePhoneSystem() + { + this._phoneCallList = new ObservableCollection(); + this._phoneCallList.CollectionChanged += this._phoneCallList_CollectionChanged; + new Thread(delegate() + { + this._phoneCallListener = new AsynchronousSocketListener(Config.GetIP4Address(), Settings.Default.PhonePort); + AsynchronousSocketListener.Received += this.AsynchronousSocketListener_Received; + AsynchronousSocketListener.StartListening(); + }).Start(); + this.UpdateLabel(this.lbl_check_skype, "Checking Skype"); + this.UpdateLabel(this.lbl_skype_status, "Skype Status: Unknown"); + this.UpdateLabel(this.lbl_call_status, "Call Status: Unknown"); + this.UpdatePicture(this.pictureBox1, Resources.loading); + try + { + this.UpdateLabel(this.lbl_check_skype, "Skype Working."); + this.UpdatePicture(this.pictureBox1, Resources.Check); + } + catch + { + this.UpdateLabel(this.lbl_check_skype, "Unable to access skype"); + this.UpdatePicture(this.pictureBox1, Resources.cancel); + } + } + + // Token: 0x0600005B RID: 91 RVA: 0x00003A94 File Offset: 0x00001C94 + private void AsynchronousSocketListener_Received(object sender, EventArgs e) + { + string text = sender.ToString().Replace("", ""); + this.UpdateLabel(this.lbl_server_received, "Last Received: " + DateTime.Now.ToShortTimeString()); + List list = (from t in text.Split(new char[] + { + ',' + }).ToList() + where t.Trim() != "" + select t).ToList(); + bool flag = list.Count > 4; + if (flag) + { + this.MultiplePhones(text.Split(new char[] + { + ',' + }).ToList()); + } + else + { + PhoneCall item = new PhoneCall + { + Numbers = list, + Count = list.Count, + Status = "Queued" + }; + this._phoneCallList.Add(item); + } + } + + // Token: 0x0600005C RID: 92 RVA: 0x00003B88 File Offset: 0x00001D88 + private void MultiplePhones(List numbers) + { + try + { + int num = numbers.Count / 4; + int num2 = numbers.Count % 4; + int num3 = 0; + for (int i = 0; i < num; i++) + { + this._phoneCallList.Add(new PhoneCall + { + Numbers = numbers.Skip(num3).Take(4).ToList(), + Count = 4, + Status = "Queued" + }); + num3 += 4; + } + bool flag = num2 == 1; + if (flag) + { + this._phoneCallList.Add(new PhoneCall + { + Numbers = numbers.Skip(num3).Take(1).ToList(), + Count = 1, + Status = "Queued" + }); + } + bool flag2 = num2 == 2; + if (flag2) + { + this._phoneCallList.Add(new PhoneCall + { + Numbers = numbers.Skip(num3).Take(2).ToList(), + Count = 1, + Status = "Queued" + }); + } + bool flag3 = num2 == 3; + if (flag3) + { + this._phoneCallList.Add(new PhoneCall + { + Numbers = numbers.Skip(num3).Take(3).ToList(), + Count = 1, + Status = "Queued" + }); + } + } + catch + { + foreach (string item in numbers) + { + this._phoneCallList.Add(new PhoneCall + { + Numbers = new List + { + item + }, + Count = 1, + Status = "Queued" + }); + } + } + } + + // Token: 0x0600005D RID: 93 RVA: 0x00003D80 File Offset: 0x00001F80 + private void _phoneCallList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + this.ProcessPhoneQueue(); + } + + // Token: 0x0600005E RID: 94 RVA: 0x00003D8C File Offset: 0x00001F8C + private void ProcessPhoneQueue() + { + IEnumerable source = from p in this._phoneCallList + where p.Status == "Working" + select p; + this.UpdateLabel(this.lbl_phone_working, "Working: " + source.Count().ToString()); + IEnumerable source2 = from p in this._phoneCallList + where p.Status == "Queued" + select p; + this.UpdateLabel(this.lbl_phone_queued, "Queued: " + source2.Count().ToString()); + bool flag = source2.Count() > 0; + if (flag) + { + PhoneCall phoneCall = source2.First(); + bool flag2 = phoneCall.Count != 0; + if (flag2) + { + try + { + List list = new List(); + foreach (string text in phoneCall.Numbers) + { + list.Add(text.Replace(" ", "")); + } + try + { + } + catch + { + } + bool flag3 = !PhoneScheduleCheck.IsPhoneActive(); + if (flag3) + { + int num = 2; + int frequency = 4000; + int duration = 200; + for (int i = 0; i < num; i++) + { + Console.Beep(frequency, duration); + } + return; + } + Uri uri = new Uri("skype:" + string.Join(";", list) + "?call"); + Process.Start(uri.AbsoluteUri); + Thread.Sleep(10000); + phoneCall.Status = "Working"; + } + catch + { + } + } + } + IEnumerable source3 = from p in this._phoneCallList + where p.Status == "Finished" + select p; + this.UpdateLabel(this.lbl_phone_finished, "Finished: " + source3.Count().ToString()); + bool flag4 = source3.Count() > 0; + if (flag4) + { + } + } + + // Token: 0x0600005F RID: 95 RVA: 0x00003FEC File Offset: 0x000021EC + private void UpdatePicture(PictureBox p, Bitmap image) + { + bool invokeRequired = p.InvokeRequired; + if (invokeRequired) + { + p.Invoke(new Action(delegate() + { + p.Image = image; + })); + } + else + { + p.Image = image; + } + } + + // Token: 0x06000060 RID: 96 RVA: 0x0000404C File Offset: 0x0000224C + private void UpdateLabel(Label l, string message) + { + bool invokeRequired = l.InvokeRequired; + if (invokeRequired) + { + l.Invoke(new Action(delegate() + { + l.Text = message; + })); + } + else + { + l.Text = message; + } + } + + // Token: 0x06000061 RID: 97 RVA: 0x000040AC File Offset: 0x000022AC + private void UpdateButton(Button l, string message) + { + bool invokeRequired = l.InvokeRequired; + if (invokeRequired) + { + l.Invoke(new Action(delegate() + { + l.Text = message; + })); + } + else + { + l.Text = message; + } + } + + // Token: 0x06000062 RID: 98 RVA: 0x000038AE File Offset: 0x00001AAE + private void btn_check_outbox_Click(object sender, EventArgs e) + { + } + + // Token: 0x04000029 RID: 41 + private ObservableCollection _phoneCallList; + + // Token: 0x0400002A RID: 42 + private AsynchronousSocketListener _phoneCallListener; + + // Token: 0x0400002B RID: 43 + private System.Threading.Timer _tradeTimer; + } +} diff --git a/DashBoard.resources b/DashBoard.resources new file mode 100644 index 0000000..f39fc0f Binary files /dev/null and b/DashBoard.resources differ diff --git a/DataAlarm.cs b/DataAlarm.cs new file mode 100644 index 0000000..099fa75 --- /dev/null +++ b/DataAlarm.cs @@ -0,0 +1,160 @@ +using System; +using iMonitorApp.Classes.DataAccess; + +namespace iMonitorApp +{ + // Token: 0x02000007 RID: 7 + public class DataAlarm + { + // Token: 0x17000009 RID: 9 + // (get) Token: 0x06000020 RID: 32 RVA: 0x00002FAD File Offset: 0x000011AD + // (set) Token: 0x06000021 RID: 33 RVA: 0x00002FB5 File Offset: 0x000011B5 + public string Instrument { get; set; } + + // Token: 0x1700000A RID: 10 + // (get) Token: 0x06000022 RID: 34 RVA: 0x00002FBE File Offset: 0x000011BE + // (set) Token: 0x06000023 RID: 35 RVA: 0x00002FC6 File Offset: 0x000011C6 + public string Field { get; set; } + + // Token: 0x1700000B RID: 11 + // (get) Token: 0x06000024 RID: 36 RVA: 0x00002FCF File Offset: 0x000011CF + // (set) Token: 0x06000025 RID: 37 RVA: 0x00002FD7 File Offset: 0x000011D7 + public decimal Up { get; set; } + + // Token: 0x1700000C RID: 12 + // (get) Token: 0x06000026 RID: 38 RVA: 0x00002FE0 File Offset: 0x000011E0 + // (set) Token: 0x06000027 RID: 39 RVA: 0x00002FE8 File Offset: 0x000011E8 + public decimal Down { get; set; } + + // Token: 0x1700000D RID: 13 + // (get) Token: 0x06000028 RID: 40 RVA: 0x00002FF1 File Offset: 0x000011F1 + // (set) Token: 0x06000029 RID: 41 RVA: 0x00002FF9 File Offset: 0x000011F9 + public bool Enabled { get; set; } + + // Token: 0x1700000E RID: 14 + // (get) Token: 0x0600002A RID: 42 RVA: 0x00003002 File Offset: 0x00001202 + // (set) Token: 0x0600002B RID: 43 RVA: 0x0000300A File Offset: 0x0000120A + public int Notification { get; set; } + + // Token: 0x1700000F RID: 15 + // (get) Token: 0x0600002C RID: 44 RVA: 0x00003013 File Offset: 0x00001213 + // (set) Token: 0x0600002D RID: 45 RVA: 0x0000301B File Offset: 0x0000121B + public decimal Value { get; set; } + + // Token: 0x17000010 RID: 16 + // (get) Token: 0x0600002E RID: 46 RVA: 0x00003024 File Offset: 0x00001224 + // (set) Token: 0x0600002F RID: 47 RVA: 0x0000302C File Offset: 0x0000122C + public bool isUpDirty { get; set; } + + // Token: 0x17000011 RID: 17 + // (get) Token: 0x06000030 RID: 48 RVA: 0x00003035 File Offset: 0x00001235 + // (set) Token: 0x06000031 RID: 49 RVA: 0x0000303D File Offset: 0x0000123D + public bool isDownDirty { get; set; } + + // Token: 0x17000012 RID: 18 + // (get) Token: 0x06000032 RID: 50 RVA: 0x00003046 File Offset: 0x00001246 + // (set) Token: 0x06000033 RID: 51 RVA: 0x0000304E File Offset: 0x0000124E + public decimal[] LastFive { get; set; } + + // Token: 0x17000013 RID: 19 + // (get) Token: 0x06000034 RID: 52 RVA: 0x00003057 File Offset: 0x00001257 + // (set) Token: 0x06000035 RID: 53 RVA: 0x0000305F File Offset: 0x0000125F + public bool Phone { get; set; } + + // Token: 0x17000014 RID: 20 + // (get) Token: 0x06000036 RID: 54 RVA: 0x00003068 File Offset: 0x00001268 + // (set) Token: 0x06000037 RID: 55 RVA: 0x00003070 File Offset: 0x00001270 + public bool Email { get; set; } + + // Token: 0x17000015 RID: 21 + // (get) Token: 0x06000038 RID: 56 RVA: 0x00003079 File Offset: 0x00001279 + // (set) Token: 0x06000039 RID: 57 RVA: 0x00003081 File Offset: 0x00001281 + public bool Sound { get; set; } + + // Token: 0x17000016 RID: 22 + // (get) Token: 0x0600003A RID: 58 RVA: 0x0000308A File Offset: 0x0000128A + // (set) Token: 0x0600003B RID: 59 RVA: 0x00003092 File Offset: 0x00001292 + public string Themes { get; set; } + + // Token: 0x0600003C RID: 60 RVA: 0x00002AAD File Offset: 0x00000CAD + public DataAlarm() + { + } + + // Token: 0x0600003D RID: 61 RVA: 0x0000309C File Offset: 0x0000129C + public DataAlarm(Alert a) + { + this.Instrument = a.Instrument; + this.Field = a.Field; + this.Up = a.Up; + this.Down = a.Down; + this.Enabled = a.Enabled; + this.Notification = a.Notification.Value; + bool flag = a.Phonecall != null; + if (flag) + { + this.Phone = a.Phonecall.Value; + } + else + { + this.Phone = false; + } + bool flag2 = a.Email != null; + if (flag2) + { + this.Email = a.Email.Value; + } + bool flag3 = a.Sound != null; + if (flag3) + { + this.Sound = a.Sound.Value; + } + this.Themes = a.Themes; + } + + // Token: 0x0600003E RID: 62 RVA: 0x00003195 File Offset: 0x00001395 + public void SetValue(decimal value) + { + this.Value = value; + this.Check(); + } + + // Token: 0x0600003F RID: 63 RVA: 0x000031A7 File Offset: 0x000013A7 + public void SetValue(double value) + { + this.Value = Math.Round(Convert.ToDecimal(value), 4); + this.Check(); + } + + // Token: 0x06000040 RID: 64 RVA: 0x000031C4 File Offset: 0x000013C4 + public void Check() + { + bool flag = this.Up != 0m; + if (flag) + { + bool flag2 = this.Value >= this.Up; + if (flag2) + { + this.isUpDirty = true; + } + else + { + this.isUpDirty = false; + } + } + bool flag3 = this.Down != 0m; + if (flag3) + { + bool flag4 = this.Value <= this.Down; + if (flag4) + { + this.isDownDirty = true; + } + else + { + this.isDownDirty = false; + } + } + } + } +} diff --git a/ISendDataService.cs b/ISendDataService.cs new file mode 100644 index 0000000..6d97d31 --- /dev/null +++ b/ISendDataService.cs @@ -0,0 +1,14 @@ +using System; +using System.ServiceModel; + +namespace iMonitorApp +{ + // Token: 0x0200000D RID: 13 + [ServiceContract] + public interface ISendDataService + { + // Token: 0x0600006B RID: 107 + [OperationContract] + string helloworld(); + } +} diff --git a/IService.cs b/IService.cs new file mode 100644 index 0000000..ae36ffd --- /dev/null +++ b/IService.cs @@ -0,0 +1,14 @@ +using System; +using System.ServiceModel; + +namespace iMonitorApp +{ + // Token: 0x0200000E RID: 14 + [ServiceContract] + public interface IService + { + // Token: 0x0600006C RID: 108 + [OperationContract] + void DoWork(); + } +} diff --git a/MarketData.cs b/MarketData.cs new file mode 100644 index 0000000..50e7c47 --- /dev/null +++ b/MarketData.cs @@ -0,0 +1,44 @@ +using System; +using System.Data; +using System.Media; +using iMonitorApp.Properties; +using MySql.Data.MySqlClient; + +namespace iMonitorApp +{ + // Token: 0x02000006 RID: 6 + public class MarketData + { + // Token: 0x0600001D RID: 29 + private string GetMysqlConnString() + { + return "server=10.152.16.10;port=3304;Initial Catalog=customRef;User ID=root;Password=FOUR2008;"; + } + + // Token: 0x0600001E RID: 30 RVA: 0x00002F0C File Offset: 0x0000110C + public string CheckAlarms() + { + string result; + try + { + MySqlConnection mySqlConnection = new MySqlConnection(this.GetMysqlConnString()); + mySqlConnection.Open(); + MySqlDataAdapter mySqlDataAdapter = new MySqlDataAdapter("SELECT * from mktdata_marketdataalarms WHERE highDirty='TRUE' OR lowDirty='TRUE'", mySqlConnection); + DataTable dataTable = new DataTable(); + mySqlDataAdapter.Fill(dataTable); + bool flag = dataTable.Rows.Count > 0; + if (flag) + { + new SoundPlayer(Resources.photo).Play(); + } + mySqlConnection.Close(); + result = "MktData: OK"; + } + catch (Exception ex) + { + result = "MktData: " + ex.Message; + } + return result; + } + } +} diff --git a/Options.Designer.cs b/Options.Designer.cs new file mode 100644 index 0000000..992d62f --- /dev/null +++ b/Options.Designer.cs @@ -0,0 +1,184 @@ +namespace iMonitorApp +{ + // Token: 0x0200001B RID: 27 + public partial class Options : global::System.Windows.Forms.Form + { + // Token: 0x060000C7 RID: 199 RVA: 0x00008664 File Offset: 0x00006864 + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x060000C8 RID: 200 RVA: 0x0000869C File Offset: 0x0000689C + private void InitializeComponent() + { + this.button1 = new global::System.Windows.Forms.Button(); + this.button2 = new global::System.Windows.Forms.Button(); + this.label1 = new global::System.Windows.Forms.Label(); + this.label2 = new global::System.Windows.Forms.Label(); + this.label3 = new global::System.Windows.Forms.Label(); + this.tb_phoneport = new global::System.Windows.Forms.TextBox(); + this.tb_emailport = new global::System.Windows.Forms.TextBox(); + this.tb_maindb = new global::System.Windows.Forms.TextBox(); + this.tb_intradaydb = new global::System.Windows.Forms.TextBox(); + this.label4 = new global::System.Windows.Forms.Label(); + this.lbl_currentIP = new global::System.Windows.Forms.Label(); + this.button3 = new global::System.Windows.Forms.Button(); + this.label5 = new global::System.Windows.Forms.Label(); + this.tb_backuplimit = new global::System.Windows.Forms.TextBox(); + base.SuspendLayout(); + this.button1.Location = new global::System.Drawing.Point(49, 267); + this.button1.Name = "button1"; + this.button1.Size = new global::System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Save"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new global::System.EventHandler(this.button1_Click); + this.button2.Location = new global::System.Drawing.Point(185, 266); + this.button2.Name = "button2"; + this.button2.Size = new global::System.Drawing.Size(75, 23); + this.button2.TabIndex = 1; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new global::System.EventHandler(this.button2_Click); + this.label1.AutoSize = true; + this.label1.Location = new global::System.Drawing.Point(49, 21); + this.label1.Name = "label1"; + this.label1.Size = new global::System.Drawing.Size(57, 13); + this.label1.TabIndex = 2; + this.label1.Text = "PhonePort"; + this.label2.AutoSize = true; + this.label2.Location = new global::System.Drawing.Point(49, 63); + this.label2.Name = "label2"; + this.label2.Size = new global::System.Drawing.Size(66, 13); + this.label2.TabIndex = 3; + this.label2.Text = "iMonitor Port"; + this.label3.AutoSize = true; + this.label3.Location = new global::System.Drawing.Point(49, 103); + this.label3.Name = "label3"; + this.label3.Size = new global::System.Drawing.Size(76, 13); + this.label3.TabIndex = 4; + this.label3.Text = "MainDatabase"; + this.tb_phoneport.Location = new global::System.Drawing.Point(153, 18); + this.tb_phoneport.Name = "tb_phoneport"; + this.tb_phoneport.Size = new global::System.Drawing.Size(126, 20); + this.tb_phoneport.TabIndex = 5; + this.tb_emailport.Location = new global::System.Drawing.Point(153, 60); + this.tb_emailport.Name = "tb_emailport"; + this.tb_emailport.Size = new global::System.Drawing.Size(126, 20); + this.tb_emailport.TabIndex = 6; + this.tb_maindb.Location = new global::System.Drawing.Point(153, 100); + this.tb_maindb.Name = "tb_maindb"; + this.tb_maindb.Size = new global::System.Drawing.Size(126, 20); + this.tb_maindb.TabIndex = 7; + this.tb_intradaydb.Location = new global::System.Drawing.Point(153, 143); + this.tb_intradaydb.Name = "tb_intradaydb"; + this.tb_intradaydb.Size = new global::System.Drawing.Size(126, 20); + this.tb_intradaydb.TabIndex = 9; + this.label4.AutoSize = true; + this.label4.Location = new global::System.Drawing.Point(49, 146); + this.label4.Name = "label4"; + this.label4.Size = new global::System.Drawing.Size(91, 13); + this.label4.TabIndex = 8; + this.label4.Text = "IntradayDatabase"; + this.lbl_currentIP.AutoSize = true; + this.lbl_currentIP.Location = new global::System.Drawing.Point(49, 182); + this.lbl_currentIP.Name = "lbl_currentIP"; + this.lbl_currentIP.Size = new global::System.Drawing.Size(54, 13); + this.lbl_currentIP.TabIndex = 10; + this.lbl_currentIP.Text = "Current IP"; + this.button3.Location = new global::System.Drawing.Point(49, 238); + this.button3.Name = "button3"; + this.button3.Size = new global::System.Drawing.Size(211, 23); + this.button3.TabIndex = 11; + this.button3.Text = "ConnectToSkype"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new global::System.EventHandler(this.button3_Click); + this.label5.AutoSize = true; + this.label5.Location = new global::System.Drawing.Point(46, 210); + this.label5.Name = "label5"; + this.label5.Size = new global::System.Drawing.Size(111, 13); + this.label5.TabIndex = 12; + this.label5.Text = "Backup + Clear Count"; + this.tb_backuplimit.Location = new global::System.Drawing.Point(163, 203); + this.tb_backuplimit.Name = "tb_backuplimit"; + this.tb_backuplimit.Size = new global::System.Drawing.Size(116, 20); + this.tb_backuplimit.TabIndex = 13; + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + base.ClientSize = new global::System.Drawing.Size(322, 316); + base.ControlBox = false; + base.Controls.Add(this.tb_backuplimit); + base.Controls.Add(this.label5); + base.Controls.Add(this.button3); + base.Controls.Add(this.lbl_currentIP); + base.Controls.Add(this.tb_intradaydb); + base.Controls.Add(this.label4); + base.Controls.Add(this.tb_maindb); + base.Controls.Add(this.tb_emailport); + base.Controls.Add(this.tb_phoneport); + base.Controls.Add(this.label3); + base.Controls.Add(this.label2); + base.Controls.Add(this.label1); + base.Controls.Add(this.button2); + base.Controls.Add(this.button1); + base.FormBorderStyle = global::System.Windows.Forms.FormBorderStyle.FixedSingle; + base.Name = "Options"; + base.ShowIcon = false; + base.ShowInTaskbar = false; + this.Text = "Options"; + base.ResumeLayout(false); + base.PerformLayout(); + } + + // Token: 0x0400007B RID: 123 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x0400007C RID: 124 + private global::System.Windows.Forms.Button button1; + + // Token: 0x0400007D RID: 125 + private global::System.Windows.Forms.Button button2; + + // Token: 0x0400007E RID: 126 + private global::System.Windows.Forms.Label label1; + + // Token: 0x0400007F RID: 127 + private global::System.Windows.Forms.Label label2; + + // Token: 0x04000080 RID: 128 + private global::System.Windows.Forms.Label label3; + + // Token: 0x04000081 RID: 129 + private global::System.Windows.Forms.TextBox tb_phoneport; + + // Token: 0x04000082 RID: 130 + private global::System.Windows.Forms.TextBox tb_emailport; + + // Token: 0x04000083 RID: 131 + private global::System.Windows.Forms.TextBox tb_maindb; + + // Token: 0x04000084 RID: 132 + private global::System.Windows.Forms.TextBox tb_intradaydb; + + // Token: 0x04000085 RID: 133 + private global::System.Windows.Forms.Label label4; + + // Token: 0x04000086 RID: 134 + private global::System.Windows.Forms.Label lbl_currentIP; + + // Token: 0x04000087 RID: 135 + private global::System.Windows.Forms.Button button3; + + // Token: 0x04000088 RID: 136 + private global::System.Windows.Forms.Label label5; + + // Token: 0x04000089 RID: 137 + private global::System.Windows.Forms.TextBox tb_backuplimit; + } +} diff --git a/Options.cs b/Options.cs new file mode 100644 index 0000000..bacffe8 --- /dev/null +++ b/Options.cs @@ -0,0 +1,62 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using iMonitorApp.Properties; + +namespace iMonitorApp +{ + // Token: 0x0200001B RID: 27 + public partial class Options : Form + { + // Token: 0x060000C3 RID: 195 RVA: 0x00008494 File Offset: 0x00006694 + public Options() + { + this.InitializeComponent(); + this.tb_phoneport.Text = Settings.Default.PhonePort.ToString(); + this.tb_emailport.Text = Settings.Default.EmailPort.ToString(); + this.tb_maindb.Text = Settings.Default.MainDatabase; + this.tb_intradaydb.Text = Settings.Default.IntradayDatabase; + this.lbl_currentIP.Text = Settings.Default.CurrentIP; + this.tb_backuplimit.Text = Settings.Default.BackupCount.ToString(); + } + + // Token: 0x060000C4 RID: 196 RVA: 0x00008554 File Offset: 0x00006754 + private void button1_Click(object sender, EventArgs e) + { + try + { + Settings.Default.PhonePort = Convert.ToInt32(this.tb_phoneport.Text); + Settings.Default.EmailPort = Convert.ToInt32(this.tb_emailport.Text); + Settings.Default.MainDatabase = this.tb_maindb.Text; + Settings.Default.IntradayDatabase = this.tb_intradaydb.Text; + Settings.Default.BackupCount = Convert.ToInt32(this.tb_backuplimit.Text); + Settings.Default.Save(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + MessageBox.Show("Saved"); + base.Close(); + } + + // Token: 0x060000C5 RID: 197 RVA: 0x00008624 File Offset: 0x00006824 + private void button2_Click(object sender, EventArgs e) + { + base.Close(); + } + + // Token: 0x060000C6 RID: 198 RVA: 0x00008630 File Offset: 0x00006830 + private void button3_Click(object sender, EventArgs e) + { + try + { + } + catch + { + MessageBox.Show("Error connecting to skype. Please contact Manas."); + } + } + } +} diff --git a/Options.resources b/Options.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/Options.resources differ diff --git a/Pad.Designer.cs b/Pad.Designer.cs new file mode 100644 index 0000000..5e9b33e --- /dev/null +++ b/Pad.Designer.cs @@ -0,0 +1,28 @@ +namespace iMonitorApp +{ + // Token: 0x0200000F RID: 15 + public partial class Pad : global::System.Windows.Forms.Form + { + // Token: 0x0600006E RID: 110 RVA: 0x00004E34 File Offset: 0x00003034 + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x0600006F RID: 111 RVA: 0x00004E6B File Offset: 0x0000306B + private void InitializeComponent() + { + this.components = new global::System.ComponentModel.Container(); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + this.Text = "Pad"; + } + + // Token: 0x0400003F RID: 63 + private global::System.ComponentModel.IContainer components = null; + } +} diff --git a/Pad.cs b/Pad.cs new file mode 100644 index 0000000..4ce5b8f --- /dev/null +++ b/Pad.cs @@ -0,0 +1,16 @@ +using System; +using System.ComponentModel; +using System.Windows.Forms; + +namespace iMonitorApp +{ + // Token: 0x0200000F RID: 15 + public partial class Pad : Form + { + // Token: 0x0600006D RID: 109 RVA: 0x00004E1A File Offset: 0x0000301A + public Pad() + { + this.InitializeComponent(); + } + } +} diff --git a/ParentForm.Designer.cs b/ParentForm.Designer.cs new file mode 100644 index 0000000..546d1c4 --- /dev/null +++ b/ParentForm.Designer.cs @@ -0,0 +1,243 @@ +namespace iMonitorApp +{ + // Token: 0x0200001C RID: 28 + public partial class ParentForm : global::System.Windows.Forms.Form + { + // Token: 0x060000DD RID: 221 RVA: 0x000097C8 File Offset: 0x000079C8 + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x060000DE RID: 222 RVA: 0x00009800 File Offset: 0x00007A00 + private void InitializeComponent() + { + this.components = new global::System.ComponentModel.Container(); + global::System.ComponentModel.ComponentResourceManager componentResourceManager = new global::System.ComponentModel.ComponentResourceManager(typeof(global::iMonitorApp.ParentForm)); + this.menuStrip = new global::System.Windows.Forms.MenuStrip(); + this.fileMenu = new global::System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator5 = new global::System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new global::System.Windows.Forms.ToolStripMenuItem(); + this.toolsMenu = new global::System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new global::System.Windows.Forms.ToolStripMenuItem(); + this.windowsToolStripMenuItem = new global::System.Windows.Forms.ToolStripMenuItem(); + this.phoneDialerToolStripMenuItem = new global::System.Windows.Forms.ToolStripMenuItem(); + this.tileToolStripMenuItem = new global::System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new global::System.Windows.Forms.ToolStripMenuItem(); + this.statusStrip = new global::System.Windows.Forms.StatusStrip(); + this.tss_working = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.tss_new = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.tss_datarecorder = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.tss_basket = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.tss_outbox = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.tss_market = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.tss_skype = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.tss_gun = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.tss_heartbeat = new global::System.Windows.Forms.ToolStripStatusLabel(); + this.toolTip = new global::System.Windows.Forms.ToolTip(this.components); + this.notifyIcon1 = new global::System.Windows.Forms.NotifyIcon(this.components); + this.backgroundWorker1 = new global::System.ComponentModel.BackgroundWorker(); + this.menuStrip.SuspendLayout(); + this.statusStrip.SuspendLayout(); + base.SuspendLayout(); + this.menuStrip.Items.AddRange(new global::System.Windows.Forms.ToolStripItem[] + { + this.fileMenu, + this.toolsMenu, + this.windowsToolStripMenuItem, + this.aboutToolStripMenuItem + }); + this.menuStrip.Location = new global::System.Drawing.Point(0, 0); + this.menuStrip.Name = "menuStrip"; + this.menuStrip.Size = new global::System.Drawing.Size(1292, 24); + this.menuStrip.TabIndex = 0; + this.menuStrip.Text = "MenuStrip"; + this.fileMenu.DropDownItems.AddRange(new global::System.Windows.Forms.ToolStripItem[] + { + this.toolStripSeparator5, + this.exitToolStripMenuItem + }); + this.fileMenu.ImageTransparentColor = global::System.Drawing.SystemColors.ActiveBorder; + this.fileMenu.Name = "fileMenu"; + this.fileMenu.Size = new global::System.Drawing.Size(35, 20); + this.fileMenu.Text = "&File"; + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new global::System.Drawing.Size(89, 6); + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new global::System.Drawing.Size(92, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + this.exitToolStripMenuItem.Click += new global::System.EventHandler(this.ExitToolsStripMenuItem_Click); + this.toolsMenu.DropDownItems.AddRange(new global::System.Windows.Forms.ToolStripItem[] + { + this.optionsToolStripMenuItem + }); + this.toolsMenu.Name = "toolsMenu"; + this.toolsMenu.Size = new global::System.Drawing.Size(44, 20); + this.toolsMenu.Text = "&Tools"; + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new global::System.Drawing.Size(111, 22); + this.optionsToolStripMenuItem.Text = "&Options"; + this.optionsToolStripMenuItem.Click += new global::System.EventHandler(this.optionsToolStripMenuItem_Click); + this.windowsToolStripMenuItem.DropDownItems.AddRange(new global::System.Windows.Forms.ToolStripItem[] + { + this.phoneDialerToolStripMenuItem, + this.tileToolStripMenuItem + }); + this.windowsToolStripMenuItem.Name = "windowsToolStripMenuItem"; + this.windowsToolStripMenuItem.Size = new global::System.Drawing.Size(62, 20); + this.windowsToolStripMenuItem.Text = "Windows"; + this.phoneDialerToolStripMenuItem.Name = "phoneDialerToolStripMenuItem"; + this.phoneDialerToolStripMenuItem.Size = new global::System.Drawing.Size(134, 22); + this.phoneDialerToolStripMenuItem.Text = "Phone Dialer"; + this.phoneDialerToolStripMenuItem.Click += new global::System.EventHandler(this.phoneDialerToolStripMenuItem_Click); + this.tileToolStripMenuItem.Name = "tileToolStripMenuItem"; + this.tileToolStripMenuItem.Size = new global::System.Drawing.Size(134, 22); + this.tileToolStripMenuItem.Text = "Tile"; + this.tileToolStripMenuItem.Click += new global::System.EventHandler(this.tileToolStripMenuItem_Click); + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new global::System.Drawing.Size(48, 20); + this.aboutToolStripMenuItem.Text = "About"; + this.aboutToolStripMenuItem.Click += new global::System.EventHandler(this.aboutToolStripMenuItem_Click); + this.statusStrip.Items.AddRange(new global::System.Windows.Forms.ToolStripItem[] + { + this.tss_working, + this.tss_new, + this.tss_datarecorder, + this.tss_basket, + this.tss_outbox, + this.tss_market, + this.tss_skype, + this.tss_gun, + this.tss_heartbeat + }); + this.statusStrip.Location = new global::System.Drawing.Point(0, 510); + this.statusStrip.Name = "statusStrip"; + this.statusStrip.Size = new global::System.Drawing.Size(1292, 22); + this.statusStrip.TabIndex = 2; + this.statusStrip.Text = "StatusStrip"; + this.tss_working.Name = "tss_working"; + this.tss_working.Size = new global::System.Drawing.Size(38, 17); + this.tss_working.Text = "Status"; + this.tss_new.Name = "tss_new"; + this.tss_new.Size = new global::System.Drawing.Size(0, 17); + this.tss_datarecorder.Name = "tss_datarecorder"; + this.tss_datarecorder.Size = new global::System.Drawing.Size(0, 17); + this.tss_basket.Name = "tss_basket"; + this.tss_basket.Size = new global::System.Drawing.Size(0, 17); + this.tss_outbox.Name = "tss_outbox"; + this.tss_outbox.Size = new global::System.Drawing.Size(0, 17); + this.tss_market.Name = "tss_market"; + this.tss_market.Size = new global::System.Drawing.Size(0, 17); + this.tss_skype.Name = "tss_skype"; + this.tss_skype.Size = new global::System.Drawing.Size(36, 17); + this.tss_skype.Text = "Skype"; + this.tss_gun.Name = "tss_gun"; + this.tss_gun.Size = new global::System.Drawing.Size(0, 17); + this.tss_heartbeat.Name = "tss_heartbeat"; + this.tss_heartbeat.Size = new global::System.Drawing.Size(109, 17); + this.tss_heartbeat.Text = "toolStripStatusLabel1"; + this.notifyIcon1.BalloonTipIcon = global::System.Windows.Forms.ToolTipIcon.Info; + this.notifyIcon1.BalloonTipText = "iMonitor Running"; + this.notifyIcon1.BalloonTipTitle = "iMonitor"; + this.notifyIcon1.Icon = (global::System.Drawing.Icon)componentResourceManager.GetObject("notifyIcon1.Icon"); + this.notifyIcon1.Text = "iMonitor"; + this.notifyIcon1.Visible = true; + this.notifyIcon1.MouseDoubleClick += new global::System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick); + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + base.ClientSize = new global::System.Drawing.Size(1292, 532); + base.Controls.Add(this.statusStrip); + base.Controls.Add(this.menuStrip); + base.Icon = (global::System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon"); + base.IsMdiContainer = true; + base.MainMenuStrip = this.menuStrip; + base.Name = "ParentForm"; + this.Text = "iMonitor"; + base.FormClosing += new global::System.Windows.Forms.FormClosingEventHandler(this.ParentForm_FormClosing); + base.Resize += new global::System.EventHandler(this.ParentForm_Resize); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + this.statusStrip.ResumeLayout(false); + this.statusStrip.PerformLayout(); + base.ResumeLayout(false); + base.PerformLayout(); + } + + // Token: 0x04000096 RID: 150 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x04000097 RID: 151 + private global::System.Windows.Forms.MenuStrip menuStrip; + + // Token: 0x04000098 RID: 152 + private global::System.Windows.Forms.StatusStrip statusStrip; + + // Token: 0x04000099 RID: 153 + private global::System.Windows.Forms.ToolStripSeparator toolStripSeparator5; + + // Token: 0x0400009A RID: 154 + private global::System.Windows.Forms.ToolStripStatusLabel tss_working; + + // Token: 0x0400009B RID: 155 + private global::System.Windows.Forms.ToolStripMenuItem fileMenu; + + // Token: 0x0400009C RID: 156 + private global::System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + + // Token: 0x0400009D RID: 157 + private global::System.Windows.Forms.ToolStripMenuItem toolsMenu; + + // Token: 0x0400009E RID: 158 + private global::System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + + // Token: 0x0400009F RID: 159 + private global::System.Windows.Forms.ToolTip toolTip; + + // Token: 0x040000A0 RID: 160 + private global::System.Windows.Forms.NotifyIcon notifyIcon1; + + // Token: 0x040000A1 RID: 161 + private global::System.ComponentModel.BackgroundWorker backgroundWorker1; + + // Token: 0x040000A2 RID: 162 + private global::System.Windows.Forms.ToolStripMenuItem windowsToolStripMenuItem; + + // Token: 0x040000A3 RID: 163 + private global::System.Windows.Forms.ToolStripMenuItem tileToolStripMenuItem; + + // Token: 0x040000A4 RID: 164 + private global::System.Windows.Forms.ToolStripStatusLabel tss_new; + + // Token: 0x040000A5 RID: 165 + private global::System.Windows.Forms.ToolStripStatusLabel tss_datarecorder; + + // Token: 0x040000A6 RID: 166 + private global::System.Windows.Forms.ToolStripStatusLabel tss_basket; + + // Token: 0x040000A7 RID: 167 + private global::System.Windows.Forms.ToolStripStatusLabel tss_outbox; + + // Token: 0x040000A8 RID: 168 + private global::System.Windows.Forms.ToolStripStatusLabel tss_market; + + // Token: 0x040000A9 RID: 169 + private global::System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + + // Token: 0x040000AA RID: 170 + private global::System.Windows.Forms.ToolStripStatusLabel tss_skype; + + // Token: 0x040000AB RID: 171 + private global::System.Windows.Forms.ToolStripMenuItem phoneDialerToolStripMenuItem; + + // Token: 0x040000AC RID: 172 + private global::System.Windows.Forms.ToolStripStatusLabel tss_gun; + + // Token: 0x040000AD RID: 173 + private global::System.Windows.Forms.ToolStripStatusLabel tss_heartbeat; + } +} diff --git a/ParentForm.cs b/ParentForm.cs new file mode 100644 index 0000000..0142dbe --- /dev/null +++ b/ParentForm.cs @@ -0,0 +1,350 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Media; +using System.Net; +using System.Text; +using System.Threading; +using System.Timers; +using System.Windows.Forms; +using iMonitorAPI; +using iMonitorApp.Classes; +using iMonitorApp.Properties; + +namespace iMonitorApp +{ + // Token: 0x0200001C RID: 28 + public partial class ParentForm : Form + { + // Token: 0x060000C9 RID: 201 RVA: 0x00008E3C File Offset: 0x0000703C + public ParentForm() + { + this.InitializeComponent(); + Settings.Default.CurrentIP = Config.GetIP4Address(); + this.pdForm = new PhoneDialer(this); + this.pdForm.MdiParent = this; + this.pdForm.Show(); + new StackAlarm + { + MdiParent = this + }.Show(); + this.backgroundWorker1.WorkerReportsProgress = true; + this.backgroundWorker1.DoWork += this.backgroundWorker1_DoWork; + this.backgroundWorker1.RunWorkerCompleted += this.backgroundWorker1_RunWorkerCompleted; + this.marketAlertTimer = new System.Threading.Timer(new TimerCallback(this.MarketAlertProc), null, 100, Settings.Default.TimerMarketDataChecks * 1000); + this.tradeAlertTimer = new System.Threading.Timer(new TimerCallback(this.TradeAlertProc), null, 100, Settings.Default.TimerTradeChecks * 1000); + this.heartBeatTimer = new System.Threading.Timer(new TimerCallback(this.SendAMHeartBeat), null, 100, Settings.Default.ExternalHeartbeatTimer * 1000); + } + + // Token: 0x060000CA RID: 202 RVA: 0x00008F88 File Offset: 0x00007188 + private void iTradeTimer_Elapsed(object sender, ElapsedEventArgs e) + { + throw new NotImplementedException(); + } + + // Token: 0x060000CB RID: 203 RVA: 0x00008F90 File Offset: 0x00007190 + private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) + { + this.tss_working.Text = "market data check complete"; + } + + // Token: 0x060000CC RID: 204 RVA: 0x00008FA4 File Offset: 0x000071A4 + private void ExitToolsStripMenuItem_Click(object sender, EventArgs e) + { + this.isClosing = true; + Application.Exit(); + Environment.Exit(0); + } + + // Token: 0x060000CD RID: 205 RVA: 0x00008FBC File Offset: 0x000071BC + private void optionsToolStripMenuItem_Click(object sender, EventArgs e) + { + SettingsForm settingsForm = new SettingsForm(); + settingsForm.ShowDialog(); + } + + // Token: 0x060000CE RID: 206 RVA: 0x00008FD8 File Offset: 0x000071D8 + public void SendAMHeartBeat(object state) + { + bool primary = Settings.Default.Primary; + if (primary) + { + try + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + this.Status("Sending Heartbeat...", "tss_heartbeat", Color.Yellow); + HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(Settings.Default.ExternalHeartbeatURL); + string str = Convert.ToBase64String(Encoding.ASCII.GetBytes(Settings.Default.ExternalHeartbeatUsername + ":" + Settings.Default.ExternalHeartbeatPassword)); + httpWebRequest.Headers.Add("Authorization", "Basic " + str); + httpWebRequest.ReadWriteTimeout = 20000; + httpWebRequest.Timeout = 20000; + httpWebRequest.Method = "GET"; + this.Status("Waiting For Response..", "tss_heartbeat", Color.Orange); + HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); + stopwatch.Stop(); + this.Status(httpWebResponse.StatusDescription + stopwatch.Elapsed.TotalSeconds.ToString() + " secs", "tss_heartbeat", Color.Green); + httpWebResponse.Close(); + httpWebRequest.Abort(); + } + catch (Exception ex) + { + this.Status("Unable to send heartbeat at " + DateTime.Now.ToString() + " Error:" + ex.Message, "tss_heartbeat", Color.Red); + } + } + } + + // Token: 0x060000CF RID: 207 RVA: 0x00009170 File Offset: 0x00007370 + private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) + { + bool flag = e.Button == MouseButtons.Left; + if (flag) + { + base.Show(); + base.WindowState = this.lastWindowState; + } + } + + // Token: 0x060000D0 RID: 208 RVA: 0x000091A8 File Offset: 0x000073A8 + private void ParentForm_FormClosing(object sender, FormClosingEventArgs e) + { + bool flag = this.isClosing; + if (!flag) + { + e.Cancel = true; + base.Hide(); + this.notifyIcon1.ShowBalloonTip(3000, "iMonitor!!", "iMonitor is still running. \r\nDoubleClick to access.", ToolTipIcon.Info); + } + } + + // Token: 0x060000D1 RID: 209 RVA: 0x000091F0 File Offset: 0x000073F0 + private void ParentForm_Resize(object sender, EventArgs e) + { + bool flag = base.WindowState == FormWindowState.Minimized; + if (flag) + { + base.ShowInTaskbar = false; + } + else + { + base.ShowInTaskbar = true; + } + } + + // Token: 0x060000D2 RID: 210 RVA: 0x0000921D File Offset: 0x0000741D + private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) + { + new MarketData().CheckAlarms(); + } + + // Token: 0x060000D3 RID: 211 RVA: 0x0000922B File Offset: 0x0000742B + private void testToolStripMenuItem_Click(object sender, EventArgs e) + { + this.backgroundWorker1.RunWorkerAsync(); + } + + // Token: 0x060000D4 RID: 212 RVA: 0x0000923C File Offset: 0x0000743C + private void TradeAlertProc(object state) + { + bool flag = !Settings.Default.Primary; + if (!flag) + { + CountdownEvent countdownEvent = new CountdownEvent(6); + new Thread(delegate() + { + this.Status(TradeAlerts.CheckWorkingOrders(), "tss_working", Color.Transparent); + countdownEvent.Signal(); + }).Start(); + new Thread(delegate() + { + this.Status(TradeAlerts.CheckNewOrders(), "tss_new", Color.Transparent); + countdownEvent.Signal(); + }).Start(); + new Thread(delegate() + { + this.Status(TradeAlerts.CheckBaskets(), "tss_basket", Color.Transparent); + countdownEvent.Signal(); + }).Start(); + new Thread(delegate() + { + this.Status(TradeAlerts.CheckOutbox(), "tss_outbox", Color.Transparent); + countdownEvent.Signal(); + }).Start(); + new Thread(delegate() + { + this.Status(TradeAlerts.CheckGun(), "tss_gun", Color.Transparent); + countdownEvent.Signal(); + }).Start(); + countdownEvent.Wait(); + } + } + + // Token: 0x060000D5 RID: 213 RVA: 0x000092F8 File Offset: 0x000074F8 + private void MarketAlertProc(object state) + { + bool flag = !Settings.Default.Primary; + if (!flag) + { + CountdownEvent countdownEvent = new CountdownEvent(1); + new Thread(delegate() + { + MarketData marketData = new MarketData(); + this.Status(marketData.CheckAlarms(), "tss_market", Color.Transparent); + countdownEvent.Signal(); + }).Start(); + countdownEvent.Wait(); + } + } + + // Token: 0x060000D6 RID: 214 RVA: 0x00009355 File Offset: 0x00007555 + private void tileToolStripMenuItem_Click(object sender, EventArgs e) + { + base.LayoutMdi(MdiLayout.TileVertical); + } + + // Token: 0x060000D7 RID: 215 RVA: 0x00009360 File Offset: 0x00007560 + public void Status(string msg, string labelname, Color c) + { + StatusStrip statusStrip = (StatusStrip)base.Controls["statusStrip"]; + ToolStripStatusLabel toolStripStatusLabel = (ToolStripStatusLabel)statusStrip.Items[labelname]; + bool flag = !statusStrip.IsHandleCreated; + if (flag) + { + IntPtr handle = statusStrip.Handle; + } + bool invokeRequired = statusStrip.InvokeRequired; + if (invokeRequired) + { + statusStrip.Invoke(new ParentForm.updateTextCallback(this.updateText), new object[] + { + msg, + labelname, + c + }); + } + else + { + toolStripStatusLabel.Text = msg; + statusStrip.Refresh(); + } + } + + // Token: 0x060000D8 RID: 216 RVA: 0x000093F8 File Offset: 0x000075F8 + private void updateText(string text, string labelname, Color c) + { + StatusStrip statusStrip = (StatusStrip)base.Controls["statusStrip"]; + ToolStripStatusLabel toolStripStatusLabel = (ToolStripStatusLabel)statusStrip.Items[labelname]; + toolStripStatusLabel.Text = text; + toolStripStatusLabel.BackColor = c; + } + + // Token: 0x060000D9 RID: 217 RVA: 0x00009440 File Offset: 0x00007640 + private void aboutToolStripMenuItem_Click(object sender, EventArgs e) + { + AboutBox1 aboutBox = new AboutBox1(); + aboutBox.ShowDialog(); + } + + // Token: 0x060000DA RID: 218 RVA: 0x0000945B File Offset: 0x0000765B + private void phoneDialerToolStripMenuItem_Click(object sender, EventArgs e) + { + this.pdForm.Show(); + } + + // Token: 0x060000DB RID: 219 RVA: 0x0000946C File Offset: 0x0000766C + private void FixingAlertProc(object state) + { + try + { + bool flag = (DateTime.Now - new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 7, 25, 0)).TotalSeconds <= 11.0 && (DateTime.Now - new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 7, 25, 0)).TotalSeconds > 0.0; + if (flag) + { + this._fixings = new Fixings(); + this._fixings.GetFixings("EE02"); + this._fixings.GetFixings("RIN02"); + this._doneAlready.Clear(); + } + foreach (KeyValuePair> keyValuePair in this._fixings.fixings) + { + bool flag2 = (keyValuePair.Key - DateTime.Now).TotalSeconds < 11.0 && (keyValuePair.Key - DateTime.Now).TotalSeconds > 0.0; + if (flag2) + { + new SoundPlayer(Resources.OpeningBellRingTone).Play(); + bool flag3 = this._doneAlready.Count >= this._fixings.fixings.Count || (DateTime.Now.TimeOfDay < new TimeSpan(7, 0, 0) && DateTime.Now.TimeOfDay >= new TimeSpan(6, 59, 50)); + if (flag3) + { + } + } + bool flag4 = (keyValuePair.Key - DateTime.Now).TotalMinutes < 11.0 && (keyValuePair.Key - DateTime.Now).TotalMinutes > 1.0 && !this._doneAlready.ContainsKey(keyValuePair.Key); + if (flag4) + { + iMonitor.SendAlarm(string.Join(",", keyValuePair.Value) + " Fixing in 10 minutes", new List + { + "etrading" + }, "l", "NULL", true, false, "FALSE", 5, 15, "http://10.153.64.31:5001/iMonitor/Responder.aspx"); + this._doneAlready.Add(keyValuePair.Key, keyValuePair.Value); + } + bool flag5 = (keyValuePair.Key - DateTime.Now).TotalMinutes < 0.0; + if (flag5) + { + bool flag6 = !this._doneAlready.ContainsKey(keyValuePair.Key); + if (flag6) + { + this._doneAlready.Add(keyValuePair.Key, keyValuePair.Value); + } + } + } + } + catch + { + } + } + + // Token: 0x060000DC RID: 220 RVA: 0x000038AE File Offset: 0x00001AAE + private void FixingRefillAlertProc(object state) + { + } + + // Token: 0x0400008A RID: 138 + private int childFormNumber = 0; + + // Token: 0x0400008B RID: 139 + private FormWindowState lastWindowState; + + // Token: 0x0400008C RID: 140 + private TradeAlerts ta = new TradeAlerts(); + + // Token: 0x0400008D RID: 141 + private System.Threading.Timer tradeAlertTimer; + + // Token: 0x0400008E RID: 142 + private System.Threading.Timer marketAlertTimer; + + // Token: 0x0400008F RID: 143 + private System.Threading.Timer fixingsTimer; + + // Token: 0x04000090 RID: 144 + private System.Threading.Timer fixingsReFillTimer; + + // Token: 0x04000091 RID: 145 + private System.Threading.Timer heartBeatTimer; + + // Token: 0x04000092 RID: 146 + private PhoneDialer pdForm; + + // Token: 0x04000093 RID: 147 + private Fixings _fixings; + + // Token: 0x04000094 RID: 148 + private bool isClosing = false; + + // Token: 0x04000095 RID: 149 + private Dictionary> _doneAlready = new Dictionary>(); + + // Token: 0x02000040 RID: 64 + // (Invoke) Token: 0x0600021B RID: 539 + public delegate void updateTextCallback(string text, string labelname, Color c); + } +} diff --git a/ParentForm.resources b/ParentForm.resources new file mode 100644 index 0000000..0490f29 Binary files /dev/null and b/ParentForm.resources differ diff --git a/ParseStackAlarms.cs b/ParseStackAlarms.cs new file mode 100644 index 0000000..ac9ca30 --- /dev/null +++ b/ParseStackAlarms.cs @@ -0,0 +1,713 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Net; +using System.Net.Mail; +using System.Net.Mime; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using iMonitorApp.Properties; +using _4ELogger; + +namespace iMonitorApp +{ + // Token: 0x02000020 RID: 32 + public class ParseStackAlarms : INotifyPropertyChanged + { + // Token: 0x17000021 RID: 33 + // (get) Token: 0x060000F3 RID: 243 RVA: 0x0000A5F1 File Offset: 0x000087F1 + // (set) Token: 0x060000F4 RID: 244 RVA: 0x0000A5F9 File Offset: 0x000087F9 + private string EncodedText { get; set; } + + // Token: 0x17000022 RID: 34 + // (get) Token: 0x060000F5 RID: 245 RVA: 0x0000A602 File Offset: 0x00008802 + // (set) Token: 0x060000F6 RID: 246 RVA: 0x0000A60A File Offset: 0x0000880A + public string Theme { get; set; } + + // Token: 0x17000023 RID: 35 + // (get) Token: 0x060000F7 RID: 247 RVA: 0x0000A613 File Offset: 0x00008813 + // (set) Token: 0x060000F8 RID: 248 RVA: 0x0000A61B File Offset: 0x0000881B + public string SendingEmailStatus { get; set; } + + // Token: 0x14000004 RID: 4 + // (add) Token: 0x060000F9 RID: 249 RVA: 0x0000A624 File Offset: 0x00008824 + // (remove) Token: 0x060000FA RID: 250 RVA: 0x0000A65C File Offset: 0x0000885C + // [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public event PropertyChangedEventHandler PropertyChanged; + + // Token: 0x17000024 RID: 36 + // (get) Token: 0x060000FB RID: 251 RVA: 0x0000A691 File Offset: 0x00008891 + // (set) Token: 0x060000FC RID: 252 RVA: 0x0000A699 File Offset: 0x00008899 + public string Subject { get; set; } + + // Token: 0x17000025 RID: 37 + // (get) Token: 0x060000FD RID: 253 RVA: 0x0000A6A2 File Offset: 0x000088A2 + // (set) Token: 0x060000FE RID: 254 RVA: 0x0000A6AA File Offset: 0x000088AA + public string EmailReplyTo { get; set; } + + // Token: 0x17000026 RID: 38 + // (get) Token: 0x060000FF RID: 255 RVA: 0x0000A6B3 File Offset: 0x000088B3 + // (set) Token: 0x06000100 RID: 256 RVA: 0x0000A6BB File Offset: 0x000088BB + public string EmailBCC { get; set; } + + // Token: 0x17000027 RID: 39 + // (get) Token: 0x06000101 RID: 257 RVA: 0x0000A6C4 File Offset: 0x000088C4 + // (set) Token: 0x06000102 RID: 258 RVA: 0x0000A6CC File Offset: 0x000088CC + public string EmailCC { get; set; } + + // Token: 0x17000028 RID: 40 + // (get) Token: 0x06000103 RID: 259 RVA: 0x0000A6D5 File Offset: 0x000088D5 + // (set) Token: 0x06000104 RID: 260 RVA: 0x0000A6DD File Offset: 0x000088DD + public string Images { get; set; } + + // Token: 0x17000029 RID: 41 + // (get) Token: 0x06000105 RID: 261 RVA: 0x0000A6E6 File Offset: 0x000088E6 + // (set) Token: 0x06000106 RID: 262 RVA: 0x0000A6EE File Offset: 0x000088EE + public string Attachments { get; set; } + + // Token: 0x1700002A RID: 42 + // (get) Token: 0x06000107 RID: 263 RVA: 0x0000A6F7 File Offset: 0x000088F7 + // (set) Token: 0x06000108 RID: 264 RVA: 0x0000A6FF File Offset: 0x000088FF + public bool SayIt { get; set; } + + // Token: 0x1700002B RID: 43 + // (get) Token: 0x06000109 RID: 265 RVA: 0x0000A708 File Offset: 0x00008908 + // (set) Token: 0x0600010A RID: 266 RVA: 0x0000A710 File Offset: 0x00008910 + public bool EmailIt { get; set; } + + // Token: 0x1700002C RID: 44 + // (get) Token: 0x0600010B RID: 267 RVA: 0x0000A719 File Offset: 0x00008919 + // (set) Token: 0x0600010C RID: 268 RVA: 0x0000A721 File Offset: 0x00008921 + public bool Phoneit { get; set; } + + // Token: 0x1700002D RID: 45 + // (get) Token: 0x0600010D RID: 269 RVA: 0x0000A72A File Offset: 0x0000892A + // (set) Token: 0x0600010E RID: 270 RVA: 0x0000A732 File Offset: 0x00008932 + public bool SmsIt { get; set; } + + // Token: 0x1700002E RID: 46 + // (get) Token: 0x0600010F RID: 271 RVA: 0x0000A73B File Offset: 0x0000893B + // (set) Token: 0x06000110 RID: 272 RVA: 0x0000A743 File Offset: 0x00008943 + public string AlertLevel { get; set; } + + // Token: 0x1700002F RID: 47 + // (get) Token: 0x06000111 RID: 273 RVA: 0x0000A74C File Offset: 0x0000894C + // (set) Token: 0x06000112 RID: 274 RVA: 0x0000A754 File Offset: 0x00008954 + public string PhoneNumbers { get; set; } + + // Token: 0x17000030 RID: 48 + // (get) Token: 0x06000113 RID: 275 RVA: 0x0000A75D File Offset: 0x0000895D + // (set) Token: 0x06000114 RID: 276 RVA: 0x0000A765 File Offset: 0x00008965 + public string Recipients { get; set; } + + // Token: 0x17000031 RID: 49 + // (get) Token: 0x06000115 RID: 277 RVA: 0x0000A76E File Offset: 0x0000896E + // (set) Token: 0x06000116 RID: 278 RVA: 0x0000A776 File Offset: 0x00008976 + public bool YahooMessenger { get; set; } + + // Token: 0x17000032 RID: 50 + // (get) Token: 0x06000117 RID: 279 RVA: 0x0000A77F File Offset: 0x0000897F + // (set) Token: 0x06000118 RID: 280 RVA: 0x0000A787 File Offset: 0x00008987 + public string Escalation { get; set; } + + // Token: 0x17000033 RID: 51 + // (get) Token: 0x06000119 RID: 281 RVA: 0x0000A790 File Offset: 0x00008990 + // (set) Token: 0x0600011A RID: 282 RVA: 0x0000A798 File Offset: 0x00008998 + public DateTime ReceivingTime { get; set; } + + // Token: 0x17000034 RID: 52 + // (get) Token: 0x0600011B RID: 283 RVA: 0x0000A7A1 File Offset: 0x000089A1 + // (set) Token: 0x0600011C RID: 284 RVA: 0x0000A7A9 File Offset: 0x000089A9 + public string Body { get; set; } + + // Token: 0x0600011D RID: 285 RVA: 0x00002AAD File Offset: 0x00000CAD + public ParseStackAlarms() + { + } + + // Token: 0x0600011E RID: 286 RVA: 0x0000A7B2 File Offset: 0x000089B2 + public ParseStackAlarms(string text) : this(text, new ThemeEmails()) + { + } + + // Token: 0x0600011F RID: 287 RVA: 0x0000A7C4 File Offset: 0x000089C4 + public ParseStackAlarms(string text, ThemeEmails te) + { + try + { + this.ReceivingTime = DateTime.Now; + this.EncodedText = text; + this.EncodedText = this.EncodedText.Replace("", ""); + this.themeEmails = te; + string[] array = this.EncodedText.Split(new char[] + { + '~' + }); + this.dick = new Dictionary(); + foreach (string text2 in array) + { + string[] array3 = text2.Split(new string[] + { + "$#=" + }, StringSplitOptions.RemoveEmptyEntries); + bool flag = this.dick.ContainsKey(array3[0]); + if (!flag) + { + bool flag2 = array3.Count() == 1; + if (flag2) + { + this.dick.Add(array3[0], null); + } + else + { + this.dick.Add(array3[0], array3[1]); + } + } + } + this.Theme = this.GetVal("theme"); + this.AlertLevel = this.GetVal("alertlevel"); + this.Subject = this.GetVal("subject"); + this.Body = this.GetVal("body"); + this.Recipients = this.GetVal("recipients"); + this.EmailBCC = this.GetVal("emailBCC"); + this.EmailCC = this.GetVal("emailCC"); + this.Attachments = this.GetVal("emailAttachments"); + this.Images = this.GetVal("emailImages"); + this.EmailReplyTo = this.GetVal("emailReplyTo"); + this.SayIt = Convert.ToBoolean(this.GetVal("sayIt")); + this.EmailIt = Convert.ToBoolean(this.GetVal("emailIt")); + try + { + this.Phoneit = Convert.ToBoolean(this.GetVal("phoneCall")); + } + catch + { + string text3 = this.GetVal("phoneCall"); + bool flag3 = text3.StartsWith("AUTO"); + if (flag3) + { + text3 = text3.Replace("AUTO-", ""); + bool flag4 = this.AlertLevel == text3; + if (flag4) + { + this.Phoneit = true; + } + else + { + this.Phoneit = false; + } + } + } + this.YahooMessenger = Convert.ToBoolean(this.GetVal("ym")); + this.SmsIt = Convert.ToBoolean(this.GetVal("sms")); + this.Escalation = this.GetVal("escalation"); + bool flag5 = this.Phoneit || this.SmsIt; + if (flag5) + { + this.PhoneNumbers = this.GetVal("numbers"); + } + this.SendingEmailStatus = ""; + this.NotifyPropertyChanged("ym"); + } + catch (Exception ex) + { + SocketClient.Send(Settings.Default.PhoneIP, Settings.Default.SpeechPort, "Error Parsing Alarm"); + Logger.Log(string.Concat(new string[] + { + "Error parsing alarm ", + this.EncodedText, + "Exception:", + ex.Message, + ex.StackTrace + }), "iMonitorApp", "iMonitor"); + } + } + + // Token: 0x06000120 RID: 288 RVA: 0x0000AB2C File Offset: 0x00008D2C + private void NotifyPropertyChanged(string propertyName = "") + { + bool flag = this.PropertyChanged != null; + if (flag) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + // Token: 0x06000121 RID: 289 RVA: 0x0000AB5C File Offset: 0x00008D5C + public void Process() + { + try + { + bool sayIt = this.SayIt; + if (sayIt) + { + this.Say(); + } + } + catch (Exception ex) + { + this.SendingEmailStatus = "Error Saying - " + ex.Message; + } + try + { + bool emailIt = this.EmailIt; + if (emailIt) + { + this.Email(false); + } + } + catch (Exception ex2) + { + bool flag = ex2.Message.Contains("The specified path"); + if (flag) + { + this.message.Subject = "Attachment Ignored - " + this.message.Subject; + MailMessage mailMessage = this.message; + mailMessage.Body = mailMessage.Body + "Attachment Ignored because: " + ex2.Message; + try + { + this.Email(true); + } + catch (Exception ex3) + { + this.SendingEmailStatus = "Error sending Email - " + ex3.Message; + } + } + } + try + { + bool phoneit = this.Phoneit; + if (phoneit) + { + this.PhoneCall(); + } + } + catch (Exception ex4) + { + this.SendingEmailStatus = "Error sending Phonecall- " + ex4.Message; + } + try + { + bool smsIt = this.SmsIt; + if (smsIt) + { + this.SMS(); + } + } + catch (Exception ex5) + { + this.SendingEmailStatus = "Error sending SMS- " + ex5.Message; + } + } + + // Token: 0x06000122 RID: 290 RVA: 0x0000ACEC File Offset: 0x00008EEC + private void PhoneCall() + { + SocketClient.Send(Settings.Default.PhoneIP, Settings.Default.PhonePort, this.PhoneNumbers + ""); + Logger.Log("Phone Call Sent: " + this.PhoneNumbers, "PhoneLogs", "iMonitor"); + } + + // Token: 0x06000123 RID: 291 RVA: 0x000038AE File Offset: 0x00001AAE + private void SMS() + { + } + + // Token: 0x06000124 RID: 292 RVA: 0x0000AD44 File Offset: 0x00008F44 + private string GetVal(string key) + { + bool flag = this.dick.ContainsKey(key); + string result; + if (flag) + { + result = this.dick[key]; + } + else + { + result = null; + } + return result; + } + + // Token: 0x06000125 RID: 293 RVA: 0x0000AD78 File Offset: 0x00008F78 + private void Say() + { + SocketClient.Send(Settings.Default.PhoneIP, Settings.Default.SpeechPort, this.Subject.Replace("", "")); + Logger.Log("Speech Sent: " + this.Subject.Replace("", ""), "SpeechLogs", "iMonitor"); + } + + // Token: 0x06000126 RID: 294 RVA: 0x0000ADDF File Offset: 0x00008FDF + private void Say(string text) + { + SocketClient.Send(Settings.Default.PhoneIP, Settings.Default.SpeechPort, text); + Logger.Log("Speech Sent: " + text, "SpeechLogs", "iMonitor"); + } + + // Token: 0x06000127 RID: 295 RVA: 0x0000AE14 File Offset: 0x00009014 + private void Email(bool ignoreAttach = false) + { + string firstTheme = this.Theme.Split(new char[] + { + ',' + })[0]; + ThemeEmail themeEmail = (from p in this.themeEmails.EmailList + where p.ThemeName.ToLower() == firstTheme.ToLower() + select p).FirstOrDefault(); + bool flag = themeEmail == null; + string text; + string password; + string displayName; + if (flag) + { + text = "iAlarm@4ecap.com"; + password = "iAlarm"; + displayName = "Theme NA"; + } + else + { + text = themeEmail.EmailAddress; + displayName = themeEmail.DisplayName; + password = themeEmail.Password; + } + bool flag2 = firstTheme.ToLower() == "etrading"; + if (flag2) + { + text = "etrading@fourelements.sg"; + password = "etr4ec2014"; + displayName = "E-Trading"; + } + bool flag3 = firstTheme.ToLower() == "idstrategy"; + if (flag3) + { + text = "idstrategy@fourelements.sg"; + password = "idstra4ec2014"; + displayName = "ID Strategy"; + } + bool flag4 = firstTheme.ToLower() == "port"; + if (flag4) + { + text = "portfolio@fourelements.sg"; + password = "JaeVKpPF0j8F"; + displayName = "Portfolio"; + } + bool flag5 = firstTheme.ToLower() == "execution"; + if (flag5) + { + text = "execution@fourelements.sg"; + password = "n1ngm1KObdbx"; + displayName = "Execution"; + } + bool flag6 = firstTheme.ToLower() == "bb"; + if (flag6) + { + text = "bb@fourelements.sg"; + password = "jpUb3Eurer0u"; + displayName = themeEmail.DisplayName; + } + bool flag7 = firstTheme.ToLower() == "reporting.external"; + if (flag7) + { + text = "info@fourelements.sg"; + password = "infoEC2014"; + displayName = "Four Elements Capital"; + } + bool flag8 = firstTheme.ToLower() == "quantopen"; + if (flag8) + { + text = "quantopen@fourelements.sg"; + password = "quant2017"; + displayName = "QuantOpen"; + } + bool flag9 = firstTheme.ToLower() == "alphien"; + if (flag9) + { + text = "alphien@fourelements.sg"; + password = "alph2017"; + displayName = "Alphien"; + } + MailAddress from = new MailAddress(text, displayName); + this.message = new MailMessage(); + this.message.From = from; + foreach (string text2 in this.Recipients.Split(new char[] + { + ',' + })) + { + string address = text2.ToLower().Replace("ls@4ecap.com", "lionel@4ecap.com"); + this.message.To.Add(new MailAddress(address)); + } + bool flag10 = this.EmailCC != null; + if (flag10) + { + foreach (string text3 in this.EmailCC.Split(new char[] + { + ',' + })) + { + string address2 = text3.ToLower().Replace("ls@4ecap.com", "lionel@4ecap.com"); + this.message.CC.Add(new MailAddress(address2)); + } + } + bool flag11 = this.EmailBCC != null; + if (flag11) + { + foreach (string address3 in this.EmailBCC.Split(new char[] + { + ',' + })) + { + this.message.Bcc.Add(new MailAddress(address3)); + } + } + bool flag12 = this.EmailReplyTo != null; + if (flag12) + { + foreach (string address4 in this.EmailReplyTo.Split(new char[] + { + ',' + })) + { + this.message.ReplyToList.Add(new MailAddress(address4)); + } + } + this.message.Subject = this.Subject; + bool phoneit = this.Phoneit; + if (phoneit) + { + this.message.Subject = "☎Phone: " + this.Subject; + } + bool flag13 = this.Escalation != null; + if (flag13) + { + bool flag14 = this.Escalation.StartsWith("Override"); + if (flag14) + { + } + } + this.message.Body = this.Body; + this.message.IsBodyHtml = true; + bool flag15 = !ignoreAttach; + if (flag15) + { + bool flag16 = this.Attachments != null; + if (flag16) + { + foreach (string text4 in this.Attachments.Split(new char[] + { + ',' + })) + { + bool flag17 = text4.Trim() != ""; + if (flag17) + { + Attachment item = new Attachment(text4); + this.message.Attachments.Add(item); + this.message.Priority = MailPriority.High; + } + } + } + bool flag18 = this.Images != null; + if (flag18) + { + string text5 = ""; + int num = 0; + List list = new List(); + foreach (string text6 in this.Images.Split(new char[] + { + ',' + })) + { + bool flag19 = text6.Trim() != ""; + if (flag19) + { + Guid guid = Guid.NewGuid(); + text5 = text5 + "embeddedimage"; + list.Add(guid.ToString()); + num++; + } + } + bool flag20 = this.Body.Contains("{{{IMG}}}"); + AlternateView alternateView; + if (flag20) + { + alternateView = AlternateView.CreateAlternateViewFromString(this.Body.Replace("{{{IMG}}}", text5), null, "text/html"); + } + else + { + alternateView = AlternateView.CreateAlternateViewFromString(this.Body + "
" + text5, null, "text/html"); + } + num = 0; + foreach (string text7 in this.Images.Split(new char[] + { + ',' + })) + { + bool flag21 = text7.Trim() != ""; + if (flag21) + { + LinkedResource linkedResource = new LinkedResource(text7); + linkedResource.ContentId = "embeddedImage_" + list[num]; + linkedResource.TransferEncoding = TransferEncoding.Base64; + alternateView.LinkedResources.Add(linkedResource); + num++; + } + } + this.message.AlternateViews.Add(alternateView); + } + } + this.sc = new SmtpClient(); + this.sc.Host = "smtp.gmail.com"; + this.sc.Port = 587; + this.sc.EnableSsl = true; + ServicePointManager.ServerCertificateValidationCallback += (p0, p1, p2, p3) => true; + bool flag22 = firstTheme.ToLower() == "etrading" || firstTheme.ToLower() == "idstrategy" || firstTheme.ToLower() == "port" || firstTheme.ToLower() == "execution" || firstTheme.ToLower() == "bb" || firstTheme.ToLower() == "quantopen" || firstTheme.ToLower() == "alphien"; + if (flag22) + { + this.sc.Host = Settings.Default.FourElementsMailServer; + this.sc.Port = Settings.Default.FourElementsMailServerPort; + } + this.sc.Credentials = new NetworkCredential(text, password); + this.sc.SendCompleted += this.sc_SendCompleted; + try + { + this.SendingEmailStatus = "Processing..."; + this.sc.Send(this.message); + this.SendingEmailStatus = "Sent - " + this.sc.Host + DateTime.Now.ToShortTimeString(); + } + catch (Exception ex) + { + this.SendingEmailStatus = "Error - " + ex.Message; + bool flag23 = themeEmail.BackupEmail != ""; + if (flag23) + { + try + { + this.sc.Credentials = new NetworkCredential(themeEmail.BackupEmail, themeEmail.BackupPassword); + this.SendingEmailStatus = "Backup Processing..."; + this.sc.Send(this.message); + this.SendingEmailStatus = "Sent Backup- " + DateTime.Now.ToShortTimeString(); + } + catch (Exception ex2) + { + this.SendingEmailStatus = "Error Backup - " + ex2.Message; + this.Say("Error sending email: " + this.Subject); + } + } + } + foreach (Attachment attachment in this.message.Attachments) + { + attachment.Dispose(); + } + foreach (AlternateView alternateView2 in this.message.AlternateViews) + { + alternateView2.Dispose(); + } + this.message.AlternateViews.Dispose(); + this.message.Attachments.Dispose(); + } + + // Token: 0x06000128 RID: 296 RVA: 0x0000B808 File Offset: 0x00009A08 + private void CheckSent(object state) + { + bool flag = this.SendingEmailStatus.StartsWith("Sent"); + if (flag) + { + this.timer.Dispose(); + } + else + { + try + { + this.sc.SendAsyncCancel(); + this.SendingEmailStatus = "Retrying - " + DateTime.Now.ToShortTimeString(); + this.sc.Send(this.message); + this.SendingEmailStatus = "Sent - " + this.sc.Host + DateTime.Now.ToShortTimeString(); + Logger.Log("Sync SendCompleted: " + this.Subject + " Status: Sent", "EmailLogs", "iMonitor"); + this.timer.Dispose(); + } + catch (Exception ex) + { + this.timer.Dispose(); + SocketClient.Send(Settings.Default.PhoneIP, Settings.Default.SpeechPort, "Unable to send emails"); + Logger.Log("Error Speech Sent: Unable to send emails", "SpeechLogs", "iMonitor"); + this.SendingEmailStatus = "Error - " + ex.Message; + } + } + } + + // Token: 0x06000129 RID: 297 RVA: 0x0000B940 File Offset: 0x00009B40 + private void sc_SendCompleted(object sender, AsyncCompletedEventArgs e) + { + string text = (string)e.UserState; + Logger.Log("SendCompleted: " + this.Subject + " Status:" + text, "EmailLogs", "iMonitor"); + bool cancelled = e.Cancelled; + if (cancelled) + { + this.SendingEmailStatus = "Cancelled - " + text; + } + bool flag = e.Error != null; + if (flag) + { + this.SendingEmailStatus = "Error - " + text; + } + else + { + this.SendingEmailStatus = "Sent - " + DateTime.Now.ToShortTimeString(); + } + foreach (Attachment attachment in this.message.Attachments) + { + attachment.Dispose(); + } + foreach (AlternateView alternateView in this.message.AlternateViews) + { + alternateView.Dispose(); + } + this.message.AlternateViews.Dispose(); + this.message.Attachments.Dispose(); + } + + // Token: 0x0600012A RID: 298 RVA: 0x0000BAA0 File Offset: 0x00009CA0 + public static string GetAlarmXML(string subject, List themes, string body, string overridealarmlevel = "NULL", bool say = true, bool email = true, string phone = "AUTO-m", int escalateTicks = 5, int escalateInterval = 15, string uri = "http://4ecappcsg11:5001/Convertor.aspx") + { + string text = ""; + text = text + "" + subject + ""; + foreach (string str in themes) + { + text = text + "" + str + ""; + } + text = text + "" + body + ""; + text = text + "" + overridealarmlevel + ""; + text = text + "" + say.ToString().ToUpper() + ""; + text = text + "" + email.ToString().ToUpper() + ""; + text = text + "" + phone + ""; + text = text + "" + escalateTicks.ToString() + ""; + text = text + "" + escalateInterval.ToString() + ""; + text += ""; + Uri address = new Uri(uri); + string result; + using (WebClient webClient = new WebClient()) + { + string text2 = webClient.UploadString(address, "POST", text); + result = text2; + } + return result; + } + + // Token: 0x040000C9 RID: 201 + private ThemeEmails themeEmails; + + // Token: 0x040000CA RID: 202 + private MailMessage message; + + // Token: 0x040000CB RID: 203 + private SmtpClient sc; + + // Token: 0x040000CC RID: 204 + private Dictionary dick; + + // Token: 0x040000CD RID: 205 + private Timer timer; + } +} diff --git a/PhoneCall.cs b/PhoneCall.cs new file mode 100644 index 0000000..93a6107 --- /dev/null +++ b/PhoneCall.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +namespace iMonitorApp +{ + // Token: 0x0200001A RID: 26 + public class PhoneCall + { + // Token: 0x1700001C RID: 28 + // (get) Token: 0x060000BC RID: 188 RVA: 0x00008461 File Offset: 0x00006661 + // (set) Token: 0x060000BD RID: 189 RVA: 0x00008469 File Offset: 0x00006669 + public int Count { get; set; } + + // Token: 0x1700001D RID: 29 + // (get) Token: 0x060000BE RID: 190 RVA: 0x00008472 File Offset: 0x00006672 + // (set) Token: 0x060000BF RID: 191 RVA: 0x0000847A File Offset: 0x0000667A + public string Status { get; set; } + + // Token: 0x1700001E RID: 30 + // (get) Token: 0x060000C0 RID: 192 RVA: 0x00008483 File Offset: 0x00006683 + // (set) Token: 0x060000C1 RID: 193 RVA: 0x0000848B File Offset: 0x0000668B + public List Numbers { get; set; } + } +} diff --git a/PhoneDialer.Designer.cs b/PhoneDialer.Designer.cs new file mode 100644 index 0000000..92e95ba --- /dev/null +++ b/PhoneDialer.Designer.cs @@ -0,0 +1,106 @@ +namespace iMonitorApp +{ + // Token: 0x02000018 RID: 24 + public partial class PhoneDialer : global::System.Windows.Forms.Form + { + // Token: 0x060000B8 RID: 184 RVA: 0x00007FAC File Offset: 0x000061AC + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x060000B9 RID: 185 RVA: 0x00007FE4 File Offset: 0x000061E4 + private void InitializeComponent() + { + this.tb_log = new global::System.Windows.Forms.TextBox(); + this.groupBox1 = new global::System.Windows.Forms.GroupBox(); + this.button2 = new global::System.Windows.Forms.Button(); + this.lbl_callstatus = new global::System.Windows.Forms.Label(); + this.lbl_skypestatus = new global::System.Windows.Forms.Label(); + this.lbl_connectionStatus = new global::System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + base.SuspendLayout(); + this.tb_log.BackColor = global::System.Drawing.Color.Black; + this.tb_log.Font = new global::System.Drawing.Font("Consolas", 9f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_log.ForeColor = global::System.Drawing.Color.LightGreen; + this.tb_log.Location = new global::System.Drawing.Point(12, 147); + this.tb_log.Multiline = true; + this.tb_log.Name = "tb_log"; + this.tb_log.Size = new global::System.Drawing.Size(665, 155); + this.tb_log.TabIndex = 0; + this.groupBox1.Controls.Add(this.button2); + this.groupBox1.Controls.Add(this.lbl_callstatus); + this.groupBox1.Controls.Add(this.lbl_skypestatus); + this.groupBox1.Controls.Add(this.lbl_connectionStatus); + this.groupBox1.Location = new global::System.Drawing.Point(13, 13); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new global::System.Drawing.Size(347, 128); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Properties"; + this.button2.Location = new global::System.Drawing.Point(21, 95); + this.button2.Name = "button2"; + this.button2.Size = new global::System.Drawing.Size(307, 23); + this.button2.TabIndex = 6; + this.button2.Text = "Test Phone"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new global::System.EventHandler(this.button2_Click); + this.lbl_callstatus.AutoSize = true; + this.lbl_callstatus.Location = new global::System.Drawing.Point(18, 79); + this.lbl_callstatus.Name = "lbl_callstatus"; + this.lbl_callstatus.Size = new global::System.Drawing.Size(57, 13); + this.lbl_callstatus.TabIndex = 2; + this.lbl_callstatus.Text = "Call Status"; + this.lbl_skypestatus.AutoSize = true; + this.lbl_skypestatus.Location = new global::System.Drawing.Point(18, 54); + this.lbl_skypestatus.Name = "lbl_skypestatus"; + this.lbl_skypestatus.Size = new global::System.Drawing.Size(70, 13); + this.lbl_skypestatus.TabIndex = 1; + this.lbl_skypestatus.Text = "Skype Status"; + this.lbl_connectionStatus.AutoSize = true; + this.lbl_connectionStatus.Location = new global::System.Drawing.Point(18, 27); + this.lbl_connectionStatus.Name = "lbl_connectionStatus"; + this.lbl_connectionStatus.Size = new global::System.Drawing.Size(94, 13); + this.lbl_connectionStatus.TabIndex = 0; + this.lbl_connectionStatus.Text = "Connection Status"; + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + base.ClientSize = new global::System.Drawing.Size(689, 313); + base.Controls.Add(this.groupBox1); + base.Controls.Add(this.tb_log); + base.Name = "PhoneDialer"; + base.ShowInTaskbar = false; + this.Text = "PhoneCall"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + base.ResumeLayout(false); + base.PerformLayout(); + } + + // Token: 0x04000070 RID: 112 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x04000071 RID: 113 + private global::System.Windows.Forms.TextBox tb_log; + + // Token: 0x04000072 RID: 114 + private global::System.Windows.Forms.GroupBox groupBox1; + + // Token: 0x04000073 RID: 115 + private global::System.Windows.Forms.Label lbl_callstatus; + + // Token: 0x04000074 RID: 116 + private global::System.Windows.Forms.Label lbl_skypestatus; + + // Token: 0x04000075 RID: 117 + private global::System.Windows.Forms.Label lbl_connectionStatus; + + // Token: 0x04000076 RID: 118 + private global::System.Windows.Forms.Button button2; + } +} diff --git a/PhoneDialer.cs b/PhoneDialer.cs new file mode 100644 index 0000000..5afa919 --- /dev/null +++ b/PhoneDialer.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using iMonitorApp.Classes; +using iMonitorApp.Properties; + +namespace iMonitorApp +{ + // Token: 0x02000018 RID: 24 + public partial class PhoneDialer : Form + { + // Token: 0x060000AA RID: 170 RVA: 0x0000770C File Offset: 0x0000590C + public PhoneDialer(ParentForm pf) + { + this.parentForm = pf; + this.InitializeComponent(); + this.Initialize(); + } + + // Token: 0x060000AB RID: 171 RVA: 0x00007740 File Offset: 0x00005940 + public void Initialize() + { + try + { + } + catch + { + MessageBox.Show("Unable to get Skype Handle\r\n Reboot skype and Click Tools -> Options -> ConnectToSkype"); + } + BackgroundWorker backgroundWorker = new BackgroundWorker(); + backgroundWorker.DoWork += this.bw_DoWork; + backgroundWorker.RunWorkerAsync(); + this.li = new AsyncBindingList(this); + this._queue = new ConcurrentQueue(); + this.li.ListChanged += this.li_ListChanged; + Thread thread = new Thread(new ThreadStart(this.LaunchListener)); + thread.Start(); + new System.Windows.Forms.Timer + { + Interval = 10000 + }.Tick += this.timer_Tick; + } + + // Token: 0x060000AC RID: 172 RVA: 0x00007800 File Offset: 0x00005A00 + private void timer_Tick(object sender, EventArgs e) + { + try + { + bool isRunning = this.sw.IsRunning; + if (isRunning) + { + bool flag = this.sw.Elapsed.TotalSeconds > 60.0; + if (flag) + { + this.Log("Stopwatch Elapsed Secs:" + this.sw.Elapsed.TotalSeconds.ToString()); + bool flag2 = this.sw.Elapsed.TotalSeconds > 300.0; + if (flag2) + { + HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://202.58.207.66/ectime/phonecall.php?email=manas@4ecap.com,sd@4ecap.com&phone=+6596999610,+6590211987&subject=EMERGENCY_SKYPE_NOT_WORKING"); + string str = Convert.ToBase64String(Encoding.ASCII.GetBytes(Settings.Default.ExternalHeartbeatUsername + ":" + Settings.Default.ExternalHeartbeatPassword)); + httpWebRequest.Headers.Add("Authorization", "Basic " + str); + httpWebRequest.ReadWriteTimeout = 30000; + httpWebRequest.Timeout = 30000; + httpWebRequest.Method = "GET"; + HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); + } + } + } + } + catch + { + } + } + + // Token: 0x060000AD RID: 173 RVA: 0x00007958 File Offset: 0x00005B58 + private void bw_DoWork(object sender, DoWorkEventArgs e) + { + try + { + } + catch + { + } + } + + // Token: 0x060000AE RID: 174 RVA: 0x00007980 File Offset: 0x00005B80 + private void LaunchListener() + { + this.asl = new AsynchronousSocketListener(Settings.Default.CurrentIP, Settings.Default.PhonePort); + AsynchronousSocketListener.Received += this.AsynchronousSocketListener_Received; + this.Log("Listening on port: " + Settings.Default.PhonePort.ToString() + " IP: " + Settings.Default.CurrentIP); + AsynchronousSocketListener.StartListening(); + } + + // Token: 0x060000AF RID: 175 RVA: 0x000038AE File Offset: 0x00001AAE + private void li_ListChanged(object sender, ListChangedEventArgs e) + { + } + + // Token: 0x060000B0 RID: 176 RVA: 0x000079F8 File Offset: 0x00005BF8 + private void ProcessQueue() + { + try + { + } + catch + { + } + PhoneCall phoneCall; + bool flag = this._queue.TryDequeue(out phoneCall); + bool flag2 = flag; + if (flag2) + { + bool flag3 = !PhoneScheduleCheck.IsPhoneActive(); + if (flag3) + { + this.Log("Phone Disabled in Schedule"); + int num = 2; + int frequency = 4000; + int duration = 200; + for (int i = 0; i < num; i++) + { + Console.Beep(frequency, duration); + } + } + else + { + try + { + } + catch + { + } + foreach (string text in phoneCall.Numbers) + { + try + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + string requestUriString = "https://secure.hoiio.com/open/ivr/start/dial?dest=" + text + "&access_token=ssMWqlCqLcJUElOv&app_id=hQKILptEKhHNqXSC&msg=Call&caller_id=private"; + HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(requestUriString); + HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); + using (Stream responseStream = httpWebResponse.GetResponseStream()) + { + using (StreamReader streamReader = new StreamReader(responseStream)) + { + string text2 = streamReader.ReadToEnd(); + } + } + string str = "Dialed: "; + string str2 = text; + string str3 = " Response: "; + HttpWebResponse httpWebResponse2 = httpWebResponse; + this.Log(str + str2 + str3 + ((httpWebResponse2 != null) ? httpWebResponse2.ToString() : null)); + } + catch (Exception ex) + { + this.Log("Exception: " + ex.Message); + } + } + this.Log("Stop Watch Started"); + this.Log("Dialing: " + string.Join(" , ", phoneCall.Numbers)); + } + } + } + + // Token: 0x060000B1 RID: 177 RVA: 0x00007BF4 File Offset: 0x00005DF4 + private void AsynchronousSocketListener_Received(object sender, EventArgs e) + { + this.Log("Received: " + sender.ToString()); + string text = sender.ToString().Replace("", ""); + List list = (from t in text.Split(new char[] + { + ',' + }).ToList() + where t.Trim() != "" + select t).ToList(); + List list2 = new List(); + foreach (string text2 in list) + { + string text3 = text2.Replace(" ", ""); + text3 = text3.Trim(); + bool flag = text3[0] != '+'; + if (!flag) + { + list2.Add(text3); + } + } + PhoneCall item = new PhoneCall + { + Numbers = list2, + Count = list.Count, + Status = "Queued" + }; + this._queue.Enqueue(item); + this.ProcessQueue(); + } + + // Token: 0x060000B2 RID: 178 RVA: 0x00007D30 File Offset: 0x00005F30 + private void skype_ContactsFocused(string Username) + { + this.Log(Username + " focused"); + } + + // Token: 0x060000B3 RID: 179 RVA: 0x00007D48 File Offset: 0x00005F48 + public void Log(string text) + { + bool invokeRequired = this.tb_log.InvokeRequired; + if (invokeRequired) + { + this.tb_log.Invoke(new Action(delegate() + { + this.tb_log.Text = string.Concat(new string[] + { + DateTime.Now.ToString("dd/MMM hh:mm:ss"), + " ", + text, + "\r\n", + this.tb_log.Text + }); + })); + } + else + { + this.tb_log.Text = string.Concat(new string[] + { + DateTime.Now.ToString("dd/MMM hh:mm:ss"), + " ", + text, + "\r\n", + this.tb_log.Text + }); + } + } + + // Token: 0x060000B4 RID: 180 RVA: 0x00007DE8 File Offset: 0x00005FE8 + public void StatusUpdate(string text) + { + StatusStrip a = (StatusStrip)base.MdiParent.Controls["statusStrip"]; + bool invokeRequired = a.InvokeRequired; + if (invokeRequired) + { + a.Invoke(new Action(delegate() + { + a.Text = text; + })); + } + else + { + a.Text = text; + } + } + + // Token: 0x060000B5 RID: 181 RVA: 0x00007E60 File Offset: 0x00006060 + public void UpdateLabel(Label l, string text) + { + bool invokeRequired = l.InvokeRequired; + if (invokeRequired) + { + l.Invoke(new Action(delegate() + { + l.Text = text; + })); + } + else + { + l.Text = text; + } + } + + // Token: 0x060000B6 RID: 182 RVA: 0x00007EC0 File Offset: 0x000060C0 + private void button1_Click(object sender, EventArgs e) + { + PhoneSchedule phoneSchedule = new PhoneSchedule(); + phoneSchedule.ShowDialog(); + } + + // Token: 0x060000B7 RID: 183 RVA: 0x00007EDC File Offset: 0x000060DC + private void button2_Click(object sender, EventArgs e) + { + try + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + string text = "https://secure.hoiio.com/open/ivr/start/dial?dest=6596999610&access_token=ssMWqlCqLcJUElOv&app_id=hQKILptEKhHNqXSC&msg=Call&caller_id=private"; + this.Log(text); + HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(text); + HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); + string text2; + using (Stream responseStream = httpWebResponse.GetResponseStream()) + { + using (StreamReader streamReader = new StreamReader(responseStream)) + { + text2 = streamReader.ReadToEnd(); + } + } + this.Log(text2); + } + catch (Exception ex) + { + this.Log("Exception: " + ex.Message); + } + } + + // Token: 0x0400006B RID: 107 + private ParentForm parentForm; + + // Token: 0x0400006C RID: 108 + private AsynchronousSocketListener asl; + + // Token: 0x0400006D RID: 109 + public AsyncBindingList li; + + // Token: 0x0400006E RID: 110 + private ConcurrentQueue _queue; + + // Token: 0x0400006F RID: 111 + private Stopwatch sw = new Stopwatch(); + } +} diff --git a/PhoneDialer.resources b/PhoneDialer.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/PhoneDialer.resources differ diff --git a/PhoneSchedule.Designer.cs b/PhoneSchedule.Designer.cs new file mode 100644 index 0000000..6b6f283 --- /dev/null +++ b/PhoneSchedule.Designer.cs @@ -0,0 +1,206 @@ +namespace iMonitorApp +{ + // Token: 0x02000010 RID: 16 + public partial class PhoneSchedule : global::System.Windows.Forms.Form + { + // Token: 0x06000072 RID: 114 RVA: 0x000050CC File Offset: 0x000032CC + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x06000073 RID: 115 RVA: 0x00005104 File Offset: 0x00003304 + private void InitializeComponent() + { + this.label1 = new global::System.Windows.Forms.Label(); + this.label2 = new global::System.Windows.Forms.Label(); + this.label3 = new global::System.Windows.Forms.Label(); + this.label4 = new global::System.Windows.Forms.Label(); + this.label5 = new global::System.Windows.Forms.Label(); + this.label6 = new global::System.Windows.Forms.Label(); + this.tb_monday = new global::System.Windows.Forms.TextBox(); + this.tb_tuesday = new global::System.Windows.Forms.TextBox(); + this.tb_wednesday = new global::System.Windows.Forms.TextBox(); + this.tb_thursday = new global::System.Windows.Forms.TextBox(); + this.tb_friday = new global::System.Windows.Forms.TextBox(); + this.tb_saturday = new global::System.Windows.Forms.TextBox(); + this.tb_sunday = new global::System.Windows.Forms.TextBox(); + this.label7 = new global::System.Windows.Forms.Label(); + this.button1 = new global::System.Windows.Forms.Button(); + this.label8 = new global::System.Windows.Forms.Label(); + base.SuspendLayout(); + this.label1.AutoSize = true; + this.label1.Location = new global::System.Drawing.Point(38, 56); + this.label1.Name = "label1"; + this.label1.Size = new global::System.Drawing.Size(45, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Monday"; + this.label2.AutoSize = true; + this.label2.Location = new global::System.Drawing.Point(38, 92); + this.label2.Name = "label2"; + this.label2.Size = new global::System.Drawing.Size(48, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Tuesday"; + this.label3.AutoSize = true; + this.label3.Location = new global::System.Drawing.Point(38, 128); + this.label3.Name = "label3"; + this.label3.Size = new global::System.Drawing.Size(64, 13); + this.label3.TabIndex = 2; + this.label3.Text = "Wednesday"; + this.label4.AutoSize = true; + this.label4.Location = new global::System.Drawing.Point(38, 164); + this.label4.Name = "label4"; + this.label4.Size = new global::System.Drawing.Size(51, 13); + this.label4.TabIndex = 3; + this.label4.Text = "Thursday"; + this.label5.AutoSize = true; + this.label5.Location = new global::System.Drawing.Point(38, 200); + this.label5.Name = "label5"; + this.label5.Size = new global::System.Drawing.Size(35, 13); + this.label5.TabIndex = 4; + this.label5.Text = "Friday"; + this.label6.AutoSize = true; + this.label6.Location = new global::System.Drawing.Point(38, 236); + this.label6.Name = "label6"; + this.label6.Size = new global::System.Drawing.Size(49, 13); + this.label6.TabIndex = 5; + this.label6.Text = "Saturday"; + this.tb_monday.Font = new global::System.Drawing.Font("Microsoft Sans Serif", 10f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_monday.Location = new global::System.Drawing.Point(143, 56); + this.tb_monday.Name = "tb_monday"; + this.tb_monday.Size = new global::System.Drawing.Size(228, 23); + this.tb_monday.TabIndex = 6; + this.tb_monday.Text = "(0000-0900), (1300-1400), (1830-2359)"; + this.tb_tuesday.Font = new global::System.Drawing.Font("Microsoft Sans Serif", 10f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_tuesday.Location = new global::System.Drawing.Point(143, 91); + this.tb_tuesday.Name = "tb_tuesday"; + this.tb_tuesday.Size = new global::System.Drawing.Size(228, 23); + this.tb_tuesday.TabIndex = 7; + this.tb_tuesday.Text = "(0000-0900), (1830-2359)"; + this.tb_wednesday.Font = new global::System.Drawing.Font("Microsoft Sans Serif", 10f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_wednesday.Location = new global::System.Drawing.Point(143, 126); + this.tb_wednesday.Name = "tb_wednesday"; + this.tb_wednesday.Size = new global::System.Drawing.Size(228, 23); + this.tb_wednesday.TabIndex = 8; + this.tb_thursday.Font = new global::System.Drawing.Font("Microsoft Sans Serif", 10f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_thursday.Location = new global::System.Drawing.Point(143, 161); + this.tb_thursday.Name = "tb_thursday"; + this.tb_thursday.Size = new global::System.Drawing.Size(228, 23); + this.tb_thursday.TabIndex = 9; + this.tb_friday.Font = new global::System.Drawing.Font("Microsoft Sans Serif", 10f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_friday.Location = new global::System.Drawing.Point(143, 196); + this.tb_friday.Name = "tb_friday"; + this.tb_friday.Size = new global::System.Drawing.Size(228, 23); + this.tb_friday.TabIndex = 10; + this.tb_saturday.Font = new global::System.Drawing.Font("Microsoft Sans Serif", 10f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_saturday.Location = new global::System.Drawing.Point(143, 231); + this.tb_saturday.Name = "tb_saturday"; + this.tb_saturday.Size = new global::System.Drawing.Size(228, 23); + this.tb_saturday.TabIndex = 11; + this.tb_sunday.Font = new global::System.Drawing.Font("Microsoft Sans Serif", 10f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_sunday.Location = new global::System.Drawing.Point(143, 266); + this.tb_sunday.Name = "tb_sunday"; + this.tb_sunday.Size = new global::System.Drawing.Size(228, 23); + this.tb_sunday.TabIndex = 13; + this.label7.AutoSize = true; + this.label7.Location = new global::System.Drawing.Point(38, 272); + this.label7.Name = "label7"; + this.label7.Size = new global::System.Drawing.Size(43, 13); + this.label7.TabIndex = 12; + this.label7.Text = "Sunday"; + this.button1.Location = new global::System.Drawing.Point(143, 295); + this.button1.Name = "button1"; + this.button1.Size = new global::System.Drawing.Size(75, 23); + this.button1.TabIndex = 14; + this.button1.Text = "Save"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new global::System.EventHandler(this.button1_Click); + this.label8.AutoSize = true; + this.label8.Font = new global::System.Drawing.Font("Microsoft Sans Serif", 8.25f, global::System.Drawing.FontStyle.Italic, global::System.Drawing.GraphicsUnit.Point, 0); + this.label8.Location = new global::System.Drawing.Point(12, 28); + this.label8.Name = "label8"; + this.label8.Size = new global::System.Drawing.Size(379, 13); + this.label8.TabIndex = 15; + this.label8.Text = "Syntax: (starttime1-endtime1), (starttime2-endtime2)... TimeFormat: hhmm (24-hr)"; + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + base.ClientSize = new global::System.Drawing.Size(413, 328); + base.Controls.Add(this.label8); + base.Controls.Add(this.button1); + base.Controls.Add(this.tb_sunday); + base.Controls.Add(this.label7); + base.Controls.Add(this.tb_saturday); + base.Controls.Add(this.tb_friday); + base.Controls.Add(this.tb_thursday); + base.Controls.Add(this.tb_wednesday); + base.Controls.Add(this.tb_tuesday); + base.Controls.Add(this.tb_monday); + base.Controls.Add(this.label6); + base.Controls.Add(this.label5); + base.Controls.Add(this.label4); + base.Controls.Add(this.label3); + base.Controls.Add(this.label2); + base.Controls.Add(this.label1); + base.Name = "PhoneSchedule"; + this.Text = "PhoneSchedule"; + base.ResumeLayout(false); + base.PerformLayout(); + } + + // Token: 0x04000040 RID: 64 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x04000041 RID: 65 + private global::System.Windows.Forms.Label label1; + + // Token: 0x04000042 RID: 66 + private global::System.Windows.Forms.Label label2; + + // Token: 0x04000043 RID: 67 + private global::System.Windows.Forms.Label label3; + + // Token: 0x04000044 RID: 68 + private global::System.Windows.Forms.Label label4; + + // Token: 0x04000045 RID: 69 + private global::System.Windows.Forms.Label label5; + + // Token: 0x04000046 RID: 70 + private global::System.Windows.Forms.Label label6; + + // Token: 0x04000047 RID: 71 + private global::System.Windows.Forms.TextBox tb_monday; + + // Token: 0x04000048 RID: 72 + private global::System.Windows.Forms.TextBox tb_tuesday; + + // Token: 0x04000049 RID: 73 + private global::System.Windows.Forms.TextBox tb_wednesday; + + // Token: 0x0400004A RID: 74 + private global::System.Windows.Forms.TextBox tb_thursday; + + // Token: 0x0400004B RID: 75 + private global::System.Windows.Forms.TextBox tb_friday; + + // Token: 0x0400004C RID: 76 + private global::System.Windows.Forms.TextBox tb_saturday; + + // Token: 0x0400004D RID: 77 + private global::System.Windows.Forms.TextBox tb_sunday; + + // Token: 0x0400004E RID: 78 + private global::System.Windows.Forms.Label label7; + + // Token: 0x0400004F RID: 79 + private global::System.Windows.Forms.Button button1; + + // Token: 0x04000050 RID: 80 + private global::System.Windows.Forms.Label label8; + } +} diff --git a/PhoneSchedule.cs b/PhoneSchedule.cs new file mode 100644 index 0000000..0c542a2 --- /dev/null +++ b/PhoneSchedule.cs @@ -0,0 +1,95 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using iMonitorApp.Classes; +using iMonitorApp.Properties; + +namespace iMonitorApp +{ + // Token: 0x02000010 RID: 16 + public partial class PhoneSchedule : Form + { + // Token: 0x06000070 RID: 112 RVA: 0x00004E90 File Offset: 0x00003090 + public PhoneSchedule() + { + this.InitializeComponent(); + this.tb_monday.Text = Settings.Default.PhoneMondayTime; + this.tb_tuesday.Text = Settings.Default.PhoneTuesdayTime; + this.tb_wednesday.Text = Settings.Default.PhoneWednesdayTime; + this.tb_thursday.Text = Settings.Default.PhoneThursdayTime; + this.tb_friday.Text = Settings.Default.PhoneFridayTime; + this.tb_saturday.Text = Settings.Default.PhoneSaturdayTime; + this.tb_sunday.Text = Settings.Default.PhoneSundayTime; + } + + // Token: 0x06000071 RID: 113 RVA: 0x00004F50 File Offset: 0x00003150 + private void button1_Click(object sender, EventArgs e) + { + bool flag = PhoneScheduleCheck.CheckSyntax(DayOfWeek.Monday); + if (flag) + { + Settings.Default.PhoneMondayTime = this.tb_monday.Text; + bool flag2 = PhoneScheduleCheck.CheckSyntax(DayOfWeek.Tuesday); + if (flag2) + { + Settings.Default.PhoneTuesdayTime = this.tb_tuesday.Text; + bool flag3 = PhoneScheduleCheck.CheckSyntax(DayOfWeek.Wednesday); + if (flag3) + { + Settings.Default.PhoneWednesdayTime = this.tb_wednesday.Text; + bool flag4 = PhoneScheduleCheck.CheckSyntax(DayOfWeek.Thursday); + if (flag4) + { + Settings.Default.PhoneThursdayTime = this.tb_thursday.Text; + bool flag5 = PhoneScheduleCheck.CheckSyntax(DayOfWeek.Friday); + if (flag5) + { + Settings.Default.PhoneFridayTime = this.tb_friday.Text; + bool flag6 = PhoneScheduleCheck.CheckSyntax(DayOfWeek.Saturday); + if (flag6) + { + Settings.Default.PhoneSaturdayTime = this.tb_saturday.Text; + bool flag7 = PhoneScheduleCheck.CheckSyntax(DayOfWeek.Sunday); + if (flag7) + { + Settings.Default.PhoneSundayTime = this.tb_sunday.Text; + MessageBox.Show("Saved"); + } + else + { + MessageBox.Show("Error in syntax for Sunday"); + } + } + else + { + MessageBox.Show("Error in syntax for Saturday"); + } + } + else + { + MessageBox.Show("Error in syntax for Friday"); + } + } + else + { + MessageBox.Show("Error in syntax for Thursday"); + } + } + else + { + MessageBox.Show("Error in syntax for Wednesday"); + } + } + else + { + MessageBox.Show("Error in syntax for Tuesday"); + } + } + else + { + MessageBox.Show("Error in syntax for Monday"); + } + } + } +} diff --git a/PhoneSchedule.resources b/PhoneSchedule.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/PhoneSchedule.resources differ diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..0e8defd --- /dev/null +++ b/Program.cs @@ -0,0 +1,75 @@ +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Threading; +using System.Windows.Forms; +using _4ELogger; + +namespace iMonitorApp +{ + // Token: 0x0200001D RID: 29 + internal static class Program + { + // Token: 0x060000DF RID: 223 RVA: 0x0000A094 File Offset: 0x00008294 + [STAThread] + private static void Main() + { + Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); + Debug.AutoFlush = true; + bool flag = Program.PriorProcess() != null; + if (flag) + { + MessageBox.Show("Another instance of the app is already running."); + Program.SetForegroundWindow(Program.PriorProcess().MainWindowHandle); + } + else + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.ThreadException += Program.Application_ThreadException; + AppDomain.CurrentDomain.UnhandledException += Program.CurrentDomain_UnhandledException; + Application.Run(new ParentForm()); + } + } + + // Token: 0x060000E0 RID: 224 RVA: 0x0000A110 File Offset: 0x00008310 + private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + Exception ex = (Exception)e.ExceptionObject; + Logger.Log(string.Concat(new string[] + { + "CurrentDomain_Unhandled: Terminating: ", + e.IsTerminating.ToString(), + "Exception:", + ex.Message, + ex.StackTrace + }), "iMonitorApp", "iMonitor"); + } + + // Token: 0x060000E1 RID: 225 RVA: 0x0000A178 File Offset: 0x00008378 + private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + { + Logger.Log(e.Exception.Message + e.Exception.StackTrace, "iMonitorApp", "iMonitor"); + } + + // Token: 0x060000E2 RID: 226 + [DllImport("user32.dll")] + public static extern bool SetForegroundWindow(IntPtr hWnd); + + // Token: 0x060000E3 RID: 227 RVA: 0x0000A1A8 File Offset: 0x000083A8 + public static Process PriorProcess() + { + Process currentProcess = Process.GetCurrentProcess(); + Process[] processesByName = Process.GetProcessesByName(currentProcess.ProcessName); + foreach (Process process in processesByName) + { + bool flag = process.Id != currentProcess.Id && process.MainModule.FileName == currentProcess.MainModule.FileName; + if (flag) + { + return process; + } + } + return null; + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6ae22da --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +// using System; +// using System.Diagnostics; +// using System.Reflection; +// using System.Runtime.CompilerServices; +// using System.Runtime.InteropServices; +// using System.Runtime.Versioning; + +// [assembly: AssemblyVersion("1.0.0.0")] +// [assembly: AssemblyTitle("iMonitor")] +// [assembly: AssemblyDescription("")] +// [assembly: AssemblyConfiguration("")] +// [assembly: AssemblyCompany("Four Elements Capital")] +// [assembly: AssemblyProduct("iMonitor Server")] +// [assembly: AssemblyCopyright("Copyright © Four Elements Capital 2013")] +// [assembly: AssemblyTrademark("")] +// [assembly: ComVisible(false)] +// [assembly: Guid("74aeaf3a-96ce-4a51-90f4-1e9872262acb")] +// [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Properties/Resources.cs b/Properties/Resources.cs new file mode 100644 index 0000000..5f0f33b --- /dev/null +++ b/Properties/Resources.cs @@ -0,0 +1,116 @@ +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Resources; +using System.Runtime.CompilerServices; + +namespace iMonitorApp.Properties +{ + // Token: 0x02000025 RID: 37 + [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [DebuggerNonUserCode] + [CompilerGenerated] + internal class Resources + { + // Token: 0x0600019D RID: 413 RVA: 0x00002AAD File Offset: 0x00000CAD + internal Resources() + { + } + + // Token: 0x1700006A RID: 106 + // (get) Token: 0x0600019E RID: 414 RVA: 0x0000CE74 File Offset: 0x0000B074 + [EditorBrowsable(EditorBrowsableState.Advanced)] + internal static ResourceManager ResourceManager + { + get + { + bool flag = Resources.resourceMan == null; + if (flag) + { + ResourceManager resourceManager = new ResourceManager("iMonitorApp.Properties.Resources", typeof(Resources).Assembly); + Resources.resourceMan = resourceManager; + } + return Resources.resourceMan; + } + } + + // Token: 0x1700006B RID: 107 + // (get) Token: 0x0600019F RID: 415 RVA: 0x0000CEBC File Offset: 0x0000B0BC + // (set) Token: 0x060001A0 RID: 416 RVA: 0x0000CED3 File Offset: 0x0000B0D3 + [EditorBrowsable(EditorBrowsableState.Advanced)] + internal static CultureInfo Culture + { + get + { + return Resources.resourceCulture; + } + set + { + Resources.resourceCulture = value; + } + } + + // Token: 0x1700006C RID: 108 + // (get) Token: 0x060001A1 RID: 417 RVA: 0x0000CEDC File Offset: 0x0000B0DC + internal static Bitmap cancel + { + get + { + object @object = Resources.ResourceManager.GetObject("cancel", Resources.resourceCulture); + return (Bitmap)@object; + } + } + + // Token: 0x1700006D RID: 109 + // (get) Token: 0x060001A2 RID: 418 RVA: 0x0000CF0C File Offset: 0x0000B10C + internal static Bitmap Check + { + get + { + object @object = Resources.ResourceManager.GetObject("Check", Resources.resourceCulture); + return (Bitmap)@object; + } + } + + // Token: 0x1700006E RID: 110 + // (get) Token: 0x060001A3 RID: 419 RVA: 0x0000CF3C File Offset: 0x0000B13C + internal static Bitmap loading + { + get + { + object @object = Resources.ResourceManager.GetObject("loading", Resources.resourceCulture); + return (Bitmap)@object; + } + } + + // Token: 0x1700006F RID: 111 + // (get) Token: 0x060001A4 RID: 420 RVA: 0x0000CF6C File Offset: 0x0000B16C + internal static UnmanagedMemoryStream OpeningBellRingTone + { + get + { + return Resources.ResourceManager.GetStream("OpeningBellRingTone", Resources.resourceCulture); + } + } + + // Token: 0x17000070 RID: 112 + // (get) Token: 0x060001A5 RID: 421 RVA: 0x0000CF94 File Offset: 0x0000B194 + internal static UnmanagedMemoryStream photo + { + get + { + return Resources.ResourceManager.GetStream("photo", Resources.resourceCulture); + } + } + + // Token: 0x040000E4 RID: 228 + private static ResourceManager resourceMan; + + // Token: 0x040000E5 RID: 229 + private static CultureInfo resourceCulture; + } +} diff --git a/Properties/Resources.resources b/Properties/Resources.resources new file mode 100644 index 0000000..bff5325 Binary files /dev/null and b/Properties/Resources.resources differ diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..ca40c60 --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,859 @@ +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Configuration; +using System.Diagnostics; +using System.Runtime.CompilerServices; + +namespace iMonitorApp.Properties +{ + // Token: 0x02000024 RID: 36 + // [CompilerGenerated] + // [GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] + internal sealed partial class Settings : ApplicationSettingsBase + { + // Token: 0x1700003C RID: 60 + // (get) Token: 0x06000142 RID: 322 RVA: 0x0000C4EC File Offset: 0x0000A6EC + public static Settings Default + { + get + { + return Settings.defaultInstance; + } + } + + // Token: 0x1700003D RID: 61 + // (get) Token: 0x06000143 RID: 323 RVA: 0x0000C504 File Offset: 0x0000A704 + // (set) Token: 0x06000144 RID: 324 RVA: 0x0000C526 File Offset: 0x0000A726 + [UserScopedSetting] + [SettingsDescription("Port on which the Phone Alarms are sent")] + [DebuggerNonUserCode] + [DefaultSettingValue("5659")] + public int PhonePort + { + get + { + return (int)this["PhonePort"]; + } + set + { + this["PhonePort"] = value; + } + } + + // Token: 0x1700003E RID: 62 + // (get) Token: 0x06000145 RID: 325 RVA: 0x0000C53C File Offset: 0x0000A73C + // (set) Token: 0x06000146 RID: 326 RVA: 0x0000C55E File Offset: 0x0000A75E + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("10.153.64.3")] + public string MainDatabase + { + get + { + return (string)this["MainDatabase"]; + } + set + { + this["MainDatabase"] = value; + } + } + + // Token: 0x1700003F RID: 63 + // (get) Token: 0x06000147 RID: 327 RVA: 0x0000C570 File Offset: 0x0000A770 + // (set) Token: 0x06000148 RID: 328 RVA: 0x0000C592 File Offset: 0x0000A792 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("10.153.64.77")] + public string IntradayDatabase + { + get + { + return (string)this["IntradayDatabase"]; + } + set + { + this["IntradayDatabase"] = value; + } + } + + // Token: 0x17000040 RID: 64 + // (get) Token: 0x06000149 RID: 329 RVA: 0x0000C5A4 File Offset: 0x0000A7A4 + // (set) Token: 0x0600014A RID: 330 RVA: 0x0000C5C6 File Offset: 0x0000A7C6 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("5655")] + public int EmailPort + { + get + { + return (int)this["EmailPort"]; + } + set + { + this["EmailPort"] = value; + } + } + + // Token: 0x17000041 RID: 65 + // (get) Token: 0x0600014B RID: 331 RVA: 0x0000C5DC File Offset: 0x0000A7DC + // (set) Token: 0x0600014C RID: 332 RVA: 0x0000C5FE File Offset: 0x0000A7FE + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("5656")] + public int SpeechPort + { + get + { + return (int)this["SpeechPort"]; + } + set + { + this["SpeechPort"] = value; + } + } + + // Token: 0x17000042 RID: 66 + // (get) Token: 0x0600014D RID: 333 RVA: 0x0000C614 File Offset: 0x0000A814 + // (set) Token: 0x0600014E RID: 334 RVA: 0x0000C636 File Offset: 0x0000A836 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("")] + public string CurrentIP + { + get + { + return (string)this["CurrentIP"]; + } + set + { + this["CurrentIP"] = value; + } + } + + // Token: 0x17000043 RID: 67 + // (get) Token: 0x0600014F RID: 335 RVA: 0x0000C648 File Offset: 0x0000A848 + [UserScopedSetting] + [DebuggerNonUserCode] + [SpecialSetting(SpecialSetting.ConnectionString)] + [DefaultSettingValue("Data Source=4ecapsvsg1;Initial Catalog=tradingRef;Persist Security Info=True;User ID=dbuser;Password=dbuser")] + public string tradingRefConnectionString + { + get + { + return (string)this["tradingRefConnectionString"]; + } + } + + // Token: 0x17000044 RID: 68 + // (get) Token: 0x06000150 RID: 336 RVA: 0x0000C66C File Offset: 0x0000A86C + // (set) Token: 0x06000151 RID: 337 RVA: 0x0000C68E File Offset: 0x0000A88E + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("4ecaptrading@4ecap.com")] + public string DefaultEmailAddress + { + get + { + return (string)this["DefaultEmailAddress"]; + } + set + { + this["DefaultEmailAddress"] = value; + } + } + + // Token: 0x17000045 RID: 69 + // (get) Token: 0x06000152 RID: 338 RVA: 0x0000C6A0 File Offset: 0x0000A8A0 + // (set) Token: 0x06000153 RID: 339 RVA: 0x0000C6C2 File Offset: 0x0000A8C2 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("5658")] + public int SMSPort + { + get + { + return (int)this["SMSPort"]; + } + set + { + this["SMSPort"] = value; + } + } + + // Token: 0x17000046 RID: 70 + // (get) Token: 0x06000154 RID: 340 RVA: 0x0000C6D8 File Offset: 0x0000A8D8 + // (set) Token: 0x06000155 RID: 341 RVA: 0x0000C6FA File Offset: 0x0000A8FA + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("50")] + public int BackupCount + { + get + { + return (int)this["BackupCount"]; + } + set + { + this["BackupCount"] = value; + } + } + + // Token: 0x17000047 RID: 71 + // (get) Token: 0x06000156 RID: 342 RVA: 0x0000C710 File Offset: 0x0000A910 + // (set) Token: 0x06000157 RID: 343 RVA: 0x0000C732 File Offset: 0x0000A932 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("(0000-0900), (1300-1400), (1830-2359)")] + public string PhoneMondayTime + { + get + { + return (string)this["PhoneMondayTime"]; + } + set + { + this["PhoneMondayTime"] = value; + } + } + + // Token: 0x17000048 RID: 72 + // (get) Token: 0x06000158 RID: 344 RVA: 0x0000C744 File Offset: 0x0000A944 + // (set) Token: 0x06000159 RID: 345 RVA: 0x0000C766 File Offset: 0x0000A966 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("(0000-0900), (1300-1400), (1830-2359)")] + public string PhoneTuesdayTime + { + get + { + return (string)this["PhoneTuesdayTime"]; + } + set + { + this["PhoneTuesdayTime"] = value; + } + } + + // Token: 0x17000049 RID: 73 + // (get) Token: 0x0600015A RID: 346 RVA: 0x0000C778 File Offset: 0x0000A978 + // (set) Token: 0x0600015B RID: 347 RVA: 0x0000C79A File Offset: 0x0000A99A + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("(0000-0900), (1300-1400), (1830-2359)")] + public string PhoneWednesdayTime + { + get + { + return (string)this["PhoneWednesdayTime"]; + } + set + { + this["PhoneWednesdayTime"] = value; + } + } + + // Token: 0x1700004A RID: 74 + // (get) Token: 0x0600015C RID: 348 RVA: 0x0000C7AC File Offset: 0x0000A9AC + // (set) Token: 0x0600015D RID: 349 RVA: 0x0000C7CE File Offset: 0x0000A9CE + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("(0000-0900), (1300-1400), (1830-2359)")] + public string PhoneThursdayTime + { + get + { + return (string)this["PhoneThursdayTime"]; + } + set + { + this["PhoneThursdayTime"] = value; + } + } + + // Token: 0x1700004B RID: 75 + // (get) Token: 0x0600015E RID: 350 RVA: 0x0000C7E0 File Offset: 0x0000A9E0 + // (set) Token: 0x0600015F RID: 351 RVA: 0x0000C802 File Offset: 0x0000AA02 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("(0000-0900), (1300-1400), (1830-2359)")] + public string PhoneFridayTime + { + get + { + return (string)this["PhoneFridayTime"]; + } + set + { + this["PhoneFridayTime"] = value; + } + } + + // Token: 0x1700004C RID: 76 + // (get) Token: 0x06000160 RID: 352 RVA: 0x0000C814 File Offset: 0x0000AA14 + // (set) Token: 0x06000161 RID: 353 RVA: 0x0000C836 File Offset: 0x0000AA36 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("(0000-0900)")] + public string PhoneSaturdayTime + { + get + { + return (string)this["PhoneSaturdayTime"]; + } + set + { + this["PhoneSaturdayTime"] = value; + } + } + + // Token: 0x1700004D RID: 77 + // (get) Token: 0x06000162 RID: 354 RVA: 0x0000C848 File Offset: 0x0000AA48 + // (set) Token: 0x06000163 RID: 355 RVA: 0x0000C86A File Offset: 0x0000AA6A + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("(0000-0000)")] + public string PhoneSundayTime + { + get + { + return (string)this["PhoneSundayTime"]; + } + set + { + this["PhoneSundayTime"] = value; + } + } + + // Token: 0x1700004E RID: 78 + // (get) Token: 0x06000164 RID: 356 RVA: 0x0000C87C File Offset: 0x0000AA7C + // (set) Token: 0x06000165 RID: 357 RVA: 0x0000C89E File Offset: 0x0000AA9E + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("2")] + public int TradeEmailCounter + { + get + { + return (int)this["TradeEmailCounter"]; + } + set + { + this["TradeEmailCounter"] = value; + } + } + + // Token: 0x1700004F RID: 79 + // (get) Token: 0x06000166 RID: 358 RVA: 0x0000C8B4 File Offset: 0x0000AAB4 + // (set) Token: 0x06000167 RID: 359 RVA: 0x0000C8D6 File Offset: 0x0000AAD6 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("5")] + public int TradePhoneCounter + { + get + { + return (int)this["TradePhoneCounter"]; + } + set + { + this["TradePhoneCounter"] = value; + } + } + + // Token: 0x17000050 RID: 80 + // (get) Token: 0x06000168 RID: 360 RVA: 0x0000C8EC File Offset: 0x0000AAEC + // (set) Token: 0x06000169 RID: 361 RVA: 0x0000C90E File Offset: 0x0000AB0E + [UserScopedSetting] + [SettingsDescription("Trigger Status for Pending Orders")] + [DebuggerNonUserCode] + [DefaultSettingValue("NEW,PENDING")] + public string StatusKeywordsNewOrders + { + get + { + return (string)this["StatusKeywordsNewOrders"]; + } + set + { + this["StatusKeywordsNewOrders"] = value; + } + } + + // Token: 0x17000051 RID: 81 + // (get) Token: 0x0600016A RID: 362 RVA: 0x0000C920 File Offset: 0x0000AB20 + // (set) Token: 0x0600016B RID: 363 RVA: 0x0000C942 File Offset: 0x0000AB42 + [UserScopedSetting] + [SettingsDescription("Trigger Status for Working Orders")] + [DebuggerNonUserCode] + [DefaultSettingValue("DISABLED,SUSPENDED")] + public string StatusKeywordsWorkingOrders + { + get + { + return (string)this["StatusKeywordsWorkingOrders"]; + } + set + { + this["StatusKeywordsWorkingOrders"] = value; + } + } + + // Token: 0x17000052 RID: 82 + // (get) Token: 0x0600016C RID: 364 RVA: 0x0000C954 File Offset: 0x0000AB54 + // (set) Token: 0x0600016D RID: 365 RVA: 0x0000C976 File Offset: 0x0000AB76 + [UserScopedSetting] + [SettingsDescription("IP of the Primary Data Recorder")] + [DebuggerNonUserCode] + [DefaultSettingValue("10.153.64.31")] + public string PrimaryDataRecorder + { + get + { + return (string)this["PrimaryDataRecorder"]; + } + set + { + this["PrimaryDataRecorder"] = value; + } + } + + // Token: 0x17000053 RID: 83 + // (get) Token: 0x0600016E RID: 366 RVA: 0x0000C988 File Offset: 0x0000AB88 + // (set) Token: 0x0600016F RID: 367 RVA: 0x0000C9AA File Offset: 0x0000ABAA + [UserScopedSetting] + [SettingsDescription("IP of the Secondary Data Recorder")] + [DebuggerNonUserCode] + [DefaultSettingValue("10.153.64.9")] + public string SecondaryDataRecorder + { + get + { + return (string)this["SecondaryDataRecorder"]; + } + set + { + this["SecondaryDataRecorder"] = value; + } + } + + // Token: 0x17000054 RID: 84 + // (get) Token: 0x06000170 RID: 368 RVA: 0x0000C9BC File Offset: 0x0000ABBC + // (set) Token: 0x06000171 RID: 369 RVA: 0x0000C9DE File Offset: 0x0000ABDE + [UserScopedSetting] + [SettingsDescription("Time in Minutes after which the DataRecorder is regarded as Not Working")] + [DebuggerNonUserCode] + [DefaultSettingValue("2")] + public double DataRecorderLatencyMinutes + { + get + { + return (double)this["DataRecorderLatencyMinutes"]; + } + set + { + this["DataRecorderLatencyMinutes"] = value; + } + } + + // Token: 0x17000055 RID: 85 + // (get) Token: 0x06000172 RID: 370 RVA: 0x0000C9F4 File Offset: 0x0000ABF4 + // (set) Token: 0x06000173 RID: 371 RVA: 0x0000CA16 File Offset: 0x0000AC16 + [UserScopedSetting] + [SettingsDescription("Number of minutes after which the Basket Sync Delay triggers an alarm")] + [DebuggerNonUserCode] + [DefaultSettingValue("4")] + public double BasketSyncThresholdMinutes + { + get + { + return (double)this["BasketSyncThresholdMinutes"]; + } + set + { + this["BasketSyncThresholdMinutes"] = value; + } + } + + // Token: 0x17000056 RID: 86 + // (get) Token: 0x06000174 RID: 372 RVA: 0x0000CA2C File Offset: 0x0000AC2C + // (set) Token: 0x06000175 RID: 373 RVA: 0x0000CA4E File Offset: 0x0000AC4E + [UserScopedSetting] + [SettingsDescription("Database name of the intraday db")] + [DebuggerNonUserCode] + [DefaultSettingValue("tradingDB")] + public string IntradayDatabaseName + { + get + { + return (string)this["IntradayDatabaseName"]; + } + set + { + this["IntradayDatabaseName"] = value; + } + } + + // Token: 0x17000057 RID: 87 + // (get) Token: 0x06000176 RID: 374 RVA: 0x0000CA60 File Offset: 0x0000AC60 + // (set) Token: 0x06000177 RID: 375 RVA: 0x0000CA82 File Offset: 0x0000AC82 + [UserScopedSetting] + [SettingsDescription("Timer in Seconds")] + [DebuggerNonUserCode] + [DefaultSettingValue("90")] + public int TimerTradeChecks + { + get + { + return (int)this["TimerTradeChecks"]; + } + set + { + this["TimerTradeChecks"] = value; + } + } + + // Token: 0x17000058 RID: 88 + // (get) Token: 0x06000178 RID: 376 RVA: 0x0000CA98 File Offset: 0x0000AC98 + // (set) Token: 0x06000179 RID: 377 RVA: 0x0000CABA File Offset: 0x0000ACBA + [UserScopedSetting] + [SettingsDescription("Timer in Seconds")] + [DebuggerNonUserCode] + [DefaultSettingValue("10")] + public int TimerMarketDataChecks + { + get + { + return (int)this["TimerMarketDataChecks"]; + } + set + { + this["TimerMarketDataChecks"] = value; + } + } + + // Token: 0x17000059 RID: 89 + // (get) Token: 0x0600017A RID: 378 RVA: 0x0000CAD0 File Offset: 0x0000ACD0 + // (set) Token: 0x0600017B RID: 379 RVA: 0x0000CAF2 File Offset: 0x0000ACF2 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("IDB,IDS")] + public string EmptyGunStrategues + { + get + { + return (string)this["EmptyGunStrategues"]; + } + set + { + this["EmptyGunStrategues"] = value; + } + } + + // Token: 0x1700005A RID: 90 + // (get) Token: 0x0600017C RID: 380 RVA: 0x0000CB04 File Offset: 0x0000AD04 + // (set) Token: 0x0600017D RID: 381 RVA: 0x0000CB26 File Offset: 0x0000AD26 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("3")] + public int DISABLEDPhoneCounter + { + get + { + return (int)this["DISABLEDPhoneCounter"]; + } + set + { + this["DISABLEDPhoneCounter"] = value; + } + } + + // Token: 0x1700005B RID: 91 + // (get) Token: 0x0600017E RID: 382 RVA: 0x0000CB3C File Offset: 0x0000AD3C + // (set) Token: 0x0600017F RID: 383 RVA: 0x0000CB5E File Offset: 0x0000AD5E + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("2")] + public int DISABLEDEmailCounter + { + get + { + return (int)this["DISABLEDEmailCounter"]; + } + set + { + this["DISABLEDEmailCounter"] = value; + } + } + + // Token: 0x1700005C RID: 92 + // (get) Token: 0x06000180 RID: 384 RVA: 0x0000CB74 File Offset: 0x0000AD74 + // (set) Token: 0x06000181 RID: 385 RVA: 0x0000CB96 File Offset: 0x0000AD96 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("3")] + public int SUSPENDEDPhoneCounter + { + get + { + return (int)this["SUSPENDEDPhoneCounter"]; + } + set + { + this["SUSPENDEDPhoneCounter"] = value; + } + } + + // Token: 0x1700005D RID: 93 + // (get) Token: 0x06000182 RID: 386 RVA: 0x0000CBAC File Offset: 0x0000ADAC + // (set) Token: 0x06000183 RID: 387 RVA: 0x0000CBCE File Offset: 0x0000ADCE + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("1")] + public string SUSPENDEDEmailCounter + { + get + { + return (string)this["SUSPENDEDEmailCounter"]; + } + set + { + this["SUSPENDEDEmailCounter"] = value; + } + } + + // Token: 0x1700005E RID: 94 + // (get) Token: 0x06000184 RID: 388 RVA: 0x0000CBE0 File Offset: 0x0000ADE0 + // (set) Token: 0x06000185 RID: 389 RVA: 0x0000CC02 File Offset: 0x0000AE02 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("10")] + public string DISABLEDEscalationCounter + { + get + { + return (string)this["DISABLEDEscalationCounter"]; + } + set + { + this["DISABLEDEscalationCounter"] = value; + } + } + + // Token: 0x1700005F RID: 95 + // (get) Token: 0x06000186 RID: 390 RVA: 0x0000CC14 File Offset: 0x0000AE14 + // (set) Token: 0x06000187 RID: 391 RVA: 0x0000CC36 File Offset: 0x0000AE36 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("10")] + public string SuspendedEscalationCounter + { + get + { + return (string)this["SuspendedEscalationCounter"]; + } + set + { + this["SuspendedEscalationCounter"] = value; + } + } + + // Token: 0x17000060 RID: 96 + // (get) Token: 0x06000188 RID: 392 RVA: 0x0000CC48 File Offset: 0x0000AE48 + // (set) Token: 0x06000189 RID: 393 RVA: 0x0000CC6A File Offset: 0x0000AE6A + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("True")] + public bool Primary + { + get + { + return (bool)this["Primary"]; + } + set + { + this["Primary"] = value; + } + } + + // Token: 0x17000061 RID: 97 + // (get) Token: 0x0600018A RID: 394 RVA: 0x0000CC80 File Offset: 0x0000AE80 + // (set) Token: 0x0600018B RID: 395 RVA: 0x0000CCA2 File Offset: 0x0000AEA2 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("10")] + public int ExternalPhoneCallLimit + { + get + { + return (int)this["ExternalPhoneCallLimit"]; + } + set + { + this["ExternalPhoneCallLimit"] = value; + } + } + + // Token: 0x17000062 RID: 98 + // (get) Token: 0x0600018C RID: 396 RVA: 0x0000CCB8 File Offset: 0x0000AEB8 + // (set) Token: 0x0600018D RID: 397 RVA: 0x0000CCDA File Offset: 0x0000AEDA + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("http://202.58.207.66/ectime/heartbeat.php?heart=ALARM MANAGER")] + public string ExternalHeartbeatURL + { + get + { + return (string)this["ExternalHeartbeatURL"]; + } + set + { + this["ExternalHeartbeatURL"] = value; + } + } + + // Token: 0x17000063 RID: 99 + // (get) Token: 0x0600018E RID: 398 RVA: 0x0000CCEC File Offset: 0x0000AEEC + // (set) Token: 0x0600018F RID: 399 RVA: 0x0000CD0E File Offset: 0x0000AF0E + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("ectime")] + public string ExternalHeartbeatUsername + { + get + { + return (string)this["ExternalHeartbeatUsername"]; + } + set + { + this["ExternalHeartbeatUsername"] = value; + } + } + + // Token: 0x17000064 RID: 100 + // (get) Token: 0x06000190 RID: 400 RVA: 0x0000CD20 File Offset: 0x0000AF20 + // (set) Token: 0x06000191 RID: 401 RVA: 0x0000CD42 File Offset: 0x0000AF42 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("webectime2011")] + public string ExternalHeartbeatPassword + { + get + { + return (string)this["ExternalHeartbeatPassword"]; + } + set + { + this["ExternalHeartbeatPassword"] = value; + } + } + + // Token: 0x17000065 RID: 101 + // (get) Token: 0x06000192 RID: 402 RVA: 0x0000CD54 File Offset: 0x0000AF54 + // (set) Token: 0x06000193 RID: 403 RVA: 0x0000CD76 File Offset: 0x0000AF76 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("20")] + public int ExternalHeartbeatTimer + { + get + { + return (int)this["ExternalHeartbeatTimer"]; + } + set + { + this["ExternalHeartbeatTimer"] = value; + } + } + + // Token: 0x17000066 RID: 102 + // (get) Token: 0x06000194 RID: 404 RVA: 0x0000CD8C File Offset: 0x0000AF8C + // (set) Token: 0x06000195 RID: 405 RVA: 0x0000CDAE File Offset: 0x0000AFAE + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("10")] + public int ConsecutiveEmailFailCounter + { + get + { + return (int)this["ConsecutiveEmailFailCounter"]; + } + set + { + this["ConsecutiveEmailFailCounter"] = value; + } + } + + // Token: 0x17000067 RID: 103 + // (get) Token: 0x06000196 RID: 406 RVA: 0x0000CDC4 File Offset: 0x0000AFC4 + // (set) Token: 0x06000197 RID: 407 RVA: 0x0000CDE6 File Offset: 0x0000AFE6 + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("+6596999610,+6596352061.+6590211987")] + public string CatchAllPhone + { + get + { + return (string)this["CatchAllPhone"]; + } + set + { + this["CatchAllPhone"] = value; + } + } + + // Token: 0x17000068 RID: 104 + // (get) Token: 0x06000198 RID: 408 RVA: 0x0000CDF8 File Offset: 0x0000AFF8 + // (set) Token: 0x06000199 RID: 409 RVA: 0x0000CE1A File Offset: 0x0000B01A + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("202.55.68.235")] + public string FourElementsMailServer + { + get + { + return (string)this["FourElementsMailServer"]; + } + set + { + this["FourElementsMailServer"] = value; + } + } + + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("587")] + public int FourElementsMailServerPort + { + get + { + return (int)this["FourElementsMailServerPort"]; + } + set + { + this["FourElementsMailServerPort"] = value; + } + } + + // Token: 0x17000069 RID: 105 + // (get) Token: 0x0600019A RID: 410 RVA: 0x0000CE2C File Offset: 0x0000B02C + // (set) Token: 0x0600019B RID: 411 RVA: 0x0000CE4E File Offset: 0x0000B04E + [UserScopedSetting] + [DebuggerNonUserCode] + [DefaultSettingValue("10.153.64.31")] + public string PhoneIP + { + get + { + return (string)this["PhoneIP"]; + } + set + { + this["PhoneIP"] = value; + } + } + + // Token: 0x040000E3 RID: 227 + private static Settings defaultInstance = (Settings)SettingsBase.Synchronized(new Settings()); + } +} diff --git a/Properties/Settings.cs b/Properties/Settings.cs new file mode 100644 index 0000000..2620630 --- /dev/null +++ b/Properties/Settings.cs @@ -0,0 +1,25 @@ +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Configuration; +using System.Diagnostics; +using System.Runtime.CompilerServices; + +namespace iMonitorApp.Properties +{ + // Token: 0x02000024 RID: 36 + [CompilerGenerated] + [GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] + internal sealed partial class Settings : ApplicationSettingsBase + { + // Token: 0x06000140 RID: 320 RVA: 0x000038AE File Offset: 0x00001AAE + private void SettingChangingEventHandler(object sender, SettingChangingEventArgs e) + { + } + + // Token: 0x06000141 RID: 321 RVA: 0x000038AE File Offset: 0x00001AAE + private void SettingsSavingEventHandler(object sender, CancelEventArgs e) + { + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..80c97c0 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,149 @@ + + + + + + 5659 + + + + 10.152.16.10 + + + + 10.152.16.10 + + + 5655 + + + 5656 + + + + + + Data Source=4ecapsvsg1;Initial Catalog=tradingRef;Persist Security Info=True;User ID=dbuser;Password=dbuser + + + 4ecaptrading@4ecap.com + + + 5658 + + + 50 + + + (0000-0900), (1300-1400), (1830-2359) + + + (0000-0900), (1300-1400), (1830-2359) + + + (0000-0900), (1300-1400), (1830-2359) + + + (0000-0900), (1300-1400), (1830-2359) + + + (0000-0900), (1300-1400), (1830-2359) + + + (0000-0900) + + + (0000-0000) + + + 2 + + + 5 + + + NEW,PENDING + + + DISABLED,SUSPENDED + + + + 10.152.16.6 + + + + 10.152.16.6 + + + 2 + + + 4 + + + tradingDB + + + 90 + + + 10 + + + IDB,IDS + + + 3 + + + 2 + + + 3 + + + 1 + + + 10 + + + 10 + + + True + + + 10 + + + http://202.58.207.66/ectime/heartbeat.php?heart=ALARM MANAGER + + + ectime + + + webectime2011 + + + 20 + + + 10 + + + +6596999610,+6596352061.+6590211987 + + + 10.152.16.19 + + + 587 + + + + 10.153.64.92 + + + \ No newline at end of file diff --git a/SMS.cs b/SMS.cs new file mode 100644 index 0000000..ff7aa9a --- /dev/null +++ b/SMS.cs @@ -0,0 +1,9 @@ +using System; + +namespace iMonitorApp +{ + // Token: 0x02000008 RID: 8 + public class SMS + { + } +} diff --git a/SMSForm.Designer.cs b/SMSForm.Designer.cs new file mode 100644 index 0000000..a806edb --- /dev/null +++ b/SMSForm.Designer.cs @@ -0,0 +1,43 @@ +namespace iMonitorApp +{ + // Token: 0x02000014 RID: 20 + public partial class SMSForm : global::System.Windows.Forms.Form + { + // Token: 0x06000088 RID: 136 RVA: 0x000062EC File Offset: 0x000044EC + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x06000089 RID: 137 RVA: 0x00006324 File Offset: 0x00004524 + private void InitializeComponent() + { + this.console = new global::System.Windows.Forms.TextBox(); + base.SuspendLayout(); + this.console.Location = new global::System.Drawing.Point(12, 12); + this.console.Multiline = true; + this.console.Name = "console"; + this.console.Size = new global::System.Drawing.Size(231, 274); + this.console.TabIndex = 0; + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + base.ClientSize = new global::System.Drawing.Size(254, 298); + base.Controls.Add(this.console); + base.Name = "SMSForm"; + this.Text = "SMSForm"; + base.ResumeLayout(false); + base.PerformLayout(); + } + + // Token: 0x04000058 RID: 88 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x04000059 RID: 89 + private global::System.Windows.Forms.TextBox console; + } +} diff --git a/SMSForm.cs b/SMSForm.cs new file mode 100644 index 0000000..6a2e74c --- /dev/null +++ b/SMSForm.cs @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO.Ports; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using iMonitorApp.Properties; +using Microsoft.Win32; + +namespace iMonitorApp +{ + // Token: 0x02000014 RID: 20 + public partial class SMSForm : Form + { + // Token: 0x0600007D RID: 125 RVA: 0x00005C41 File Offset: 0x00003E41 + public SMSForm() + { + this.InitializeComponent(); + this.Init(); + } + + // Token: 0x0600007E RID: 126 RVA: 0x00005C78 File Offset: 0x00003E78 + private void Init() + { + Dictionary dictionary = this.BuildPortNameHash(SerialPort.GetPortNames()); + using (Dictionary.Enumerator enumerator = dictionary.GetEnumerator()) + { + if (enumerator.MoveNext()) + { + KeyValuePair keyValuePair = enumerator.Current; + bool flag = keyValuePair.Value.Contains("HUAWEI Mobile Connect - 3G Modem"); + if (!flag) + { + return; + } + Console.WriteLine(keyValuePair.Value + " found connected on Port " + keyValuePair.Key); + this.portnumber = keyValuePair.Key; + } + } + this.po = new SerialPort(); + this.po.PortName = this.portnumber; + this.po.BaudRate = int.Parse("9600"); + this.po.DataBits = Convert.ToInt32("8"); + this.po.Parity = Parity.None; + this.po.StopBits = StopBits.One; + this.po.ReadTimeout = int.Parse("300"); + this.po.WriteTimeout = int.Parse("300"); + this.po.Encoding = Encoding.GetEncoding("iso-8859-1"); + this.sem = new Semaphore(1, 1); + this.mutex = false; + Thread thread = new Thread(new ThreadStart(this.LaunchListener)); + thread.Start(); + } + + // Token: 0x0600007F RID: 127 RVA: 0x00005DEC File Offset: 0x00003FEC + private void LaunchListener() + { + AsynchronousSocketListenerSMS asynchronousSocketListenerSMS = new AsynchronousSocketListenerSMS(Config.GetIP4Address(), Settings.Default.SMSPort); + AsynchronousSocketListenerSMS.Received += this.AsynchronousSocketListener_Received; + AsynchronousSocketListenerSMS.StartListening(); + } + + // Token: 0x06000080 RID: 128 RVA: 0x00005E28 File Offset: 0x00004028 + private void AsynchronousSocketListener_Received(object sender, EventArgs e) + { + this.Log("Receiving Instruction"); + Stack obj = this.stack; + lock (obj) + { + List list = sender.ToString().Split(new char[] + { + ',' + }).ToList(); + this.stack.Push(new SMSInput + { + PhoneNumber = list[0], + Message = list[1] + }); + } + this.Log("Instruction Received"); + this.MakeCall(); + } + + // Token: 0x06000081 RID: 129 RVA: 0x00005ED8 File Offset: 0x000040D8 + private void po_DataReceived(object sender, SerialDataReceivedEventArgs e) + { + bool flag = e.EventType == SerialData.Chars; + if (flag) + { + bool isOpen = ((SerialPort)sender).IsOpen; + if (isOpen) + { + this.Log(((SerialPort)sender).ReadExisting()); + } + } + } + + // Token: 0x06000082 RID: 130 RVA: 0x00005F18 File Offset: 0x00004118 + private void MakeCall() + { + SMSInput smsinput = default(SMSInput); + Stack obj = this.stack; + lock (obj) + { + bool flag2 = this.stack.Count == 0; + if (flag2) + { + return; + } + smsinput = this.stack.Pop(); + } + bool flag3 = smsinput.PhoneNumber == ""; + if (!flag3) + { + bool flag4 = smsinput.Message == ""; + if (!flag4) + { + this.mutex = true; + this.Log("Sending SMS"); + this.SendSingleSMS(smsinput.PhoneNumber, smsinput.Message); + this.mutex = false; + } + } + } + + // Token: 0x06000083 RID: 131 RVA: 0x00005FE0 File Offset: 0x000041E0 + public void SendSingleSMS(string number, string message) + { + this.po.Open(); + this.po.DtrEnable = true; + this.po.RtsEnable = true; + this.po.DataReceived += this.po_DataReceived; + this.po.WriteLine("AT+CMGF=1;\r"); + this.po.WriteLine("AT+CMGS=\"" + number + "\"\r"); + this.po.WriteLine(message + char.ConvertFromUtf32(26)); + this.po.Close(); + this.Log("SMS Sent"); + } + + // Token: 0x06000084 RID: 132 RVA: 0x0000608A File Offset: 0x0000428A + private void HangUp() + { + this.po.Close(); + } + + // Token: 0x06000085 RID: 133 RVA: 0x0000609C File Offset: 0x0000429C + public void Log(string text) + { + bool invokeRequired = this.console.InvokeRequired; + if (invokeRequired) + { + this.console.Invoke(new Action(delegate() + { + this.console.Text = text + "\r\n" + this.console.Text; + })); + } + else + { + this.console.Text = text + "\r\n" + this.console.Text; + } + } + + // Token: 0x06000086 RID: 134 RVA: 0x00006110 File Offset: 0x00004310 + private Dictionary BuildPortNameHash(string[] portsToMap) + { + Dictionary dictionary = new Dictionary(); + this.MineRegistryForPortName("SYSTEM\\CurrentControlSet\\Enum", dictionary, portsToMap); + return dictionary; + } + + // Token: 0x06000087 RID: 135 RVA: 0x00006138 File Offset: 0x00004338 + private void MineRegistryForPortName(string startKeyPath, Dictionary targetMap, string[] portsToMap) + { + bool flag = targetMap.Count >= portsToMap.Length; + if (!flag) + { + using (RegistryKey localMachine = Registry.LocalMachine) + { + try + { + using (RegistryKey registryKey = localMachine.OpenSubKey(startKeyPath)) + { + string[] subKeyNames = registryKey.GetSubKeyNames(); + bool flag2 = subKeyNames.Contains("Device Parameters") && startKeyPath != "SYSTEM\\CurrentControlSet\\Enum"; + if (flag2) + { + object value = Registry.GetValue("HKEY_LOCAL_MACHINE\\" + startKeyPath + "\\Device Parameters", "PortName", null); + bool flag3 = value == null || !portsToMap.Contains(value.ToString()); + if (!flag3) + { + object value2 = Registry.GetValue("HKEY_LOCAL_MACHINE\\" + startKeyPath, "FriendlyName", null); + string text = "N/A"; + bool flag4 = value2 != null; + if (flag4) + { + text = value2.ToString(); + } + bool flag5 = !text.Contains(value.ToString()); + if (flag5) + { + text = string.Format("{0} ({1})", text, value); + } + targetMap[value.ToString()] = text; + } + } + else + { + foreach (string str in subKeyNames) + { + this.MineRegistryForPortName(startKeyPath + "\\" + str, targetMap, portsToMap); + } + } + } + } + catch (Exception) + { + } + } + } + } + + // Token: 0x04000053 RID: 83 + private string portnumber = ""; + + // Token: 0x04000054 RID: 84 + private SerialPort po; + + // Token: 0x04000055 RID: 85 + private Semaphore sem; + + // Token: 0x04000056 RID: 86 + private Stack stack = new Stack(); + + // Token: 0x04000057 RID: 87 + private bool mutex; + } +} diff --git a/SMSForm.resources b/SMSForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/SMSForm.resources differ diff --git a/SMSInput.cs b/SMSInput.cs new file mode 100644 index 0000000..f69fb13 --- /dev/null +++ b/SMSInput.cs @@ -0,0 +1,18 @@ +using System; + +namespace iMonitorApp +{ + // Token: 0x02000015 RID: 21 + internal struct SMSInput + { + // Token: 0x17000019 RID: 25 + // (get) Token: 0x0600008A RID: 138 RVA: 0x0000640C File Offset: 0x0000460C + // (set) Token: 0x0600008B RID: 139 RVA: 0x00006414 File Offset: 0x00004614 + public string PhoneNumber { get; set; } + + // Token: 0x1700001A RID: 26 + // (get) Token: 0x0600008C RID: 140 RVA: 0x0000641D File Offset: 0x0000461D + // (set) Token: 0x0600008D RID: 141 RVA: 0x00006425 File Offset: 0x00004625 + public string Message { get; set; } + } +} diff --git a/SendDataService.cs b/SendDataService.cs new file mode 100644 index 0000000..7b3e080 --- /dev/null +++ b/SendDataService.cs @@ -0,0 +1,14 @@ +using System; + +namespace iMonitorApp +{ + // Token: 0x02000011 RID: 17 + public class SendDataService : ISendDataService + { + // Token: 0x06000074 RID: 116 RVA: 0x00005A54 File Offset: 0x00003C54 + public string helloworld() + { + return "Hello World!"; + } + } +} diff --git a/Service.cs b/Service.cs new file mode 100644 index 0000000..7b22369 --- /dev/null +++ b/Service.cs @@ -0,0 +1,13 @@ +using System; + +namespace iMonitorApp +{ + // Token: 0x02000012 RID: 18 + public class Service : IService + { + // Token: 0x06000076 RID: 118 RVA: 0x000038AE File Offset: 0x00001AAE + public void DoWork() + { + } + } +} diff --git a/SettingsForm.Designer.cs b/SettingsForm.Designer.cs new file mode 100644 index 0000000..97a98bc --- /dev/null +++ b/SettingsForm.Designer.cs @@ -0,0 +1,48 @@ +namespace iMonitorApp +{ + // Token: 0x02000013 RID: 19 + public partial class SettingsForm : global::System.Windows.Forms.Form + { + // Token: 0x0600007B RID: 123 RVA: 0x00005AC8 File Offset: 0x00003CC8 + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x0600007C RID: 124 RVA: 0x00005B00 File Offset: 0x00003D00 + private void InitializeComponent() + { + this.propertyGrid1 = new global::System.Windows.Forms.PropertyGrid(); + base.SuspendLayout(); + this.propertyGrid1.Font = new global::System.Drawing.Font("Consolas", 8.25f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.propertyGrid1.Location = new global::System.Drawing.Point(12, 12); + this.propertyGrid1.Name = "propertyGrid1"; + this.propertyGrid1.Size = new global::System.Drawing.Size(841, 639); + this.propertyGrid1.TabIndex = 0; + this.propertyGrid1.PropertyValueChanged += new global::System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = global::System.Drawing.Color.Khaki; + base.ClientSize = new global::System.Drawing.Size(864, 663); + base.Controls.Add(this.propertyGrid1); + base.MaximizeBox = false; + base.MinimizeBox = false; + base.Name = "SettingsForm"; + this.Text = "Settings"; + base.TopMost = true; + base.Load += new global::System.EventHandler(this.SettingsForm_Load); + base.ResumeLayout(false); + } + + // Token: 0x04000051 RID: 81 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x04000052 RID: 82 + private global::System.Windows.Forms.PropertyGrid propertyGrid1; + } +} diff --git a/SettingsForm.cs b/SettingsForm.cs new file mode 100644 index 0000000..02f09af --- /dev/null +++ b/SettingsForm.cs @@ -0,0 +1,31 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using iMonitorApp.Properties; + +namespace iMonitorApp +{ + // Token: 0x02000013 RID: 19 + public partial class SettingsForm : Form + { + // Token: 0x06000078 RID: 120 RVA: 0x00005A6B File Offset: 0x00003C6B + public SettingsForm() + { + this.InitializeComponent(); + } + + // Token: 0x06000079 RID: 121 RVA: 0x00005A83 File Offset: 0x00003C83 + private void SettingsForm_Load(object sender, EventArgs e) + { + this.propertyGrid1.SelectedObject = Settings.Default; + } + + // Token: 0x0600007A RID: 122 RVA: 0x00005A97 File Offset: 0x00003C97 + private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) + { + Settings.Default[e.ChangedItem.Label] = e.ChangedItem.Value; + Settings.Default.Save(); + } + } +} diff --git a/SettingsForm.resources b/SettingsForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/SettingsForm.resources differ diff --git a/SocketClient.cs b/SocketClient.cs new file mode 100644 index 0000000..9edc904 --- /dev/null +++ b/SocketClient.cs @@ -0,0 +1,25 @@ +using System.Net.Sockets; +using System.Text; + +namespace iMonitorApp +{ + // Token: 0x02000009 RID: 9 + public class SocketClient + { + // Token: 0x06000043 RID: 67 RVA: 0x0000324C File Offset: 0x0000144C + public static void Send(string ip, int port, string text) + { + bool flag = !text.Contains(""); + if (flag) + { + text += ""; + } + Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + socket.Connect(ip, port); + byte[] bytes = Encoding.ASCII.GetBytes(text); + int num = socket.Send(bytes); + socket.Shutdown(SocketShutdown.Both); + socket.Close(); + } + } +} diff --git a/StackAlarm.Designer.cs b/StackAlarm.Designer.cs new file mode 100644 index 0000000..272dd05 --- /dev/null +++ b/StackAlarm.Designer.cs @@ -0,0 +1,91 @@ +namespace iMonitorApp +{ + // Token: 0x02000016 RID: 22 + public partial class StackAlarm : global::System.Windows.Forms.Form + { + // Token: 0x060000A1 RID: 161 RVA: 0x00007298 File Offset: 0x00005498 + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x060000A2 RID: 162 RVA: 0x000072D0 File Offset: 0x000054D0 + private void InitializeComponent() + { + this.tb_log = new global::System.Windows.Forms.TextBox(); + this.dataGridView1 = new global::System.Windows.Forms.DataGridView(); + this.statusStrip1 = new global::System.Windows.Forms.StatusStrip(); + this.lbl_consecutiveFails = new global::System.Windows.Forms.ToolStripStatusLabel(); + ((global::System.ComponentModel.ISupportInitialize)this.dataGridView1).BeginInit(); + this.statusStrip1.SuspendLayout(); + base.SuspendLayout(); + this.tb_log.Font = new global::System.Drawing.Font("Consolas", 6.75f, global::System.Drawing.FontStyle.Regular, global::System.Drawing.GraphicsUnit.Point, 0); + this.tb_log.Location = new global::System.Drawing.Point(13, 342); + this.tb_log.Multiline = true; + this.tb_log.Name = "tb_log"; + this.tb_log.ScrollBars = global::System.Windows.Forms.ScrollBars.Vertical; + this.tb_log.Size = new global::System.Drawing.Size(1178, 83); + this.tb_log.TabIndex = 1; + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AllowUserToDeleteRows = false; + this.dataGridView1.AllowUserToOrderColumns = true; + this.dataGridView1.ColumnHeadersHeightSizeMode = global::System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Dock = global::System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.EditMode = global::System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dataGridView1.Location = new global::System.Drawing.Point(0, 0); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + this.dataGridView1.Size = new global::System.Drawing.Size(1203, 437); + this.dataGridView1.TabIndex = 2; + this.dataGridView1.DataError += new global::System.Windows.Forms.DataGridViewDataErrorEventHandler(this.dataGridView1_DataError); + this.statusStrip1.Items.AddRange(new global::System.Windows.Forms.ToolStripItem[] + { + this.lbl_consecutiveFails + }); + this.statusStrip1.Location = new global::System.Drawing.Point(0, 415); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new global::System.Drawing.Size(1203, 22); + this.statusStrip1.TabIndex = 3; + this.statusStrip1.Text = "statusStrip1"; + this.lbl_consecutiveFails.Name = "lbl_consecutiveFails"; + this.lbl_consecutiveFails.Size = new global::System.Drawing.Size(109, 17); + this.lbl_consecutiveFails.Text = "toolStripStatusLabel1"; + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + base.ClientSize = new global::System.Drawing.Size(1203, 437); + base.ControlBox = false; + base.Controls.Add(this.statusStrip1); + base.Controls.Add(this.dataGridView1); + base.Controls.Add(this.tb_log); + this.tb_log.Show(); + base.Name = "StackAlarm"; + base.ShowInTaskbar = false; + this.Text = "Emails"; + ((global::System.ComponentModel.ISupportInitialize)this.dataGridView1).EndInit(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + base.ResumeLayout(false); + base.PerformLayout(); + } + + // Token: 0x04000065 RID: 101 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x04000066 RID: 102 + private global::System.Windows.Forms.TextBox tb_log; + + // Token: 0x04000067 RID: 103 + private global::System.Windows.Forms.DataGridView dataGridView1; + + // Token: 0x04000068 RID: 104 + private global::System.Windows.Forms.StatusStrip statusStrip1; + + // Token: 0x04000069 RID: 105 + private global::System.Windows.Forms.ToolStripStatusLabel lbl_consecutiveFails; + } +} diff --git a/StackAlarm.cs b/StackAlarm.cs new file mode 100644 index 0000000..4d98ae9 --- /dev/null +++ b/StackAlarm.cs @@ -0,0 +1,490 @@ +using System; +using System.Collections; +using System.Collections.Generic; +// using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Web.Script.Serialization; +using System.Windows.Forms; +using Alchemy; +using Alchemy.Classes; +using iMonitorApp.Properties; + +namespace iMonitorApp +{ + // Token: 0x02000016 RID: 22 + public partial class StackAlarm : Form + { + // Token: 0x0600008E RID: 142 RVA: 0x0000642E File Offset: 0x0000462E + public StackAlarm() + { + this.InitializeComponent(); + this.LoadForm(); + } + + // Token: 0x0600008F RID: 143 RVA: 0x00006460 File Offset: 0x00004660 + private void LoadForm() + { + this.li = new BindingListInvoked(this.dataGridView1); + this.dataGridView1.AutoGenerateColumns = true; + this.dataGridView1.DataSource = this.li; + Thread thread = new Thread(new ThreadStart(this.LaunchListener)); + thread.Start(); + this._themeEmails = new ThemeEmails(); + this.heartBeatTimer = new System.Threading.Timer(new TimerCallback(this.SendAMHeartBeat), null, 100, Settings.Default.ExternalHeartbeatTimer * 1000); + } + + // Token: 0x06000090 RID: 144 RVA: 0x000064EC File Offset: 0x000046EC + public void SendAMHeartBeat(object state) + { + bool primary = Settings.Default.Primary; + if (primary) + { + try + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(Settings.Default.ExternalHeartbeatURL); + string str = Convert.ToBase64String(Encoding.ASCII.GetBytes(Settings.Default.ExternalHeartbeatUsername + ":" + Settings.Default.ExternalHeartbeatPassword)); + httpWebRequest.Headers.Add("Authorization", "Basic " + str); + httpWebRequest.ReadWriteTimeout = 20000; + httpWebRequest.Timeout = 20000; + httpWebRequest.Method = "GET"; + HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); + stopwatch.Stop(); + httpWebResponse.Close(); + httpWebRequest.Abort(); + } + catch + { + } + } + } + + // Token: 0x06000091 RID: 145 RVA: 0x000065E0 File Offset: 0x000047E0 + private void LaunchWebSocketListener() + { + this._webSocketServer = new WebSocketServer(12345, IPAddress.Any) + { + OnReceive = new OnEventDelegate(this.OnWebSocketServerReceive), + OnSend = new OnEventDelegate(this.OnWebSocketServerSend), + OnConnected = new OnEventDelegate(this.OnWebSocketServerConnected), + OnDisconnect = new OnEventDelegate(this.OnWebSocketServerDisconnected), + TimeOut = new TimeSpan(0, 50, 0) + }; + this._webSocketClientContextList = new List(); + this._clientUserMap = new Dictionary(); + this._clientUserMapExtension = new Dictionary(); + this._webSocketServer.Start(); + } + + // Token: 0x06000092 RID: 146 RVA: 0x00006688 File Offset: 0x00004888 + private void OnWebSocketServerConnected(UserContext context) + { + Console.WriteLine("Client Connected From : " + context.ClientAddress.ToString()); + bool flag = (from t in this._webSocketClientContextList + where t.ClientAddress == context.ClientAddress + select t).Count() == 0; + if (flag) + { + this._webSocketClientContextList.Add(context); + } + bool flag2 = !this._clientUserMap.ContainsKey(context.ClientAddress.ToString()); + if (flag2) + { + this._clientUserMap.Add(context.ClientAddress.ToString(), ""); + } + } + + // Token: 0x06000093 RID: 147 RVA: 0x0000673C File Offset: 0x0000493C + private void OnWebSocketServerDisconnected(UserContext context) + { + Console.WriteLine("OnDisconnected: " + context.ClientAddress.ToString()); + UserContext userContext = (from p in this._webSocketClientContextList + where p.ClientAddress == context.ClientAddress + select p).FirstOrDefault(); + bool flag = userContext != null; + if (flag) + { + this._webSocketClientContextList.Remove(userContext); + } + bool flag2 = this._clientUserMap.ContainsKey(context.ClientAddress.ToString()); + if (flag2) + { + this._clientUserMap.Remove(context.ClientAddress.ToString()); + } + } + + // Token: 0x06000094 RID: 148 RVA: 0x000067E4 File Offset: 0x000049E4 + private void OnWebSocketServerReceive(UserContext context) + { + Console.WriteLine("OnSend: " + context.ClientAddress.ToString()); + string text = context.DataFrame.ToString(); + bool flag = text != "" && text != null; + if (flag) + { + bool flag2 = text.Split(new char[] + { + ',' + }).Count() == 2; + if (flag2) + { + string text2 = text.Split(new char[] + { + ',' + })[0]; + string text3 = text.Split(new char[] + { + ',' + })[1]; + bool flag3 = this._clientUserMap.ContainsKey(context.ClientAddress.ToString()); + if (flag3) + { + this._clientUserMap[context.ClientAddress.ToString()] = text3; + } + else + { + this._clientUserMap.Add(context.ClientAddress.ToString(), text3); + } + try + { + IEnumerable source = (from t in this.li + orderby t.ReceivingTime descending + select t).Take(50); + foreach (ParseStackAlarms parseStackAlarms in from t in source + orderby t.ReceivingTime + select t) + { + bool flag4 = parseStackAlarms.Recipients.Split(new char[] + { + ',' + }).Select((string t) => t.ToLower()).ToList().Contains(text3 + "@4ecap.com"); + if (flag4) + { + JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); + string aString = javaScriptSerializer.Serialize(parseStackAlarms); + context.Send(aString, false, false); + } + } + } + catch + { + context.Send("Unable to fetch history<>-", false, false); + } + } + } + } + + // Token: 0x06000095 RID: 149 RVA: 0x00006A20 File Offset: 0x00004C20 + private void OnWebSocketServerSend(UserContext context) + { + Console.WriteLine("OnReceived: " + context.ClientAddress.ToString()); + } + + // Token: 0x06000096 RID: 150 RVA: 0x00006A40 File Offset: 0x00004C40 + private void UpdateWebUI(string speech, string users, DateTime receivedTime) + { + List list = (from p in users.Split(new char[] + { + ',' + }) + select p.Replace("@4ecap.com", "").ToLower()).ToList(); + foreach (UserContext userContext in this._webSocketClientContextList) + { + bool flag = list.Contains(this._clientUserMap[userContext.ClientAddress.ToString()]); + if (flag) + { + userContext.Send(speech + "<>" + receivedTime.ToShortTimeString(), false, false); + } + } + } + + // Token: 0x06000097 RID: 151 RVA: 0x00006B08 File Offset: 0x00004D08 + private void UpdateWebUI(ParseStackAlarms pa) + { + List list = (from p in pa.Recipients.Split(new char[] + { + ',' + }) + select p.Replace("@4ecap.com", "").ToLower()).ToList(); + foreach (UserContext userContext in this._webSocketClientContextList) + { + bool flag = list.Contains(this._clientUserMap[userContext.ClientAddress.ToString()]); + if (flag) + { + JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); + string aString = javaScriptSerializer.Serialize(pa); + userContext.Send(aString, false, false); + } + } + } + + // Token: 0x06000098 RID: 152 RVA: 0x00006BD8 File Offset: 0x00004DD8 + private void LaunchListener() + { + AsynchronousSocketListenerStackAlarms asynchronousSocketListenerStackAlarms = new AsynchronousSocketListenerStackAlarms(Settings.Default.CurrentIP, Settings.Default.EmailPort); + AsynchronousSocketListenerStackAlarms.Received += this.AsynchronousSocketListener_Received; + AsynchronousSocketListenerStackAlarms.StartListening(); + Debug.WriteLine("Listening....."); + } + + // Token: 0x06000099 RID: 153 RVA: 0x00006C18 File Offset: 0x00004E18 + private void AsynchronousSocketListener_Received(object sender, EventArgs e) + { + this.BackupListAndClear(); + bool flag = sender.ToString() == "Command: GETLIVE"; + if (flag) + { + Thread thread = new Thread(new ThreadStart(this.DumpLiveLogs)); + thread.Start(); + } + else + { + object obj = this.locker; + lock (obj) + { + ParseStackAlarms parseStackAlarms = new ParseStackAlarms(sender.ToString(), this._themeEmails); + this.li.Add(parseStackAlarms); + try + { + bool phoneit = parseStackAlarms.Phoneit; + if (phoneit) + { + } + } + catch + { + } + new Thread(new ParameterizedThreadStart(this.ProcessThread)) + { + IsBackground = true + }.Start(parseStackAlarms); + } + } + } + + // Token: 0x0600009A RID: 154 RVA: 0x00006CFC File Offset: 0x00004EFC + public void ProcessThread(object sa) + { + ((ParseStackAlarms)sa).Process(); + bool flag = ((ParseStackAlarms)sa).SendingEmailStatus.StartsWith("Error"); + if (flag) + { + this.consecutiveFails++; + } + else + { + this.consecutiveFails = 0; + } + bool flag2 = this.consecutiveFails > Settings.Default.ConsecutiveEmailFailCounter; + if (flag2) + { + SocketClient.Send(Settings.Default.CurrentIP, Settings.Default.PhonePort, Settings.Default.CatchAllPhone + ""); + } + try + { + bool invokeRequired = this.dataGridView1.InvokeRequired; + if (invokeRequired) + { + this.dataGridView1.Invoke(new Action(delegate() + { + this.UpdateDataGridView(); + })); + } + else + { + this.UpdateDataGridView(); + } + } + catch + { + } + } + + // Token: 0x0600009B RID: 155 RVA: 0x00006DD8 File Offset: 0x00004FD8 + public void Log(string text, bool clear = false) + { + bool invokeRequired = this.tb_log.InvokeRequired; + if (invokeRequired) + { + this.tb_log.Invoke(new Action(delegate() + { + bool clear3 = clear; + if (clear3) + { + this.tb_log.Text = ""; + } + else + { + this.tb_log.Text = text + "\r\n" + this.tb_log.Text; + } + })); + } + else + { + bool clear2 = clear; + if (clear2) + { + this.tb_log.Text = ""; + } + else + { + this.tb_log.Text = text + "\r\n" + this.tb_log.Text; + } + } + } + + // Token: 0x0600009C RID: 156 RVA: 0x00006E74 File Offset: 0x00005074 + public void UpdateDataGridView() + { + this.dataGridView1.Refresh(); + try + { + foreach (object obj in ((IEnumerable)this.dataGridView1.Rows)) + { + DataGridViewRow dataGridViewRow = (DataGridViewRow)obj; + try + { + bool flag = dataGridViewRow.Cells[1].Value.ToString().StartsWith("Error"); + if (flag) + { + dataGridViewRow.DefaultCellStyle.ForeColor = Color.Red; + } + bool flag2 = dataGridViewRow.Cells[1].Value.ToString().StartsWith("Proce"); + if (flag2) + { + dataGridViewRow.DefaultCellStyle.ForeColor = Color.Orange; + } + bool flag3 = dataGridViewRow.Cells[1].Value.ToString().StartsWith("Sent"); + if (flag3) + { + dataGridViewRow.DefaultCellStyle.ForeColor = Color.Green; + } + } + catch + { + } + } + } + catch + { + } + } + + // Token: 0x0600009D RID: 157 RVA: 0x00006FB8 File Offset: 0x000051B8 + public void BackupListAndClear() + { + try + { + bool flag = this.li.Count >= Settings.Default.BackupCount; + if (flag) + { + bool flag2 = (from p in this.li + where p.SendingEmailStatus == "" + select p).Count() == 0; + if (flag2) + { + this.WriteCSV(this.li, "C:\\tempFiles\\iMonitorLogs\\", "test"); + this.li.Clear(); + this.Log("", true); + this.Log("Backed up logs - Cleared UI", false); + } + } + } + catch + { + this.Log("Error backing up data", false); + } + } + + // Token: 0x0600009E RID: 158 RVA: 0x00007084 File Offset: 0x00005284 + public void DumpLiveLogs() + { + try + { + this.WriteCSV(this.li, "C:\\tempFiles\\iMonitorLogs\\", "live.csv"); + this.Log("Live Logs Dumped", false); + } + catch + { + this.Log("Error dumping log file", false); + } + } + + // Token: 0x0600009F RID: 159 RVA: 0x000070DC File Offset: 0x000052DC + public void WriteCSV(IEnumerable items, string path, string filename = "") + { + bool flag = !Directory.Exists(path); + if (flag) + { + Directory.CreateDirectory(path); + } + bool flag2 = filename == ""; + if (flag2) + { + filename = "iMonitor_" + DateTime.Now.ToString("ddMMMyy_hh_mm") + ".csv"; + } + Type typeFromHandle = typeof(T); + IOrderedEnumerable source = from p in typeFromHandle.GetProperties(BindingFlags.Instance | BindingFlags.Public) + orderby p.Name + select p; + using (StreamWriter streamWriter = new StreamWriter(path + filename)) + { + string text = string.Join("^^", from p in source + select p.Name); + text = text.Replace(",", ";").Replace("^^", ", "); + streamWriter.WriteLine(text); + using (IEnumerator enumerator = items.GetEnumerator()) + { + while (enumerator.MoveNext()) + { + T item = enumerator.Current; + string text2 = string.Join("^^", from p in source + select p.GetValue(item, null)); + text2 = text2.Replace(",", ";").Replace("^^", ", "); + streamWriter.WriteLine(text2); + } + } + } + } + + // Token: 0x060000A0 RID: 160 RVA: 0x00007288 File Offset: 0x00005488 + private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e) + { + e.ThrowException = false; + } + + // Token: 0x0400005C RID: 92 + public object locker = new object(); + + // Token: 0x0400005D RID: 93 + public BindingListInvoked li; + + // Token: 0x0400005E RID: 94 + public WebSocketServer _webSocketServer; + + // Token: 0x0400005F RID: 95 + public List _webSocketClientContextList; + + // Token: 0x04000060 RID: 96 + public Dictionary _clientUserMap; + + // Token: 0x04000061 RID: 97 + public Dictionary _clientUserMapExtension; + + // Token: 0x04000062 RID: 98 + private System.Threading.Timer heartBeatTimer; + + // Token: 0x04000063 RID: 99 + private ThemeEmails _themeEmails; + + // Token: 0x04000064 RID: 100 + public int consecutiveFails = 0; + } +} diff --git a/StackAlarm.resources b/StackAlarm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/StackAlarm.resources differ diff --git a/StateObject.cs b/StateObject.cs new file mode 100644 index 0000000..4d96a50 --- /dev/null +++ b/StateObject.cs @@ -0,0 +1,22 @@ +using System; +using System.Net.Sockets; +using System.Text; + +namespace iMonitorApp +{ + // Token: 0x0200001E RID: 30 + public class StateObject + { + // Token: 0x040000AE RID: 174 + public Socket workSocket = null; + + // Token: 0x040000AF RID: 175 + public const int BufferSize = 20480; + + // Token: 0x040000B0 RID: 176 + public byte[] buffer = new byte[20480]; + + // Token: 0x040000B1 RID: 177 + public StringBuilder sb = new StringBuilder(); + } +} diff --git a/StateObjectSMS.cs b/StateObjectSMS.cs new file mode 100644 index 0000000..6b30ec4 --- /dev/null +++ b/StateObjectSMS.cs @@ -0,0 +1,22 @@ +using System; +using System.Net.Sockets; +using System.Text; + +namespace iMonitorApp +{ + // Token: 0x02000004 RID: 4 + public class StateObjectSMS + { + // Token: 0x0400000A RID: 10 + public Socket workSocket = null; + + // Token: 0x0400000B RID: 11 + public const int BufferSize = 20480; + + // Token: 0x0400000C RID: 12 + public byte[] buffer = new byte[20480]; + + // Token: 0x0400000D RID: 13 + public StringBuilder sb = new StringBuilder(); + } +} diff --git a/StateObjectStackAlarms.cs b/StateObjectStackAlarms.cs new file mode 100644 index 0000000..10c7cd6 --- /dev/null +++ b/StateObjectStackAlarms.cs @@ -0,0 +1,22 @@ +using System; +using System.Net.Sockets; +using System.Text; + +namespace iMonitorApp +{ + // Token: 0x0200000A RID: 10 + public class StateObjectStackAlarms + { + // Token: 0x04000020 RID: 32 + public Socket workSocket = null; + + // Token: 0x04000021 RID: 33 + public const int BufferSize = 20480; + + // Token: 0x04000022 RID: 34 + public byte[] buffer = new byte[20480]; + + // Token: 0x04000023 RID: 35 + public StringBuilder sb = new StringBuilder(); + } +} diff --git a/ThemeEmail.cs b/ThemeEmail.cs new file mode 100644 index 0000000..bc75874 --- /dev/null +++ b/ThemeEmail.cs @@ -0,0 +1,38 @@ +using System; + +namespace iMonitorApp +{ + // Token: 0x02000021 RID: 33 + public class ThemeEmail + { + // Token: 0x17000035 RID: 53 + // (get) Token: 0x0600012B RID: 299 RVA: 0x0000BC04 File Offset: 0x00009E04 + // (set) Token: 0x0600012C RID: 300 RVA: 0x0000BC0C File Offset: 0x00009E0C + public string ThemeName { get; set; } + + // Token: 0x17000036 RID: 54 + // (get) Token: 0x0600012D RID: 301 RVA: 0x0000BC15 File Offset: 0x00009E15 + // (set) Token: 0x0600012E RID: 302 RVA: 0x0000BC1D File Offset: 0x00009E1D + public string EmailAddress { get; set; } + + // Token: 0x17000037 RID: 55 + // (get) Token: 0x0600012F RID: 303 RVA: 0x0000BC26 File Offset: 0x00009E26 + // (set) Token: 0x06000130 RID: 304 RVA: 0x0000BC2E File Offset: 0x00009E2E + public string Password { get; set; } + + // Token: 0x17000038 RID: 56 + // (get) Token: 0x06000131 RID: 305 RVA: 0x0000BC37 File Offset: 0x00009E37 + // (set) Token: 0x06000132 RID: 306 RVA: 0x0000BC3F File Offset: 0x00009E3F + public string DisplayName { get; set; } + + // Token: 0x17000039 RID: 57 + // (get) Token: 0x06000133 RID: 307 RVA: 0x0000BC48 File Offset: 0x00009E48 + // (set) Token: 0x06000134 RID: 308 RVA: 0x0000BC50 File Offset: 0x00009E50 + public string BackupEmail { get; set; } + + // Token: 0x1700003A RID: 58 + // (get) Token: 0x06000135 RID: 309 RVA: 0x0000BC59 File Offset: 0x00009E59 + // (set) Token: 0x06000136 RID: 310 RVA: 0x0000BC61 File Offset: 0x00009E61 + public string BackupPassword { get; set; } + } +} diff --git a/ThemeEmails.cs b/ThemeEmails.cs new file mode 100644 index 0000000..232f528 --- /dev/null +++ b/ThemeEmails.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; + +namespace iMonitorApp +{ + // Token: 0x02000022 RID: 34 + public class ThemeEmails + { + // Token: 0x1700003B RID: 59 + // (get) Token: 0x06000138 RID: 312 RVA: 0x0000BC6A File Offset: 0x00009E6A + // (set) Token: 0x06000139 RID: 313 RVA: 0x0000BC72 File Offset: 0x00009E72 + public List EmailList { get; set; } + + // Token: 0x0600013B RID: 315 RVA: 0x0000BC90 File Offset: 0x00009E90 + private void LoadFile() + { + string connectionString = ""; + bool flag = this.FileName.Trim().EndsWith(".xlsx"); + if (flag) + { + connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0 Xml;HDR=YES;IMEX=1\";", this.FileName); + } + else + { + bool flag2 = this.FileName.Trim().EndsWith(".xls"); + if (flag2) + { + connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";", this.FileName); + } + } + OleDbConnection oleDbConnection = new OleDbConnection(connectionString); + oleDbConnection.Open(); + OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter(); + string str = "newemails"; + string cmdText = "SELECT * FROM [" + str + "$] "; + OleDbCommand selectCommand = new OleDbCommand(cmdText, oleDbConnection); + oleDbDataAdapter.SelectCommand = selectCommand; + DataTable dataTable = new DataTable(); + oleDbDataAdapter.Fill(dataTable); + oleDbConnection.Close(); + this.EmailList = new List(); + foreach (object obj in dataTable.Rows) + { + DataRow dataRow = (DataRow)obj; + string backupEmail = ""; + string backupPassword = ""; + bool flag3 = dataRow.Table.Columns.Contains("backup"); + if (flag3) + { + bool flag4 = dataRow["backup"] != null || !(dataRow["backup"].ToString() == ""); + if (flag4) + { + backupEmail = dataRow["backup"].ToString(); + backupPassword = dataRow["backup_password"].ToString(); + } + } + this.EmailList.Add(new ThemeEmail + { + EmailAddress = dataRow["email"].ToString(), + ThemeName = dataRow["theme"].ToString(), + DisplayName = dataRow["Name"].ToString(), + Password = dataRow["password"].ToString(), + BackupEmail = backupEmail, + BackupPassword = backupPassword + }); + } + } + + // Token: 0x040000D7 RID: 215 + private string FileName = "C:\\tempFiles\\ThemeEmails.xlsx"; + } +} diff --git a/TradeForm.Designer.cs b/TradeForm.Designer.cs new file mode 100644 index 0000000..6599c80 --- /dev/null +++ b/TradeForm.Designer.cs @@ -0,0 +1,143 @@ +namespace iMonitorApp +{ + // Token: 0x02000023 RID: 35 + public partial class TradeForm : global::System.Windows.Forms.Form + { + // Token: 0x0600013D RID: 317 RVA: 0x0000BEEC File Offset: 0x0000A0EC + protected override void Dispose(bool disposing) + { + bool flag = disposing && this.components != null; + if (flag) + { + this.components.Dispose(); + } + base.Dispose(disposing); + } + + // Token: 0x0600013E RID: 318 RVA: 0x0000BF24 File Offset: 0x0000A124 + private void InitializeComponent() + { + this.groupBox1 = new global::System.Windows.Forms.GroupBox(); + this.label1 = new global::System.Windows.Forms.Label(); + this.tb_status_email_counter = new global::System.Windows.Forms.TextBox(); + this.tb_status_new_phone_counter = new global::System.Windows.Forms.TextBox(); + this.label3 = new global::System.Windows.Forms.Label(); + this.label5 = new global::System.Windows.Forms.Label(); + this.textBox1 = new global::System.Windows.Forms.TextBox(); + this.groupBox2 = new global::System.Windows.Forms.GroupBox(); + this.textBox2 = new global::System.Windows.Forms.TextBox(); + this.label2 = new global::System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + base.SuspendLayout(); + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new global::System.Drawing.Point(13, 29); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new global::System.Drawing.Size(546, 76); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "New Orders"; + this.label1.AutoSize = true; + this.label1.Location = new global::System.Drawing.Point(19, 38); + this.label1.Name = "label1"; + this.label1.Size = new global::System.Drawing.Size(122, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Keywords in Field Status"; + this.tb_status_email_counter.Location = new global::System.Drawing.Point(99, 259); + this.tb_status_email_counter.Name = "tb_status_email_counter"; + this.tb_status_email_counter.Size = new global::System.Drawing.Size(60, 20); + this.tb_status_email_counter.TabIndex = 1; + this.tb_status_new_phone_counter.Location = new global::System.Drawing.Point(273, 259); + this.tb_status_new_phone_counter.Name = "tb_status_new_phone_counter"; + this.tb_status_new_phone_counter.Size = new global::System.Drawing.Size(54, 20); + this.tb_status_new_phone_counter.TabIndex = 2; + this.label3.AutoSize = true; + this.label3.Location = new global::System.Drawing.Point(21, 266); + this.label3.Name = "label3"; + this.label3.Size = new global::System.Drawing.Size(72, 13); + this.label3.TabIndex = 6; + this.label3.Text = "Email Counter"; + this.label5.AutoSize = true; + this.label5.Location = new global::System.Drawing.Point(189, 266); + this.label5.Name = "label5"; + this.label5.Size = new global::System.Drawing.Size(78, 13); + this.label5.TabIndex = 8; + this.label5.Text = "Phone Counter"; + this.textBox1.Location = new global::System.Drawing.Point(147, 35); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new global::System.Drawing.Size(308, 20); + this.textBox1.TabIndex = 9; + this.textBox1.Text = "NEW, PENDING"; + this.groupBox2.Controls.Add(this.textBox2); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Location = new global::System.Drawing.Point(13, 111); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new global::System.Drawing.Size(546, 76); + this.groupBox2.TabIndex = 10; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Working Orders"; + this.textBox2.Location = new global::System.Drawing.Point(147, 35); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new global::System.Drawing.Size(308, 20); + this.textBox2.TabIndex = 9; + this.textBox2.Text = "DISABLED, SUSPENDED"; + this.label2.AutoSize = true; + this.label2.Location = new global::System.Drawing.Point(19, 38); + this.label2.Name = "label2"; + this.label2.Size = new global::System.Drawing.Size(125, 13); + this.label2.TabIndex = 0; + this.label2.Text = "Keywords in Field Validity"; + base.AutoScaleDimensions = new global::System.Drawing.SizeF(6f, 13f); + base.AutoScaleMode = global::System.Windows.Forms.AutoScaleMode.Font; + base.ClientSize = new global::System.Drawing.Size(571, 312); + base.Controls.Add(this.groupBox2); + base.Controls.Add(this.groupBox1); + base.Controls.Add(this.label5); + base.Controls.Add(this.tb_status_new_phone_counter); + base.Controls.Add(this.tb_status_email_counter); + base.Controls.Add(this.label3); + base.Name = "TradeForm"; + this.Text = "TradeForm"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + base.ResumeLayout(false); + base.PerformLayout(); + } + + // Token: 0x040000D8 RID: 216 + private global::System.ComponentModel.IContainer components = null; + + // Token: 0x040000D9 RID: 217 + private global::System.Windows.Forms.GroupBox groupBox1; + + // Token: 0x040000DA RID: 218 + private global::System.Windows.Forms.Label label5; + + // Token: 0x040000DB RID: 219 + private global::System.Windows.Forms.Label label3; + + // Token: 0x040000DC RID: 220 + private global::System.Windows.Forms.TextBox tb_status_new_phone_counter; + + // Token: 0x040000DD RID: 221 + private global::System.Windows.Forms.TextBox tb_status_email_counter; + + // Token: 0x040000DE RID: 222 + private global::System.Windows.Forms.Label label1; + + // Token: 0x040000DF RID: 223 + private global::System.Windows.Forms.TextBox textBox1; + + // Token: 0x040000E0 RID: 224 + private global::System.Windows.Forms.GroupBox groupBox2; + + // Token: 0x040000E1 RID: 225 + private global::System.Windows.Forms.TextBox textBox2; + + // Token: 0x040000E2 RID: 226 + private global::System.Windows.Forms.Label label2; + } +} diff --git a/TradeForm.cs b/TradeForm.cs new file mode 100644 index 0000000..2f82573 --- /dev/null +++ b/TradeForm.cs @@ -0,0 +1,17 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace iMonitorApp +{ + // Token: 0x02000023 RID: 35 + public partial class TradeForm : Form + { + // Token: 0x0600013C RID: 316 RVA: 0x0000BED4 File Offset: 0x0000A0D4 + public TradeForm() + { + this.InitializeComponent(); + } + } +} diff --git a/TradeForm.resources b/TradeForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/TradeForm.resources differ diff --git a/iMonitorApp.csproj b/iMonitorApp.csproj new file mode 100644 index 0000000..963696b --- /dev/null +++ b/iMonitorApp.csproj @@ -0,0 +1,77 @@ + + + + WinExe + net48 + true + true + + iMonitorApp + iMonitorApp + iMonitorApp.ico + + iMonitorApp + Release + 1.0.0.170 + 1.0.0 + iMonitorApp + iMonitorApp + 1.0.0.170 + + + + + libs\4ELogger.dll + + + libs\Alchemy.dll + + + libs\DataAccessLayer.dll + + + libs\iMonitorAPI.dll + + + libs\TradingLib.dll + + + libs\TradingReference.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + \ No newline at end of file diff --git a/iMonitorApp.ico b/iMonitorApp.ico new file mode 100644 index 0000000..a921de2 Binary files /dev/null and b/iMonitorApp.ico differ diff --git a/iMonitorApp.sln b/iMonitorApp.sln new file mode 100644 index 0000000..ef040b9 --- /dev/null +++ b/iMonitorApp.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "iMonitorApp", "iMonitorApp.csproj", "{5AB995B6-4D5A-4A01-B504-46024AE4B8D6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5AB995B6-4D5A-4A01-B504-46024AE4B8D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5AB995B6-4D5A-4A01-B504-46024AE4B8D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5AB995B6-4D5A-4A01-B504-46024AE4B8D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5AB995B6-4D5A-4A01-B504-46024AE4B8D6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DCC52E64-ED64-4903-8DDD-99339CD14C2A} + EndGlobalSection +EndGlobal diff --git a/libs/4ELogger.dll b/libs/4ELogger.dll new file mode 100644 index 0000000..bd85d22 Binary files /dev/null and b/libs/4ELogger.dll differ diff --git a/libs/Alchemy.dll b/libs/Alchemy.dll new file mode 100644 index 0000000..f1e5753 Binary files /dev/null and b/libs/Alchemy.dll differ diff --git a/libs/DataAccessLayer.dll b/libs/DataAccessLayer.dll new file mode 100644 index 0000000..43a1551 Binary files /dev/null and b/libs/DataAccessLayer.dll differ diff --git a/libs/MySql.Data.dll b/libs/MySql.Data.dll new file mode 100644 index 0000000..9fbc8ef Binary files /dev/null and b/libs/MySql.Data.dll differ diff --git a/libs/System.Data.Linq.dll b/libs/System.Data.Linq.dll new file mode 100644 index 0000000..2aafc23 Binary files /dev/null and b/libs/System.Data.Linq.dll differ diff --git a/libs/System.Messaging.dll b/libs/System.Messaging.dll new file mode 100644 index 0000000..e5dc009 Binary files /dev/null and b/libs/System.Messaging.dll differ diff --git a/libs/System.ServiceModel.dll b/libs/System.ServiceModel.dll new file mode 100644 index 0000000..efb263b Binary files /dev/null and b/libs/System.ServiceModel.dll differ diff --git a/libs/System.Web.Extensions.dll b/libs/System.Web.Extensions.dll new file mode 100644 index 0000000..2f6731c Binary files /dev/null and b/libs/System.Web.Extensions.dll differ diff --git a/libs/TradingLib.dll b/libs/TradingLib.dll new file mode 100644 index 0000000..9b6b1a2 Binary files /dev/null and b/libs/TradingLib.dll differ diff --git a/libs/TradingReference.dll b/libs/TradingReference.dll new file mode 100644 index 0000000..1a9fdb6 Binary files /dev/null and b/libs/TradingReference.dll differ diff --git a/libs/iMonitorAPI.dll b/libs/iMonitorAPI.dll new file mode 100644 index 0000000..b00ed51 Binary files /dev/null and b/libs/iMonitorAPI.dll differ