From 95cd353815597fb2acb5c494ca1e66bd8f328295 Mon Sep 17 00:00:00 2001 From: Sean Kessler Date: Fri, 23 Feb 2024 07:01:14 -0500 Subject: [PATCH] Init --- .gitignore | 330 ++++++++++++++++++ App.config | 12 + ManagedProcess.cs | 109 ++++++ Program.cs | 25 ++ ProjectInstaller.Designer.cs | 58 +++ ProjectInstaller.cs | 19 + ProjectInstaller.resx | 129 +++++++ Properties/AssemblyInfo.cs | 36 ++ Watchdog.Designer.cs | 37 ++ Watchdog.cs | 103 ++++++ Watchdog.csproj | 89 +++++ Watchdog.sln | 34 ++ WatchdogConsoleHelper/App.config | 11 + WatchdogConsoleHelper/Program.cs | 22 ++ .../Properties/AssemblyInfo.cs | 36 ++ .../WatchdogConsoleHelper.csproj | 70 ++++ 16 files changed, 1120 insertions(+) create mode 100644 .gitignore create mode 100644 App.config create mode 100644 ManagedProcess.cs create mode 100644 Program.cs create mode 100644 ProjectInstaller.Designer.cs create mode 100644 ProjectInstaller.cs create mode 100644 ProjectInstaller.resx create mode 100644 Properties/AssemblyInfo.cs create mode 100644 Watchdog.Designer.cs create mode 100644 Watchdog.cs create mode 100644 Watchdog.csproj create mode 100644 Watchdog.sln create mode 100644 WatchdogConsoleHelper/App.config create mode 100644 WatchdogConsoleHelper/Program.cs create mode 100644 WatchdogConsoleHelper/Properties/AssemblyInfo.cs create mode 100644 WatchdogConsoleHelper/WatchdogConsoleHelper.csproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e759b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,330 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# 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 +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ diff --git a/App.config b/App.config new file mode 100644 index 0000000..cedc537 --- /dev/null +++ b/App.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ManagedProcess.cs b/ManagedProcess.cs new file mode 100644 index 0000000..48d430b --- /dev/null +++ b/ManagedProcess.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Configuration; +using System.Threading.Tasks; +using MarketDataLib.Utility; +using MarketData.Utils; +using System.Diagnostics; +using System.Security; + +namespace Watchdog +{ + +// This is just a helper app for building and testing stuff for the service + + public class ManagedProcess + { + public ManagedProcess(string name, string pathToExecutable,bool runAs) + { + this.Name=name; + this.PathToExecutable=pathToExecutable; + this.RunAs=runAs; + } + public String Name{get;set;} + public String PathToExecutable{get;set;} + public bool RunAs{get;set;} + public bool IsRunning() + { + Process[] pname = Process.GetProcessesByName(Name); + if (pname.Length == 0)return false; + return true; + } + public bool Run() + { + ProcessStartInfo processStartInfo=new ProcessStartInfo(); + processStartInfo.FileName=PathToExecutable; + processStartInfo.WorkingDirectory=Utility.GetPath(processStartInfo.FileName); + processStartInfo.UseShellExecute=true; + if(RunAs)processStartInfo.Verb="runas"; + processStartInfo.Domain=""; + Process process = Process.Start(processStartInfo); + if(null == process)return false; + if(process.HasExited)return false; + return true; + } + } + + public class ProcessManager + { + private ProcessManager() + { + } + public static void ManageProcesses(List processList) + { + foreach(ManagedProcess managedProcess in processList) + { + if(!managedProcess.IsRunning()) + { + managedProcess.Run(); + } + } + } + public static void ManageProcesses(List processList,EventLog eventLog) + { + foreach(ManagedProcess managedProcess in processList) + { + if(!managedProcess.IsRunning()) + { + bool success=managedProcess.Run(); + eventLog.WriteEntry(String.Format("Process '{0}' was started with {1}",managedProcess.Name,success?"success":"failure")); + } + else + { + eventLog.WriteEntry(String.Format("Process '{0}' is running",managedProcess.Name)); + } + } + } + public static List GetManagedProceses() + { + List managedProcessList=new List(); + try + { + int watchCount=int.Parse(ConfigurationManager.AppSettings["watchcount"]); + for(int index=0;index(),nvpDictionary["Executable"].Get(),nvpDictionary["RunAs"].Get()); + managedProcessList.Add(managedProcess); + } + return managedProcessList; + } + catch(Exception exception) + { + String message=exception.InnerException.Message; + throw; + } + } + } +} diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..8cfc38e --- /dev/null +++ b/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.ServiceProcess; +using System.Text; +using System.Threading.Tasks; + +namespace Watchdog +{ + static class Program + { + /// + /// The main entry point for the application. + /// + static void Main() + { + ServiceBase[] ServicesToRun; + ServicesToRun=new ServiceBase[] + { + new Watchdog() + }; + ServiceBase.Run(ServicesToRun); + } + } +} diff --git a/ProjectInstaller.Designer.cs b/ProjectInstaller.Designer.cs new file mode 100644 index 0000000..e71e089 --- /dev/null +++ b/ProjectInstaller.Designer.cs @@ -0,0 +1,58 @@ +namespace Watchdog +{ + partial class ProjectInstaller + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components=null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing&&(components!=null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller(); + this.serviceInstaller = new System.ServiceProcess.ServiceInstaller(); + // + // serviceProcessInstaller + // + this.serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem; + this.serviceProcessInstaller.Password = null; + this.serviceProcessInstaller.Username = null; + // + // serviceInstaller + // + this.serviceInstaller.ServiceName = "Watchdog"; + this.serviceInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic; + // + // ProjectInstaller + // + this.Installers.AddRange(new System.Configuration.Install.Installer[] { + this.serviceProcessInstaller, + this.serviceInstaller}); + + } + + #endregion + + private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller; + private System.ServiceProcess.ServiceInstaller serviceInstaller; + } +} \ No newline at end of file diff --git a/ProjectInstaller.cs b/ProjectInstaller.cs new file mode 100644 index 0000000..9c3d08d --- /dev/null +++ b/ProjectInstaller.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration.Install; +using System.Linq; +using System.Threading.Tasks; + +namespace Watchdog +{ + [RunInstaller(true)] + public partial class ProjectInstaller:System.Configuration.Install.Installer + { + public ProjectInstaller() + { + InitializeComponent(); + } + } +} diff --git a/ProjectInstaller.resx b/ProjectInstaller.resx new file mode 100644 index 0000000..4febb98 --- /dev/null +++ b/ProjectInstaller.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 69 + + + 295, 17 + + + False + + \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..eaa4dc4 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Watchdog")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Watchdog")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("78c77185-4bc2-4a4a-8ec9-2e8b99346ed2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Watchdog.Designer.cs b/Watchdog.Designer.cs new file mode 100644 index 0000000..d314e0b --- /dev/null +++ b/Watchdog.Designer.cs @@ -0,0 +1,37 @@ +namespace Watchdog +{ + partial class Watchdog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components=null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing&&(components!=null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components=new System.ComponentModel.Container(); + this.ServiceName="Service1"; + } + + #endregion + } +} diff --git a/Watchdog.cs b/Watchdog.cs new file mode 100644 index 0000000..e1e38e5 --- /dev/null +++ b/Watchdog.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.ServiceProcess; +using System.Text; +using System.Runtime.InteropServices; +using System.Timers; + +namespace Watchdog +{ + + + public partial class Watchdog : ServiceBase + { + public enum ServiceState + { + SERVICE_STOPPED = 0x00000001, + SERVICE_START_PENDING = 0x00000002, + SERVICE_STOP_PENDING = 0x00000003, + SERVICE_RUNNING = 0x00000004, + SERVICE_CONTINUE_PENDING = 0x00000005, + SERVICE_PAUSE_PENDING = 0x00000006, + SERVICE_PAUSED = 0x00000007, + } + + [StructLayout(LayoutKind.Sequential)] + public struct ServiceStatus + { + public int dwServiceType; + public ServiceState dwCurrentState; + public int dwControlsAccepted; + public int dwWin32ExitCode; + public int dwServiceSpecificExitCode; + public int dwCheckPoint; + public int dwWaitHint; + }; + + private EventLog eventLog=null; + private Timer timer=null; + private int eventId=1; + public Watchdog() + { + InitializeComponent(); + + eventLog = new System.Diagnostics.EventLog(); + if (!System.Diagnostics.EventLog.SourceExists("WatchdogSource")) + { + System.Diagnostics.EventLog.CreateEventSource( + "WatchdogSource","WatchdogLog"); + } + eventLog.Source = "WatchdogSource"; + eventLog.Log = "WatchdogLog"; + } + [DllImport("advapi32.dll", SetLastError = true)] + private static extern bool SetServiceStatus(System.IntPtr handle, ref ServiceStatus serviceStatus); + protected override void OnStart(string[] args) + { + ServiceStatus serviceStatus = new ServiceStatus(); + serviceStatus.dwCurrentState = ServiceState.SERVICE_START_PENDING; + serviceStatus.dwWaitHint = 100000; + SetServiceStatus(this.ServiceHandle, ref serviceStatus); + + eventLog.WriteEntry("Watchdog OnStop"); + + timer = new Timer(); + timer.Interval = 1000; // 60 seconds + timer.Elapsed += new ElapsedEventHandler(this.OnTimer); + timer.Start(); + + serviceStatus.dwCurrentState = ServiceState.SERVICE_RUNNING; + SetServiceStatus(this.ServiceHandle, ref serviceStatus); + } + + protected override void OnStop() + { + ServiceStatus serviceStatus = new ServiceStatus(); + serviceStatus.dwCurrentState = ServiceState.SERVICE_STOP_PENDING; + serviceStatus.dwWaitHint = 100000; + SetServiceStatus(this.ServiceHandle, ref serviceStatus); + + eventLog.WriteEntry("Watchdog OnStop"); + + serviceStatus.dwCurrentState = ServiceState.SERVICE_STOPPED; + SetServiceStatus(this.ServiceHandle, ref serviceStatus); + } + protected override void OnContinue() + { + eventLog.WriteEntry("Watchdog OnContinue"); + } + + private void OnTimer(Object sender,ElapsedEventArgs elapsedEventArgs) + { + if(1==eventId)timer.Interval=60000; + eventLog.WriteEntry(String.Format("Watchdog monitoring: {0}",eventId++)); + List managedProcessList=null; + managedProcessList=ProcessManager.GetManagedProceses(); + ProcessManager.ManageProcesses(managedProcessList, eventLog); + + } + } +} diff --git a/Watchdog.csproj b/Watchdog.csproj new file mode 100644 index 0000000..2e39db8 --- /dev/null +++ b/Watchdog.csproj @@ -0,0 +1,89 @@ + + + + + Debug + AnyCPU + {BA8EF3F5-3980-4C4D-96DF-6766434E3671} + WinExe + Properties + Watchdog + Watchdog + v4.6.2 + 512 + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + Component + + + ProjectInstaller.cs + + + Component + + + Watchdog.cs + + + + + + + Designer + + + + + ProjectInstaller.cs + + + + + {e807f1ca-9d9c-484a-8e83-269d57707b4b} + MarketDataLib + + + + + \ No newline at end of file diff --git a/Watchdog.sln b/Watchdog.sln new file mode 100644 index 0000000..574ff73 --- /dev/null +++ b/Watchdog.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Watchdog", "Watchdog.csproj", "{BA8EF3F5-3980-4C4D-96DF-6766434E3671}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarketDataLib", "..\marketdata\MarketDataLib\MarketDataLib.csproj", "{E807F1CA-9D9C-484A-8E83-269D57707B4B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchdogConsoleHelper", "WatchdogConsoleHelper\WatchdogConsoleHelper.csproj", "{7A23289F-122E-422E-BC60-910F73A9BC68}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BA8EF3F5-3980-4C4D-96DF-6766434E3671}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA8EF3F5-3980-4C4D-96DF-6766434E3671}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA8EF3F5-3980-4C4D-96DF-6766434E3671}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA8EF3F5-3980-4C4D-96DF-6766434E3671}.Release|Any CPU.Build.0 = Release|Any CPU + {E807F1CA-9D9C-484A-8E83-269D57707B4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E807F1CA-9D9C-484A-8E83-269D57707B4B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E807F1CA-9D9C-484A-8E83-269D57707B4B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E807F1CA-9D9C-484A-8E83-269D57707B4B}.Release|Any CPU.Build.0 = Release|Any CPU + {7A23289F-122E-422E-BC60-910F73A9BC68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A23289F-122E-422E-BC60-910F73A9BC68}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A23289F-122E-422E-BC60-910F73A9BC68}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A23289F-122E-422E-BC60-910F73A9BC68}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/WatchdogConsoleHelper/App.config b/WatchdogConsoleHelper/App.config new file mode 100644 index 0000000..d9b7e11 --- /dev/null +++ b/WatchdogConsoleHelper/App.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/WatchdogConsoleHelper/Program.cs b/WatchdogConsoleHelper/Program.cs new file mode 100644 index 0000000..44f6ac7 --- /dev/null +++ b/WatchdogConsoleHelper/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Configuration; +using MarketData.Utils; +using Watchdog; +// This is just a helper app for building and testing stuff for the service + +namespace WatchdogConsoleHelper +{ + class Program + { + static void Main(string[] args) + { + List managedProcessList=null; + managedProcessList=ProcessManager.GetManagedProceses(); + ProcessManager.ManageProcesses(managedProcessList); + } + } +} diff --git a/WatchdogConsoleHelper/Properties/AssemblyInfo.cs b/WatchdogConsoleHelper/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0ba7e62 --- /dev/null +++ b/WatchdogConsoleHelper/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WatchdogConsoleHelper")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WatchdogConsoleHelper")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7cf8c5d5-b130-493e-9af9-8c0c58f63a2a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WatchdogConsoleHelper/WatchdogConsoleHelper.csproj b/WatchdogConsoleHelper/WatchdogConsoleHelper.csproj new file mode 100644 index 0000000..3bdd181 --- /dev/null +++ b/WatchdogConsoleHelper/WatchdogConsoleHelper.csproj @@ -0,0 +1,70 @@ + + + + + Debug + AnyCPU + {7A23289F-122E-422E-BC60-910F73A9BC68} + Exe + Properties + WatchdogConsoleHelper + WatchdogConsoleHelper + v4.6.2 + 512 + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {e807f1ca-9d9c-484a-8e83-269d57707b4b} + MarketDataLib + + + {ba8ef3f5-3980-4c4d-96df-6766434e3671} + Watchdog + + + + + \ No newline at end of file