├── .gitignore ├── Common ├── COPYING.txt ├── Common.csproj ├── ConfigurationWrapper.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Controller ├── COPYING.txt ├── Controller.csproj ├── Core │ ├── FileSystemSearcher.cs │ ├── FileWatcher.cs │ ├── FileWatcherConfigurationSet.cs │ ├── FileWatcherController.cs │ ├── FileWatcherServiceProxy.cs │ ├── FileWatcherStreamingServiceProxy.cs │ └── ProcessRunner.cs ├── Data │ ├── DataSetBuilder.cs │ ├── XmlConfigurationLoader.cs │ ├── XmlConfigurationSaver.cs │ └── XmlValidator.cs ├── EventArgs │ ├── ControllerProcessStartedEventArgs.cs │ ├── FileSystemSearcherErrorEventArgs.cs │ ├── FileSystemSearcherProgressEventArgs.cs │ ├── FileWatcherBufferErrorEventArgs.cs │ ├── FileWatcherEventArgs.cs │ ├── FileWatcherPathErrorEventArgs.cs │ ├── FileWatcherRecycledEventArgs.cs │ ├── FileWatcherRecycledReasonEnum.cs │ ├── FileWatcherSearchErrorEventArgs.cs │ ├── FileWatcherSearchProgressEventArgs.cs │ ├── FileWatcherStartedEventArgs.cs │ ├── FileWatcherStartingEventArgs.cs │ ├── FileWatcherStoppedEventArgs.cs │ ├── ProcessCancelledEventArgs.cs │ ├── ProcessCancelledReasonEnum.cs │ ├── ProcessDataEventArgs.cs │ ├── ProcessErrorEventArgs.cs │ ├── ProcessExitEventArgs.cs │ ├── ProcessStartedEventArgs.cs │ ├── ServiceBeginCallEventArgs.cs │ ├── ServiceCalledEventArgs.cs │ ├── ServiceErrorEventArgs.cs │ └── ServiceProxyCreationErrorEventArgs.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── FileWatcherConsole ├── App.config ├── COPYING.txt ├── FileWatcherConsole.csproj ├── Help │ ├── FileWatcherConsole.html │ ├── FileWatcherConsole.png │ ├── FileWatcherSimple.html │ ├── FileWatcherSimple.png │ ├── FileWatcherUtilities.html │ ├── FileWatcherWindowsService.html │ ├── Help.css │ ├── Index.html │ ├── LogFile.html │ ├── ServiceContracts.html │ └── XmlConfigurationFiles.html ├── Program │ ├── ConsoleView.cs │ └── Program.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ └── app.manifest ├── FileWatcherServiceContract ├── COPYING.txt ├── DefaultFault.cs ├── FileWatcherServiceContract.csproj ├── IFileWatcherService.cs ├── IFileWatcherStreamingService.cs ├── IResponse.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── SystemChangedReqDC.cs ├── SystemChangedReqMC.cs ├── SystemChangedRespDC.cs └── SystemChangedRespMC.cs ├── FileWatcherSimple ├── App.config ├── COPYING.txt ├── FileWatcherSimple.csproj ├── Help │ ├── FileWatcherConsole.html │ ├── FileWatcherConsole.png │ ├── FileWatcherSimple.html │ ├── FileWatcherSimple.png │ ├── FileWatcherUtilities.html │ ├── FileWatcherWindowsService.html │ ├── Help.css │ ├── Index.html │ ├── LogFile.html │ ├── ServiceContracts.html │ └── XmlConfigurationFiles.html ├── Program │ ├── FormAbout.Designer.cs │ ├── FormAbout.cs │ ├── FormAbout.resx │ ├── FormMain.cs │ ├── FormMain.designer.cs │ ├── FormMain.resx │ ├── FormOptions.Designer.cs │ ├── FormOptions.cs │ ├── FormOptions.resx │ ├── FormProperties.Designer.cs │ ├── FormProperties.cs │ ├── FormProperties.resx │ └── Program.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── FileWatcherUtilities.sln ├── FileWatcherWindowsService ├── App.config ├── COPYING.txt ├── FileWatcherWindowsService.csproj ├── Help │ ├── FileWatcherConsole.html │ ├── FileWatcherConsole.png │ ├── FileWatcherSimple.html │ ├── FileWatcherSimple.png │ ├── FileWatcherUtilities.html │ ├── FileWatcherWindowsService.html │ ├── Help.css │ ├── Index.html │ ├── LogFile.html │ ├── ServiceContracts.html │ └── XmlConfigurationFiles.html ├── InstallFileWatcherWindowsService.bat ├── Program │ ├── FileWatcherUtilitiesWindowsService.cs │ ├── Program.cs │ ├── ServiceInstaller.cs │ └── WindowsServiceView.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── FileWatcherWindowsServiceTestApplication ├── App.config ├── COPYING.txt ├── FileWatcherWindowsServiceTestApplication.csproj ├── Program │ └── Program.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── LICENSE ├── Logger ├── COPYING.txt ├── Data │ └── MessageTypeEnum.cs ├── Formatter │ └── DefaultFormatter.cs ├── Interfaces │ ├── IFormatter.cs │ └── ILogger.cs ├── Logger.csproj ├── Logger │ └── DefaultLogger.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Options ├── ApplicationOptions.cs ├── ApplicationOptionsChangedEventArgs.cs ├── ApplicationOptionsController.cs ├── COPYING.txt ├── DataSetBuilder.cs ├── Options.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── XmlOptionsLoader.cs ├── XmlOptionsSaver.cs └── XmlValidator.cs ├── Presenter ├── COPYING.txt ├── Data │ ├── FileWatcherExampleDaemonWriter.cs │ ├── FileWatcherInfo.cs │ ├── GNULicense.cs │ ├── ResourceGNU.Designer.cs │ └── ResourceGNU.resx ├── EventArgs │ ├── ConsoleStartedEventArgs.cs │ ├── DaemonSelectedEventArgs.cs │ ├── ServiceStartedEventArgs.cs │ └── ServiceStoppedEventArgs.cs ├── Interfaces │ ├── IConsoleView.cs │ ├── ILogView.cs │ ├── IMainView.cs │ ├── IOptionsView.cs │ ├── IPropertiesView.cs │ └── IWindowsServiceView.cs ├── Presenter.csproj ├── Presenter │ ├── ConsoleViewPresenter.cs │ ├── LogViewPresenter.cs │ ├── LogViewPresenterBase.cs │ ├── MainViewPresenter.cs │ ├── MainViewPresenterBase.cs │ ├── OptionsViewPresenter.cs │ ├── PresenterBuilder.cs │ ├── PropertiesViewPresenter.cs │ └── WindowsServiceViewPresenter.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── README.md ├── SampleFileWatcherService ├── COPYING.txt ├── FileWatcherService.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx └── SampleFileWatcherService.csproj ├── SampleFileWatcherStreamingService ├── COPYING.txt ├── FileWatcherStreamingService.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx └── SampleFileWatcherStreamingService.csproj └── humans.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | # DNX 42 | project.lock.json 43 | artifacts/ 44 | 45 | *_i.c 46 | *_p.c 47 | *_i.h 48 | *.ilk 49 | *.meta 50 | *.obj 51 | *.pch 52 | *.pdb 53 | *.pgc 54 | *.pgd 55 | *.rsp 56 | *.sbr 57 | *.tlb 58 | *.tli 59 | *.tlh 60 | *.tmp 61 | *.tmp_proj 62 | *.log 63 | *.vspscc 64 | *.vssscc 65 | .builds 66 | *.pidb 67 | *.svclog 68 | *.scc 69 | 70 | # Chutzpah Test files 71 | _Chutzpah* 72 | 73 | # Visual C++ cache files 74 | ipch/ 75 | *.aps 76 | *.ncb 77 | *.opensdf 78 | *.sdf 79 | *.cachefile 80 | 81 | # Visual Studio profiler 82 | *.psess 83 | *.vsp 84 | *.vspx 85 | 86 | # TFS 2012 Local Workspace 87 | $tf/ 88 | 89 | # Guidance Automation Toolkit 90 | *.gpState 91 | 92 | # ReSharper is a .NET coding add-in 93 | _ReSharper*/ 94 | *.[Rr]e[Ss]harper 95 | *.DotSettings.user 96 | 97 | # JustCode is a .NET coding add-in 98 | .JustCode 99 | 100 | # TeamCity is a build add-in 101 | _TeamCity* 102 | 103 | # DotCover is a Code Coverage Tool 104 | *.dotCover 105 | 106 | # NCrunch 107 | _NCrunch_* 108 | .*crunch*.local.xml 109 | 110 | # MightyMoose 111 | *.mm.* 112 | AutoTest.Net/ 113 | 114 | # Web workbench (sass) 115 | .sass-cache/ 116 | 117 | # Installshield output folder 118 | [Ee]xpress/ 119 | 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | 130 | # Click-Once directory 131 | publish/ 132 | 133 | # Publish Web Output 134 | *.[Pp]ublish.xml 135 | *.azurePubxml 136 | ## TODO: Comment the next line if you want to checkin your 137 | ## web deploy settings but do note that will include unencrypted 138 | ## passwords 139 | #*.pubxml 140 | 141 | *.publishproj 142 | 143 | # NuGet Packages 144 | *.nupkg 145 | # The packages folder can be ignored because of Package Restore 146 | **/packages/* 147 | # except build/, which is used as an MSBuild target. 148 | !**/packages/build/ 149 | # Uncomment if necessary however generally it will be regenerated when needed 150 | #!**/packages/repositories.config 151 | 152 | # Windows Azure Build Output 153 | csx/ 154 | *.build.csdef 155 | 156 | # Windows Store app package directory 157 | AppPackages/ 158 | 159 | # Visual Studio cache files 160 | # files ending in .cache can be ignored 161 | *.[Cc]ache 162 | # but keep track of directories ending in .cache 163 | !*.[Cc]ache/ 164 | 165 | # Others 166 | ClientBin/ 167 | [Ss]tyle[Cc]op.* 168 | ~$* 169 | *~ 170 | *.dbmdl 171 | *.dbproj.schemaview 172 | *.pfx 173 | *.publishsettings 174 | node_modules/ 175 | orleans.codegen.cs 176 | 177 | # RIA/Silverlight projects 178 | Generated_Code/ 179 | 180 | # Backup & report files from converting an old project file 181 | # to a newer Visual Studio version. Backup files are not needed, 182 | # because we have git ;-) 183 | _UpgradeReport_Files/ 184 | Backup*/ 185 | UpgradeLog*.XML 186 | UpgradeLog*.htm 187 | 188 | # SQL Server files 189 | *.mdf 190 | *.ldf 191 | 192 | # Business Intelligence projects 193 | *.rdl.data 194 | *.bim.layout 195 | *.bim_*.settings 196 | 197 | # Microsoft Fakes 198 | FakesAssemblies/ 199 | 200 | # Node.js Tools for Visual Studio 201 | .ntvs_analysis.dat 202 | 203 | # Visual Studio 6 build log 204 | *.plg 205 | 206 | # Visual Studio 6 workspace options file 207 | *.opt 208 | 209 | # LightSwitch generated files 210 | GeneratedArtifacts/ 211 | _Pvt_Extensions/ 212 | ModelManifest.xml 213 | -------------------------------------------------------------------------------- /Common/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Utilities Common")] 8 | [assembly: AssemblyDescription("File Watcher Utilities Common")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Utilities Common")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("22613ec9-7b11-482c-b950-7285d01b35b2")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] 32 | -------------------------------------------------------------------------------- /Controller/Core/FileWatcherServiceProxy.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | #if (!_NET_20) 21 | 22 | using System.ServiceModel; 23 | using FileWatcherUtilities.FileWatcherServiceContract; 24 | 25 | namespace FileWatcherUtilities.Controller 26 | { 27 | internal sealed class FileWatcherServiceProxy : ClientBase, IFileWatcherService 28 | { 29 | public FileWatcherServiceProxy() 30 | { 31 | } 32 | 33 | public FileWatcherServiceProxy(string endpointConfigurationName) : 34 | base(endpointConfigurationName) 35 | { 36 | } 37 | 38 | public FileWatcherServiceProxy(string endpointConfigurationName, string remoteAddress) : 39 | base(endpointConfigurationName, remoteAddress) 40 | { 41 | } 42 | 43 | public FileWatcherServiceProxy(string endpointConfigurationName, EndpointAddress remoteAddress) : 44 | base(endpointConfigurationName, remoteAddress) 45 | { 46 | } 47 | 48 | public FileWatcherServiceProxy(System.ServiceModel.Channels.Binding binding, EndpointAddress remoteAddress) : 49 | base(binding, remoteAddress) 50 | { 51 | } 52 | 53 | public SystemChangedRespDC SystemChanged(SystemChangedReqDC request) 54 | { 55 | return Channel.SystemChanged(request); 56 | } 57 | } 58 | } 59 | 60 | #endif -------------------------------------------------------------------------------- /Controller/Core/FileWatcherStreamingServiceProxy.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | #if (!_NET_20) 21 | 22 | using System; 23 | using System.IO; 24 | using System.ServiceModel; 25 | using FileWatcherUtilities.FileWatcherServiceContract; 26 | 27 | namespace FileWatcherUtilities.Controller 28 | { 29 | internal sealed class FileWatcherStreamingServiceProxy : ClientBase, IFileWatcherStreamingService 30 | { 31 | public FileWatcherStreamingServiceProxy() 32 | { 33 | } 34 | 35 | public FileWatcherStreamingServiceProxy(string endpointConfigurationName) : 36 | base(endpointConfigurationName) 37 | { 38 | } 39 | 40 | public FileWatcherStreamingServiceProxy(string endpointConfigurationName, string remoteAddress) : 41 | base(endpointConfigurationName, remoteAddress) 42 | { 43 | } 44 | 45 | public FileWatcherStreamingServiceProxy(string endpointConfigurationName, EndpointAddress remoteAddress) : 46 | base(endpointConfigurationName, remoteAddress) 47 | { 48 | } 49 | 50 | public FileWatcherStreamingServiceProxy(System.ServiceModel.Channels.Binding binding, EndpointAddress remoteAddress) : 51 | base(binding, remoteAddress) 52 | { 53 | } 54 | 55 | SystemChangedRespMC IFileWatcherStreamingService.SystemChangedStreaming(SystemChangedReqMC request) 56 | { 57 | return Channel.SystemChangedStreaming(request); 58 | } 59 | 60 | public string SystemChangedStreaming(string changeType, string checksum, string daemonName, DateTime dateTime, string fileName, long fileStreamLength, string fullPath, Guid id, string machineName, string oldFullPath, Stream fileStream) 61 | { 62 | SystemChangedReqMC inValue = new SystemChangedReqMC(); 63 | inValue.ChangeType = changeType; 64 | inValue.Checksum = checksum; 65 | inValue.DaemonName = daemonName; 66 | inValue.DateTime = dateTime; 67 | inValue.FileName = fileName; 68 | inValue.FileStreamLength = fileStreamLength; 69 | inValue.FullPath = fullPath; 70 | inValue.Id = id; 71 | inValue.MachineName = machineName; 72 | inValue.OldFullPath = oldFullPath; 73 | inValue.FileStream = fileStream; 74 | SystemChangedRespMC retVal = ((IFileWatcherStreamingService)(this)).SystemChangedStreaming(inValue); 75 | return retVal.Message; 76 | } 77 | } 78 | } 79 | 80 | #endif -------------------------------------------------------------------------------- /Controller/EventArgs/FileSystemSearcherErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for FileSystemSearchError event. 27 | /// 28 | public class FileSystemSearcherErrorEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the FileSystemSearcherErrorEventArgs class. 32 | /// 33 | /// Exception. 34 | /// exception is null. 35 | public FileSystemSearcherErrorEventArgs(Exception exception) 36 | { 37 | if (exception == null) 38 | { 39 | throw new ArgumentNullException("exception", 40 | Resources.ArgumentNullException); 41 | } 42 | _exception = exception; 43 | } 44 | 45 | /// 46 | /// Gets exception. 47 | /// 48 | public Exception Exception 49 | { 50 | get 51 | { 52 | return _exception; 53 | } 54 | } 55 | 56 | /// 57 | /// Contains exception. 58 | /// 59 | private readonly Exception _exception; 60 | } 61 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileSystemSearcherProgressEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for FileSystemSearchProgress event. 27 | /// 28 | public class FileSystemSearcherProgressEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the FileSystemSearcherProgressEventArgs class. 32 | /// 33 | /// Directory full path. 34 | /// directoryFullPath is null. 35 | public FileSystemSearcherProgressEventArgs(string directoryFullPath) 36 | { 37 | if (directoryFullPath == null) 38 | { 39 | throw new ArgumentNullException("directoryFullPath", 40 | Resources.ArgumentNullException); 41 | } 42 | _directoryFullPath = directoryFullPath; 43 | } 44 | 45 | /// 46 | /// Gets directory full path. 47 | /// 48 | public string DirectoryFullPath 49 | { 50 | get 51 | { 52 | return _directoryFullPath; 53 | } 54 | } 55 | 56 | /// 57 | /// Contains directory full path. 58 | /// 59 | private readonly string _directoryFullPath; 60 | } 61 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileWatcherBufferErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.IO; 22 | using FileWatcherUtilities.Controller.Properties; 23 | 24 | namespace FileWatcherUtilities.Controller 25 | { 26 | /// 27 | /// Provides data for FileWatcherBufferError event. 28 | /// 29 | public class FileWatcherBufferErrorEventArgs : EventArgs 30 | { 31 | /// 32 | /// Initializes a new instance of the FileWatcherBufferErrorEventArgs class. 33 | /// 34 | /// Daemon name of the file watcher. 35 | /// ErrorEventArgs. 36 | /// e is null. 37 | /// daemonName is null. 38 | public FileWatcherBufferErrorEventArgs(string daemonName, 39 | ErrorEventArgs e) 40 | { 41 | if (e == null) 42 | { 43 | throw new ArgumentNullException("e", 44 | Resources.ArgumentNullException); 45 | } 46 | if (daemonName == null) 47 | { 48 | throw new ArgumentNullException("daemonName", 49 | Resources.ArgumentNullException); 50 | } 51 | _daemonName = daemonName; 52 | _errorEventArgs = e; 53 | } 54 | 55 | /// 56 | /// Gets the daemon name. 57 | /// 58 | public string DaemonName 59 | { 60 | get 61 | { 62 | return _daemonName; 63 | } 64 | } 65 | 66 | /// 67 | /// Gets the error event args. 68 | /// 69 | public ErrorEventArgs ErrorEventArgs 70 | { 71 | get 72 | { 73 | return _errorEventArgs; 74 | } 75 | } 76 | 77 | /// 78 | /// Gets the date and time of the buffer error. 79 | /// 80 | public DateTime DateTime 81 | { 82 | get 83 | { 84 | return _dateTime; 85 | } 86 | } 87 | 88 | /// 89 | /// Contains daemon name. 90 | /// 91 | private readonly string _daemonName; 92 | 93 | /// 94 | /// Contains error event args. 95 | /// 96 | private readonly ErrorEventArgs _errorEventArgs; 97 | 98 | /// 99 | /// Contains the date and time of the buffer error. 100 | /// 101 | private readonly DateTime _dateTime = DateTime.Now; 102 | } 103 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileWatcherPathErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for FileWatcherPathError event. 27 | /// 28 | public class FileWatcherPathErrorEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the FileWatcherPathErrorEventArgs class. 32 | /// 33 | /// Daemon name of the file watcher. 34 | /// Path of the file watcher to watch. 35 | /// daemonName is null. 36 | /// path is null. 37 | public FileWatcherPathErrorEventArgs(string daemonName, 38 | string path) 39 | { 40 | if (daemonName == null) 41 | { 42 | throw new ArgumentNullException("daemonName", 43 | Resources.ArgumentNullException); 44 | } 45 | if (path == null) 46 | { 47 | throw new ArgumentNullException("path", 48 | Resources.ArgumentNullException); 49 | } 50 | _daemonName = daemonName; 51 | _path = path; 52 | } 53 | 54 | /// 55 | /// Gets file watcher daemon name. 56 | /// 57 | public string DaemonName 58 | { 59 | get 60 | { 61 | return _daemonName; 62 | } 63 | } 64 | 65 | /// 66 | /// Gets path. 67 | /// 68 | public string Path 69 | { 70 | get 71 | { 72 | return _path; 73 | } 74 | } 75 | 76 | /// 77 | /// Contains daemon name. 78 | /// 79 | private readonly string _daemonName; 80 | 81 | /// 82 | /// Contains path. 83 | /// 84 | private readonly string _path; 85 | } 86 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileWatcherRecycledEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for FileWatcherRecycle event. 27 | /// 28 | public class FileWatcherRecycledEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the ProcessCanceledEventArgs class. 32 | /// 33 | /// The name of the daemon. 34 | /// Reason of the recycle. 35 | /// daemonName is null. 36 | public FileWatcherRecycledEventArgs(string daemonName, 37 | RecycleReason reason) 38 | { 39 | if (daemonName == null) 40 | { 41 | throw new ArgumentNullException("daemonName", 42 | Resources.ArgumentNullException); 43 | } 44 | _daemonName = daemonName; 45 | _reason = reason; 46 | } 47 | 48 | /// 49 | /// Gets the name of the daemon. 50 | /// 51 | public string DaemonName 52 | { 53 | get 54 | { 55 | return _daemonName; 56 | } 57 | } 58 | 59 | /// 60 | /// Gets the reason. 61 | /// 62 | public RecycleReason Reason 63 | { 64 | get 65 | { 66 | return _reason; 67 | } 68 | } 69 | 70 | /// 71 | /// Contains daemon name. 72 | /// 73 | private readonly string _daemonName; 74 | 75 | /// 76 | /// Contains reason. 77 | /// 78 | private readonly RecycleReason _reason; 79 | } 80 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileWatcherRecycledReasonEnum.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | namespace FileWatcherUtilities.Controller 21 | { 22 | /// 23 | /// File system watcher recycled reasons. 24 | /// 25 | public enum RecycleReason 26 | { 27 | /// 28 | /// Default value. 29 | /// 30 | None = 0, 31 | /// 32 | /// File system watcher was recycled because directory was not found. 33 | /// 34 | DirectoryNotFound = 1, 35 | /// 36 | /// File system watcher was recycled because of an error. 37 | /// 38 | Error = 2, 39 | /// 40 | /// File system watcher was recycled. 41 | /// 42 | Recycle = 3 43 | } 44 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileWatcherSearchErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for FileWatcherSearchError event. 27 | /// 28 | public class FileWatcherSearchErrorEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the FileWatcherSearchErrorEventArgs class. 32 | /// 33 | /// Daemon name of the file watcher. 34 | /// Exception. 35 | /// True if file watcher search error event should be displayed. 36 | /// True if file watcher search error event should be logged. 37 | /// daemonName is null. 38 | /// exception is null. 39 | public FileWatcherSearchErrorEventArgs(string daemonName, 40 | Exception exception, 41 | bool displayEvent, 42 | bool logEvent) 43 | { 44 | if (exception == null) 45 | { 46 | throw new ArgumentNullException("exception", 47 | Resources.ArgumentNullException); 48 | } 49 | if (daemonName == null) 50 | { 51 | throw new ArgumentNullException("daemonName", 52 | Resources.ArgumentNullException); 53 | } 54 | _daemonName = daemonName; 55 | _exception = exception; 56 | _displayEvent = displayEvent; 57 | _logEvent = logEvent; 58 | } 59 | 60 | /// 61 | /// Gets file watcher daemon name. 62 | /// 63 | public string DaemonName 64 | { 65 | get 66 | { 67 | return _daemonName; 68 | } 69 | } 70 | 71 | /// 72 | /// Gets exception. 73 | /// 74 | public Exception Exception 75 | { 76 | get 77 | { 78 | return _exception; 79 | } 80 | } 81 | 82 | /// 83 | /// Gets the log event value. True if file watcher search error event should be logged. 84 | /// 85 | public bool LogEvent 86 | { 87 | get 88 | { 89 | return _logEvent; 90 | } 91 | } 92 | 93 | /// 94 | /// Gets the display event value. True if file watcher search error event should be displayed. 95 | /// 96 | public bool DisplayEvent 97 | { 98 | get 99 | { 100 | return _displayEvent; 101 | } 102 | } 103 | 104 | /// 105 | /// Contains exception. 106 | /// 107 | private readonly Exception _exception; 108 | 109 | /// 110 | /// Contains daemon name. 111 | /// 112 | private readonly string _daemonName; 113 | 114 | /// 115 | /// True if file watcher search error event should be logged. 116 | /// 117 | private readonly bool _logEvent; 118 | 119 | /// 120 | /// True if file watcher search error event should be displayed. 121 | /// 122 | private readonly bool _displayEvent; 123 | } 124 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileWatcherStartedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for FileWatcherStarted event. 27 | /// 28 | public class FileWatcherStartedEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the FileWatcherStartedEventArgs class. 32 | /// 33 | /// Daemon name of the file started watcher. 34 | /// daemonName is null. 35 | public FileWatcherStartedEventArgs(string daemonName) 36 | { 37 | if (daemonName == null) 38 | { 39 | throw new ArgumentNullException("daemonName", 40 | Resources.ArgumentNullException); 41 | } 42 | _daemonName = daemonName; 43 | } 44 | 45 | /// 46 | /// Gets file watcher daemon name. 47 | /// 48 | public string DaemonName 49 | { 50 | get 51 | { 52 | return _daemonName; 53 | } 54 | } 55 | 56 | /// 57 | /// Contains daemon name. 58 | /// 59 | private readonly string _daemonName; 60 | } 61 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileWatcherStartingEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for FileWatcherStarting event. 27 | /// 28 | public class FileWatcherStartingEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the FileWatcherStartingEventArgs class. 32 | /// 33 | /// Daemon name of the file started watcher. 34 | /// daemonName is null. 35 | public FileWatcherStartingEventArgs(string daemonName) 36 | { 37 | if (daemonName == null) 38 | { 39 | throw new ArgumentNullException("daemonName", 40 | Resources.ArgumentNullException); 41 | } 42 | _daemonName = daemonName; 43 | } 44 | 45 | /// 46 | /// Gets file watcher daemon name. 47 | /// 48 | public string DaemonName 49 | { 50 | get 51 | { 52 | return _daemonName; 53 | } 54 | } 55 | 56 | /// 57 | /// Contains daemon name. 58 | /// 59 | private readonly string _daemonName; 60 | } 61 | } -------------------------------------------------------------------------------- /Controller/EventArgs/FileWatcherStoppedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for FileWatcherStopped event. 27 | /// 28 | public class FileWatcherStoppedEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the FileWatcherStoppedEventArgs class. 32 | /// 33 | /// Daemon name of the file stopped watcher. 34 | /// daemonName is null. 35 | public FileWatcherStoppedEventArgs(string daemonName) 36 | { 37 | if (daemonName == null) 38 | { 39 | throw new ArgumentNullException("daemonName", 40 | Resources.ArgumentNullException); 41 | } 42 | _daemonName = daemonName; 43 | } 44 | 45 | /// 46 | /// Gets file watcher daemon name. 47 | /// 48 | public string DaemonName 49 | { 50 | get 51 | { 52 | return _daemonName; 53 | } 54 | } 55 | 56 | /// 57 | /// Contains daemon name. 58 | /// 59 | private readonly string _daemonName; 60 | } 61 | } -------------------------------------------------------------------------------- /Controller/EventArgs/ProcessCancelledReasonEnum.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | namespace FileWatcherUtilities.Controller 21 | { 22 | /// 23 | /// Process canceled reasons. 24 | /// 25 | public enum ProcessCanceledReason 26 | { 27 | /// 28 | /// File lock test failed. 29 | /// 30 | FileLockTestFailed, 31 | /// 32 | /// Renaming of the fail failed. 33 | /// 34 | RenameFailed, 35 | /// 36 | /// File did't exist. 37 | /// 38 | FileWasMissing 39 | } 40 | } -------------------------------------------------------------------------------- /Controller/EventArgs/ProcessDataEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for ProcessData event. 27 | /// 28 | public class ProcessDataEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the ProcessDataEventArgs class. 32 | /// 33 | /// The name of the daemon which is running the process. 34 | /// Process Id. 35 | /// Process data. 36 | /// daemonName is null. 37 | /// data is null. 38 | public ProcessDataEventArgs(string daemonName, 39 | int processId, 40 | string data) 41 | { 42 | if (daemonName == null) 43 | { 44 | throw new ArgumentNullException("daemonName", 45 | Resources.ArgumentNullException); 46 | } 47 | if (data == null) 48 | { 49 | throw new ArgumentNullException("data", 50 | Resources.ArgumentNullException); 51 | } 52 | _daemonName = daemonName; 53 | _processId = processId; 54 | _data = data; 55 | } 56 | 57 | /// 58 | /// Gets the name of the daemon which is running the process. 59 | /// 60 | public string DaemonName 61 | { 62 | get 63 | { 64 | return _daemonName; 65 | } 66 | } 67 | 68 | /// 69 | /// Gets the process Id. 70 | /// 71 | public int ProcessId 72 | { 73 | get 74 | { 75 | return _processId; 76 | } 77 | } 78 | 79 | /// 80 | /// Gets the process data. 81 | /// 82 | public string Data 83 | { 84 | get 85 | { 86 | return _data; 87 | } 88 | } 89 | 90 | /// 91 | /// Contains daemon name. 92 | /// 93 | private readonly string _daemonName; 94 | 95 | /// 96 | /// Contains process Id. 97 | /// 98 | private readonly int _processId; 99 | 100 | /// 101 | /// Contains process data. 102 | /// 103 | private readonly string _data; 104 | } 105 | } -------------------------------------------------------------------------------- /Controller/EventArgs/ProcessErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for ProcessError event. 27 | /// 28 | public class ProcessErrorEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the ProcessErrorEventArgs class. 32 | /// 33 | /// Process exception. 34 | /// The name of the daemon which is running the process. 35 | /// Number of queued processes on the controller. 36 | /// exception is null. 37 | /// daemonName is null. 38 | /// queued processes value cannot be less than zero. 39 | public ProcessErrorEventArgs(string daemonName, 40 | Exception exception, 41 | int queuedProcesses) 42 | { 43 | if (daemonName == null) 44 | { 45 | throw new ArgumentNullException("daemonName", 46 | Resources.ArgumentNullException); 47 | } 48 | if (exception == null) 49 | { 50 | throw new ArgumentNullException("exception", 51 | Resources.ArgumentNullException); 52 | } 53 | if (queuedProcesses < 0) 54 | { 55 | throw new ArgumentException(Resources.ArgumentExceptionValueCannotBeLessThanZero, 56 | "queuedProcesses"); 57 | } 58 | _daemonName = daemonName; 59 | _exception = exception; 60 | _queuedProcesses = queuedProcesses; 61 | } 62 | 63 | /// 64 | /// Gets the process exception. 65 | /// 66 | public Exception Exception 67 | { 68 | get 69 | { 70 | return _exception; 71 | } 72 | } 73 | 74 | /// 75 | /// Gets the name of the daemon which is running the process. 76 | /// 77 | public string DaemonName 78 | { 79 | get 80 | { 81 | return _daemonName; 82 | } 83 | } 84 | 85 | /// 86 | /// Gets the number of queued processes on the controller. 87 | /// 88 | public int QueuedProcesses 89 | { 90 | get 91 | { 92 | return _queuedProcesses; 93 | } 94 | } 95 | 96 | /// 97 | /// Contains process exception. 98 | /// 99 | private readonly Exception _exception; 100 | 101 | /// 102 | /// Contains the name of the daemon which is running the process. 103 | /// 104 | private readonly string _daemonName; 105 | 106 | /// 107 | /// Number of queued processes on the controller. 108 | /// 109 | private readonly int _queuedProcesses; 110 | } 111 | } -------------------------------------------------------------------------------- /Controller/EventArgs/ServiceBeginCallEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for ServiceBeginCall event. 27 | /// 28 | public class ServiceBeginCallEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the ServiceBeginCallEventArgs class. 32 | /// 33 | /// The name of the daemon which is calling the service. 34 | /// Number of queued processes on the controller. 35 | /// Event identifier. 36 | /// daemonName is null. 37 | /// id is Guid.Empty. 38 | public ServiceBeginCallEventArgs(string daemonName, 39 | int queuedProcesses, 40 | Guid id) 41 | { 42 | if (daemonName == null) 43 | { 44 | throw new ArgumentNullException("daemonName", 45 | Resources.ArgumentNullException); 46 | } 47 | if (id == Guid.Empty) 48 | { 49 | throw new ArgumentException(Resources.ArgumentExceptionIdIsEmpty, 50 | "id"); 51 | } 52 | _daemonName = daemonName; 53 | _queuedProcesses = queuedProcesses; 54 | _guid = id; 55 | } 56 | 57 | /// 58 | /// Gets the name of the daemon which is calling the service. 59 | /// 60 | public string DaemonName 61 | { 62 | get 63 | { 64 | return _daemonName; 65 | } 66 | } 67 | 68 | /// 69 | /// Gets the number of queued processes on the controller. 70 | /// 71 | public int QueuedProcesses 72 | { 73 | get 74 | { 75 | return _queuedProcesses; 76 | } 77 | } 78 | 79 | /// 80 | /// Identifies event. 81 | /// 82 | public Guid Id 83 | { 84 | get 85 | { 86 | return _guid; 87 | } 88 | } 89 | 90 | /// 91 | /// Identifies event. 92 | /// 93 | private readonly Guid _guid; 94 | 95 | /// 96 | /// Contains the name of the daemon which is calling the service. 97 | /// 98 | private readonly string _daemonName; 99 | 100 | /// 101 | /// Number of queued processes on the controller. 102 | /// 103 | private readonly int _queuedProcesses; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Controller/EventArgs/ServiceCalledEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for ServiceCalled event. 27 | /// 28 | public class ServiceCalledEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the ServiceCalledEventArgs class. 32 | /// 33 | /// The name of the daemon which is calling the service. 34 | /// Message returned form the service. 35 | /// Event identifier. 36 | /// daemonName is null. 37 | /// id is Guid.Empty. 38 | public ServiceCalledEventArgs(string daemonName, 39 | string message, 40 | Guid id) 41 | { 42 | if (daemonName == null) 43 | { 44 | throw new ArgumentNullException("daemonName", 45 | Resources.ArgumentNullException); 46 | } 47 | _daemonName = daemonName; 48 | 49 | if (message != null) 50 | { 51 | _message = message; 52 | } 53 | if (id == Guid.Empty) 54 | { 55 | throw new ArgumentException(Resources.ArgumentExceptionIdIsEmpty, 56 | "id"); 57 | } 58 | _guid = id; 59 | } 60 | 61 | /// 62 | /// Gets the name of the daemon which is calling the service. 63 | /// 64 | public string DaemonName 65 | { 66 | get 67 | { 68 | return _daemonName; 69 | } 70 | } 71 | 72 | /// 73 | /// Gets the message returned from the service. Default is empty string. 74 | /// 75 | public string Message 76 | { 77 | get 78 | { 79 | return _message; 80 | } 81 | } 82 | 83 | /// 84 | /// Identifies event. 85 | /// 86 | public Guid Id 87 | { 88 | get 89 | { 90 | return _guid; 91 | } 92 | } 93 | 94 | /// 95 | /// Identifies event. 96 | /// 97 | private readonly Guid _guid; 98 | 99 | /// 100 | /// Contains the name of the daemon which is calling the service. 101 | /// 102 | private readonly string _daemonName; 103 | 104 | /// 105 | /// Contains the message returned from the service. 106 | /// 107 | private readonly string _message = String.Empty; 108 | } 109 | } -------------------------------------------------------------------------------- /Controller/EventArgs/ServiceProxyCreationErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Controller 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Controller.Properties; 22 | 23 | namespace FileWatcherUtilities.Controller 24 | { 25 | /// 26 | /// Provides data for ServiceProxyCreationError event. 27 | /// 28 | public class ServiceProxyCreationErrorEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the ServiceProxyCreationErrorEventArgs class. 32 | /// 33 | /// The name of the daemon which is calling the service. 34 | /// Event identifier. 35 | /// Number of queued processes on the controller. 36 | /// daemonName is null. 37 | /// id is Guid.Empty. 38 | /// queued processes value cannot be less than zero. 39 | public ServiceProxyCreationErrorEventArgs(string daemonName, 40 | Guid id, 41 | int queuedProcesses) 42 | { 43 | if (daemonName == null) 44 | { 45 | throw new ArgumentNullException("daemonName", 46 | Resources.ArgumentNullException); 47 | } 48 | if (id == Guid.Empty) 49 | { 50 | throw new ArgumentException(Resources.ArgumentExceptionIdIsEmpty, 51 | "id"); 52 | } 53 | if (queuedProcesses < 0) 54 | { 55 | throw new ArgumentException(Resources.ArgumentExceptionValueCannotBeLessThanZero, 56 | "queuedProcesses"); 57 | } 58 | _daemonName = daemonName; 59 | _guid = id; 60 | _queuedProcesses = queuedProcesses; 61 | } 62 | 63 | /// 64 | /// Gets the name of the daemon which is calling the service. 65 | /// 66 | public string DaemonName 67 | { 68 | get 69 | { 70 | return _daemonName; 71 | } 72 | } 73 | 74 | /// 75 | /// Identifies event. 76 | /// 77 | public Guid Id 78 | { 79 | get 80 | { 81 | return _guid; 82 | } 83 | } 84 | 85 | /// 86 | /// Gets the number of queued processes on the controller. 87 | /// 88 | public int QueuedProcesses 89 | { 90 | get 91 | { 92 | return _queuedProcesses; 93 | } 94 | } 95 | 96 | /// 97 | /// Identifies event. 98 | /// 99 | private readonly Guid _guid; 100 | 101 | /// 102 | /// Contains the name of the daemon which is calling the service. 103 | /// 104 | private readonly string _daemonName; 105 | 106 | /// 107 | /// Number of queued processes on the controller. 108 | /// 109 | private readonly int _queuedProcesses; 110 | } 111 | } -------------------------------------------------------------------------------- /Controller/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Utilities Controller")] 8 | [assembly: AssemblyDescription("File Watcher Utilities Controller")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Utilities Controller")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("0e839d67-282f-42d7-a5ac-513e2f246389")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] 32 | -------------------------------------------------------------------------------- /FileWatcherConsole/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /FileWatcherConsole/Help/FileWatcherConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itechnology/fwutilities/d5455a56a1e0f9144dd6993fa8ea757eedd834fc/FileWatcherConsole/Help/FileWatcherConsole.png -------------------------------------------------------------------------------- /FileWatcherConsole/Help/FileWatcherSimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itechnology/fwutilities/d5455a56a1e0f9144dd6993fa8ea757eedd834fc/FileWatcherConsole/Help/FileWatcherSimple.png -------------------------------------------------------------------------------- /FileWatcherConsole/Help/FileWatcherUtilities.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | File Watcher Utilities 5 | 6 | 7 | 8 |

9 | File Watcher Utilities 10 |

11 |

12 | File Watcher Utilities project provides file system/directory monitoring utilities 13 | with loggin and task processing support. The applications have multiple configuration 14 | options. Source code libraries or binaries can be used to create a custom file system 15 | monitor. 16 |

17 |

18 | Applications 19 |

20 |

21 | File Watcher Utilities currently contains multiple applications with different type 22 | of user interface. The applications can be used together or seperately. 23 | File Watcher Simple 24 | can be used to create 25 | XML configuration files 26 | for other applications. It is also the recomended 27 | option for editing and testing any configurations. Other applications support only 28 | manual editing of the XML configuration files. 29 |

30 | 43 |

44 | Extensibility 45 |

46 |

47 | File Watcher Utilities applications doesn't support plugins because the variety 48 | of applications and threading issues. Instead the File Watcher Utilities applications 49 | support out of process type of extensibility. The File Watcher Utilities applications 50 | can consume Windows Communication Foundation services (typically web services) that 51 | use the File Watcher Utilities specific service contracts. 52 | The service contracts allow developers to create 53 | file streaming and file change information storing type of services. 54 |

55 |

56 | System requirements 57 |

58 | 71 |

72 | 1Applications compiled with Microsoft .NET Framework 2.0 cannot call Windows Communication Foundation services. 73 |

74 |

75 | Licensing 76 |

77 |

78 | The File Watcher Utilities is licensed under GNU GENERAL PUBLIC LICENSE Version 79 | 2, June 1991. This license 80 | doesn't include 81 | the File Watcher Utilities 82 | service contracts 83 | . The File Watcher Utilities 84 | service 85 | contracts 86 | are licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 87 | 2.1, February 1999 to allow extensibility of the File Watcher Utilities applications. 88 |

89 |
90 |

91 | Copyright © 2006-2013 Jussi Hiltunen 92 |

93 | 94 | 95 | -------------------------------------------------------------------------------- /FileWatcherConsole/Help/Help.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | margin: 0px 0px 0px 0px; 4 | padding: 0px 0px 0px 0px; 5 | font-family: Verdana, Arial, Helvetica, sans-serif; 6 | } 7 | 8 | table 9 | { 10 | font-size: 70%; 11 | vertical-align: top; 12 | width: 100%; 13 | border-width: 0px 0px 0px 0px; 14 | border-color: rgb(0, 0, 0); 15 | border-style: solid; 16 | } 17 | 18 | td 19 | { 20 | width: 50%; 21 | border-width: 1px 1px 1px 1px; 22 | border-color: rgb(200, 200, 200); 23 | border-style: solid; 24 | padding: 4px, 4px, 4px, 4px; 25 | } 26 | 27 | h1 28 | { 29 | font-size: 95%; 30 | background-color: #99ccff; 31 | vertical-align: text-top; 32 | color: rgb(0, 0, 0); 33 | font-size: larger; 34 | border-width: 1px 1px 1px 1px; 35 | border-color: rgb(0, 0, 0); 36 | border-style: solid; 37 | padding-bottom: 10px; 38 | padding-top: 10px; 39 | } 40 | 41 | h2 42 | { 43 | font-size: 85%; 44 | width: 100%; 45 | font-weight: bold; 46 | background-color: rgb(200, 200, 200); 47 | border-width: 1px 1px 1px 1px; 48 | border-color: rgb(0, 0, 0); 49 | border-style: solid; 50 | } 51 | 52 | h3 53 | { 54 | font-size: 75%; 55 | width: 100%; 56 | font-weight: bold; 57 | background-color: rgb(200, 200, 200); 58 | border-width: 1px 1px 1px 1px; 59 | border-color: rgb(0, 0, 0); 60 | border-style: solid; 61 | } 62 | 63 | h4 64 | { 65 | font-size: 75%; 66 | width: 100%; 67 | font-weight: bold; 68 | background-color: rgb(200, 200, 200); 69 | border-width: 1px 1px 1px 1px; 70 | border-color: rgb(0, 0, 0); 71 | border-style: solid; 72 | } 73 | 74 | a:hover 75 | { 76 | color: #99ccff; 77 | background-color: rgb(255, 255, 255); 78 | text-decoration: none; 79 | } 80 | 81 | p 82 | { 83 | font-size: 70%; 84 | } 85 | 86 | ul 87 | { 88 | font-size: 70%; 89 | padding: 0px; 90 | margin-bottom: 0px; 91 | margin-left: 20px; 92 | margin-right: 0px; 93 | margin-top: 0px; 94 | } 95 | 96 | ol 97 | { 98 | font-size: 70%; 99 | padding: 0px; 100 | margin-bottom: 0px; 101 | margin-left: 20px; 102 | margin-right: 0px; 103 | margin-top: 0px; 104 | } -------------------------------------------------------------------------------- /FileWatcherConsole/Help/Index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | File Watcher Utilities - Help index 5 | 6 | 7 | 8 |

9 | Help index 10 |

11 |

12 | How to get help? 13 |

14 |

15 | Visit the File Watcher Utilities wiki. 16 |

17 |

18 | Visit the File Watcher Utilities project. 19 |

20 |

21 | Visit the File Watcher Utilities forums. 22 |

23 |

24 | Read local help. 25 |

26 |
27 |

28 | Copyright © 2006-2013 Jussi Hiltunen 29 |

30 | 31 | 32 | -------------------------------------------------------------------------------- /FileWatcherConsole/Program/ConsoleView.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Console 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Presenter; 22 | 23 | namespace FileWatcherUtilities.FileWatcherConsole 24 | { 25 | /// 26 | /// Provides console view. 27 | /// 28 | public class ConsoleView : IConsoleView 29 | { 30 | #region IConsoleView Members 31 | 32 | /// 33 | /// Occures when console view is started. 34 | /// 35 | public event EventHandler ConsoleStarted; 36 | 37 | /// 38 | /// Writes message. 39 | /// 40 | /// Message to write. 41 | public void Echo(string message) 42 | { 43 | Console.Write(message); 44 | } 45 | 46 | /// 47 | /// Writes line. 48 | /// 49 | /// Message to write. 50 | public void EchoLine(string message) 51 | { 52 | Console.WriteLine(message); 53 | } 54 | 55 | /// 56 | /// Reads key. 57 | /// 58 | /// Key. 59 | public string ReadKey() 60 | { 61 | return Console.ReadKey().ToString(); 62 | } 63 | 64 | /// 65 | /// Writes line and then reads key. 66 | /// 67 | /// Message to write. 68 | /// Key. 69 | public string EchoReadKey(string message) 70 | { 71 | Console.WriteLine(message); 72 | return Console.ReadKey().ToString(); 73 | } 74 | 75 | /// 76 | /// Reads line. 77 | /// 78 | /// Line. 79 | public string ReadLine() 80 | { 81 | return Console.ReadLine(); 82 | } 83 | 84 | /// 85 | /// Writes line an then reads line. 86 | /// 87 | /// Message to write. 88 | /// Line. 89 | public string EchoReadLine(string message) 90 | { 91 | Console.WriteLine(message); 92 | return Console.ReadLine(); 93 | } 94 | 95 | #endregion 96 | 97 | /// 98 | /// Start console view. 99 | /// 100 | /// Console view argumets. 101 | public void Start(string[] args) 102 | { 103 | if (ConsoleStarted != null) 104 | { 105 | ConsoleStarted(this, 106 | new ConsoleStartedEventArgs(args)); 107 | } 108 | } 109 | } 110 | } -------------------------------------------------------------------------------- /FileWatcherConsole/Program/Program.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Console 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Xml; 23 | using System.Windows.Forms; 24 | using System.Security.Permissions; 25 | using FileWatcherUtilities.Presenter; 26 | using FileWatcherUtilities.FileWatcherConsole.Properties; 27 | 28 | [assembly: CLSCompliant(true)] 29 | 30 | namespace FileWatcherUtilities.FileWatcherConsole 31 | { 32 | /// 33 | /// Main class of the application. 34 | /// 35 | public static class Program 36 | { 37 | /// 38 | /// Application entry point. 39 | /// 40 | /// Command line arguments. 41 | [STAThread] 42 | public static void Main(string[] args) 43 | { 44 | try 45 | { 46 | ConsoleView consoleView = new ConsoleView(); 47 | _presenterBuilder = new PresenterBuilder(consoleView); 48 | _presenterBuilder.Build(); 49 | // Start application. 50 | consoleView.Start(args); 51 | } 52 | catch (InvalidDataException ex) 53 | { 54 | Console.Clear(); 55 | Console.WriteLine(Application.ProductName + Resources.Space + Application.ProductVersion); 56 | Console.WriteLine(String.Empty); 57 | Console.WriteLine(@ex.Message); 58 | Console.WriteLine(String.Empty); 59 | Console.WriteLine(Resources.MessagePressAnyKeyToContinue); 60 | Console.ReadKey(); 61 | Environment.Exit(255); 62 | } 63 | catch (XmlException ex) 64 | { 65 | Console.Clear(); 66 | Console.WriteLine(Application.ProductName + Resources.Space + Application.ProductVersion); 67 | Console.WriteLine(String.Empty); 68 | Console.WriteLine(@ex.Message); 69 | Console.WriteLine(String.Empty); 70 | Console.WriteLine(Resources.MessagePressAnyKeyToContinue); 71 | Console.ReadKey(); 72 | Environment.Exit(255); 73 | } 74 | catch (Exception ex) 75 | { 76 | Console.Clear(); 77 | Console.WriteLine(Application.ProductName + Resources.Space + Application.ProductVersion); 78 | Console.WriteLine(String.Empty); 79 | Console.WriteLine(@Resources.MessageUnexpectedError, 80 | @ex.Message); 81 | Console.WriteLine(String.Empty); 82 | Console.WriteLine(Resources.MessagePressAnyKeyToContinue); 83 | Console.ReadKey(); 84 | Environment.Exit(255); 85 | } 86 | finally 87 | { 88 | if (_presenterBuilder != null) 89 | { 90 | _presenterBuilder.Dispose(); 91 | } 92 | } 93 | } 94 | 95 | /// 96 | /// Presenter builder. 97 | /// 98 | private static PresenterBuilder _presenterBuilder; 99 | } 100 | } -------------------------------------------------------------------------------- /FileWatcherConsole/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Console")] 8 | [assembly: AssemblyDescription("File Watcher Console")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Console")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("8ac56727-2d88-4ea5-98a2-6e6b3e39f202")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] -------------------------------------------------------------------------------- /FileWatcherConsole/Properties/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /FileWatcherServiceContract/DefaultFault.cs: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * File Watcher Utilities / File Watcher Service Contract 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | **********************************************************************************/ 19 | 20 | using System; 21 | using System.Runtime.Serialization; 22 | using FileWatcherUtilities.FileWatcherServiceContract.Properties; 23 | 24 | namespace FileWatcherUtilities.FileWatcherServiceContract 25 | { 26 | /// 27 | /// Default fault datacontract. 28 | /// 29 | [DataContract] 30 | public class DefaultFault : IExtensibleDataObject 31 | { 32 | /// 33 | /// Gets or sets message. 34 | /// 35 | [DataMember] 36 | public string Message 37 | { 38 | get 39 | { 40 | return _message; 41 | } 42 | set 43 | { 44 | _message = value; 45 | } 46 | } 47 | 48 | /// 49 | /// Gets or sets error code. 50 | /// 51 | [DataMember] 52 | public string ErrorCode 53 | { 54 | get 55 | { 56 | return _errorCode; 57 | } 58 | set 59 | { 60 | _errorCode = value; 61 | } 62 | } 63 | 64 | /// 65 | /// Gets or sets severity. 66 | /// 67 | [DataMember] 68 | public string Severity 69 | { 70 | get 71 | { 72 | return _severity; 73 | } 74 | set 75 | { 76 | _severity = value; 77 | } 78 | } 79 | 80 | /// 81 | /// Gets or sets fault identifier. 82 | /// 83 | [DataMember] 84 | public Guid Id 85 | { 86 | get 87 | { 88 | return _guid; 89 | } 90 | set 91 | { 92 | _guid = value; 93 | } 94 | } 95 | 96 | 97 | #region IExtensibleDataObject Members 98 | 99 | /// 100 | /// Gets or sets extension data. 101 | /// 102 | public ExtensionDataObject ExtensionData 103 | { 104 | get 105 | { 106 | return _extensionDataObject; 107 | } 108 | set 109 | { 110 | _extensionDataObject = value; 111 | } 112 | } 113 | 114 | #endregion 115 | 116 | /// 117 | /// Contains extension data. 118 | /// 119 | private ExtensionDataObject _extensionDataObject; 120 | 121 | /// 122 | /// Identifies fault. 123 | /// 124 | private Guid _guid; 125 | 126 | /// 127 | /// Message. 128 | /// 129 | private string _message = String.Empty; 130 | 131 | /// 132 | /// Severity. 133 | /// 134 | private string _severity = Resources.SeverityError; 135 | 136 | /// 137 | /// Error code. 138 | /// 139 | private string _errorCode = String.Empty; 140 | } 141 | } -------------------------------------------------------------------------------- /FileWatcherServiceContract/IFileWatcherService.cs: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * File Watcher Utilities / File Watcher Service Contract 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | **********************************************************************************/ 19 | 20 | using System; 21 | using System.ServiceModel; 22 | using System.Security.Permissions; 23 | 24 | [assembly: CLSCompliant(true)] 25 | 26 | namespace FileWatcherUtilities.FileWatcherServiceContract 27 | { 28 | /// 29 | /// Defines the file watcher service contract to be used in communication. 30 | /// 31 | [ServiceContract] 32 | public interface IFileWatcherService 33 | { 34 | /// 35 | /// Called when system is changed. 36 | /// 37 | /// Infomation about the system change. 38 | /// Information about the handling of the system change. 39 | /// This method can fail fail by throwing an DefaultFault exception. 40 | [OperationContract] 41 | [FaultContract(typeof(DefaultFault))] 42 | SystemChangedRespDC SystemChanged(SystemChangedReqDC request); 43 | } 44 | } -------------------------------------------------------------------------------- /FileWatcherServiceContract/IFileWatcherStreamingService.cs: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * File Watcher Utilities / File Watcher Service Contract 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | **********************************************************************************/ 19 | 20 | using System.ServiceModel; 21 | 22 | namespace FileWatcherUtilities.FileWatcherServiceContract 23 | { 24 | /// 25 | /// Defines the file watcher service contract to be used in communication. 26 | /// 27 | [ServiceContract] 28 | public interface IFileWatcherStreamingService 29 | { 30 | /// 31 | /// Called when system is changed. 32 | /// 33 | /// Infomation about the system change. 34 | /// Information about the handling of the system change. 35 | /// This method can fail by throwing an DefaultFault exception. 36 | [OperationContract] 37 | [FaultContract(typeof(DefaultFault))] 38 | SystemChangedRespMC SystemChangedStreaming(SystemChangedReqMC request); 39 | } 40 | } -------------------------------------------------------------------------------- /FileWatcherServiceContract/IResponse.cs: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * File Watcher Utilities / File Watcher Service Contract 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | **********************************************************************************/ 19 | 20 | namespace FileWatcherUtilities.FileWatcherServiceContract 21 | { 22 | /// 23 | /// SystemChanged response message interface. 24 | /// 25 | public interface IResponse 26 | { 27 | /// 28 | /// Gets or sets message. 29 | /// 30 | string Message { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /FileWatcherServiceContract/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Service Contract")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Service Contract")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("dd8bc4b6-f957-4be4-a4be-b228a360ddc9")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] 32 | -------------------------------------------------------------------------------- /FileWatcherServiceContract/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18033 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FileWatcherUtilities.FileWatcherServiceContract.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | public static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileWatcherUtilities.FileWatcherServiceContract.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | public static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Error. 65 | /// 66 | public static string SeverityError { 67 | get { 68 | return ResourceManager.GetString("SeverityError", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to Info. 74 | /// 75 | public static string SeverityInfo { 76 | get { 77 | return ResourceManager.GetString("SeverityInfo", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to Warning. 83 | /// 84 | public static string SeverityWarning { 85 | get { 86 | return ResourceManager.GetString("SeverityWarning", resourceCulture); 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /FileWatcherServiceContract/SystemChangedRespDC.cs: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * File Watcher Utilities / File Watcher Service Contract 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | **********************************************************************************/ 19 | 20 | using System.Runtime.Serialization; 21 | 22 | namespace FileWatcherUtilities.FileWatcherServiceContract 23 | { 24 | /// 25 | /// SystemChanged response data contract. 26 | /// 27 | [DataContract] 28 | public class SystemChangedRespDC : IExtensibleDataObject, IResponse 29 | { 30 | /// 31 | /// Gets or sets message. 32 | /// 33 | [DataMember] 34 | public string Message 35 | { 36 | get 37 | { 38 | return _message; 39 | } 40 | set 41 | { 42 | _message = value; 43 | } 44 | } 45 | 46 | #region IExtensibleDataObject Members 47 | 48 | /// 49 | /// Gets or sets extension data. 50 | /// 51 | public ExtensionDataObject ExtensionData 52 | { 53 | get 54 | { 55 | return _extensionDataObject; 56 | } 57 | set 58 | { 59 | _extensionDataObject = value; 60 | } 61 | } 62 | 63 | #endregion 64 | 65 | /// 66 | /// Contains extension data. 67 | /// 68 | private ExtensionDataObject _extensionDataObject; 69 | 70 | /// 71 | /// Message. 72 | /// 73 | private string _message; 74 | } 75 | } -------------------------------------------------------------------------------- /FileWatcherServiceContract/SystemChangedRespMC.cs: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * File Watcher Utilities / File Watcher Service Contract 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | **********************************************************************************/ 19 | 20 | using System.ServiceModel; 21 | 22 | namespace FileWatcherUtilities.FileWatcherServiceContract 23 | { 24 | /// 25 | /// SystemChanged response message contract. 26 | /// 27 | [MessageContract] 28 | public class SystemChangedRespMC : IResponse 29 | { 30 | /// 31 | /// Gets or sets message. 32 | /// 33 | [MessageHeader(MustUnderstand=true)] 34 | public string Message 35 | { 36 | get 37 | { 38 | return _message; 39 | } 40 | set 41 | { 42 | _message = value; 43 | } 44 | } 45 | 46 | /// 47 | /// Message. 48 | /// 49 | private string _message; 50 | } 51 | } -------------------------------------------------------------------------------- /FileWatcherSimple/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /FileWatcherSimple/Help/FileWatcherConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itechnology/fwutilities/d5455a56a1e0f9144dd6993fa8ea757eedd834fc/FileWatcherSimple/Help/FileWatcherConsole.png -------------------------------------------------------------------------------- /FileWatcherSimple/Help/FileWatcherSimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itechnology/fwutilities/d5455a56a1e0f9144dd6993fa8ea757eedd834fc/FileWatcherSimple/Help/FileWatcherSimple.png -------------------------------------------------------------------------------- /FileWatcherSimple/Help/FileWatcherUtilities.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | File Watcher Utilities 5 | 6 | 7 | 8 |

9 | File Watcher Utilities 10 |

11 |

12 | File Watcher Utilities project provides file system/directory monitoring utilities 13 | with loggin and task processing support. The applications have multiple configuration 14 | options. Source code libraries or binaries can be used to create a custom file system 15 | monitor. 16 |

17 |

18 | Applications 19 |

20 |

21 | File Watcher Utilities currently contains multiple applications with different type 22 | of user interface. The applications can be used together or seperately. 23 | File Watcher Simple 24 | can be used to create 25 | XML configuration files 26 | for other applications. It is also the recomended 27 | option for editing and testing any configurations. Other applications support only 28 | manual editing of the XML configuration files. 29 |

30 | 43 |

44 | Extensibility 45 |

46 |

47 | File Watcher Utilities applications doesn't support plugins because the variety 48 | of applications and threading issues. Instead the File Watcher Utilities applications 49 | support out of process type of extensibility. The File Watcher Utilities applications 50 | can consume Windows Communication Foundation services (typically web services) that 51 | use the File Watcher Utilities specific service contracts. 52 | The service contracts allow developers to create 53 | file streaming and file change information storing type of services. 54 |

55 |

56 | System requirements 57 |

58 |
    59 |
  • 60 | Microsoft Windows 2000, Windows 2003 or Windows XP Professional or Home Edition, 61 | Windows Vista, Windows 2008, Windows 7 or later. 62 |
  • 63 |
  • 64 | Microsoft .NET Framework 4.0 or later or Microsoft .NET Framework 3.0 (Service Pack 2) or Microsoft .NET Framework 2.0 (Service Pack 2)1 65 |
  • 66 |
  • 67 | Applications can be compiled and run with Mono on other operating systems. 68 | For more details see Supported Platforms - Mono. 69 |
  • 70 |
71 |

72 | 1Applications compiled with Microsoft .NET Framework 2.0 cannot call Windows Communication Foundation services. 73 |

74 |

75 | Licensing 76 |

77 |

78 | The File Watcher Utilities is licensed under GNU GENERAL PUBLIC LICENSE Version 79 | 2, June 1991. This license 80 | doesn't include 81 | the File Watcher Utilities 82 | service contracts 83 | . The File Watcher Utilities 84 | service 85 | contracts 86 | are licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 87 | 2.1, February 1999 to allow extensibility of the File Watcher Utilities applications. 88 |

89 |
90 |

91 | Copyright © 2006-2013 Jussi Hiltunen 92 |

93 | 94 | 95 | -------------------------------------------------------------------------------- /FileWatcherSimple/Help/Help.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | margin: 0px 0px 0px 0px; 4 | padding: 0px 0px 0px 0px; 5 | font-family: Verdana, Arial, Helvetica, sans-serif; 6 | } 7 | 8 | table 9 | { 10 | font-size: 70%; 11 | vertical-align: top; 12 | width: 100%; 13 | border-width: 0px 0px 0px 0px; 14 | border-color: rgb(0, 0, 0); 15 | border-style: solid; 16 | } 17 | 18 | td 19 | { 20 | width: 50%; 21 | border-width: 1px 1px 1px 1px; 22 | border-color: rgb(200, 200, 200); 23 | border-style: solid; 24 | padding: 4px, 4px, 4px, 4px; 25 | } 26 | 27 | h1 28 | { 29 | font-size: 95%; 30 | background-color: #99ccff; 31 | vertical-align: text-top; 32 | color: rgb(0, 0, 0); 33 | font-size: larger; 34 | border-width: 1px 1px 1px 1px; 35 | border-color: rgb(0, 0, 0); 36 | border-style: solid; 37 | padding-bottom: 10px; 38 | padding-top: 10px; 39 | } 40 | 41 | h2 42 | { 43 | font-size: 85%; 44 | width: 100%; 45 | font-weight: bold; 46 | background-color: rgb(200, 200, 200); 47 | border-width: 1px 1px 1px 1px; 48 | border-color: rgb(0, 0, 0); 49 | border-style: solid; 50 | } 51 | 52 | h3 53 | { 54 | font-size: 75%; 55 | width: 100%; 56 | font-weight: bold; 57 | background-color: rgb(200, 200, 200); 58 | border-width: 1px 1px 1px 1px; 59 | border-color: rgb(0, 0, 0); 60 | border-style: solid; 61 | } 62 | 63 | h4 64 | { 65 | font-size: 75%; 66 | width: 100%; 67 | font-weight: bold; 68 | background-color: rgb(200, 200, 200); 69 | border-width: 1px 1px 1px 1px; 70 | border-color: rgb(0, 0, 0); 71 | border-style: solid; 72 | } 73 | 74 | a:hover 75 | { 76 | color: #99ccff; 77 | background-color: rgb(255, 255, 255); 78 | text-decoration: none; 79 | } 80 | 81 | p 82 | { 83 | font-size: 70%; 84 | } 85 | 86 | ul 87 | { 88 | font-size: 70%; 89 | padding: 0px; 90 | margin-bottom: 0px; 91 | margin-left: 20px; 92 | margin-right: 0px; 93 | margin-top: 0px; 94 | } 95 | 96 | ol 97 | { 98 | font-size: 70%; 99 | padding: 0px; 100 | margin-bottom: 0px; 101 | margin-left: 20px; 102 | margin-right: 0px; 103 | margin-top: 0px; 104 | } -------------------------------------------------------------------------------- /FileWatcherSimple/Help/Index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | File Watcher Utilities - Help index 5 | 6 | 7 | 8 |

9 | Help index 10 |

11 |

12 | How to get help? 13 |

14 |

15 | Visit the File Watcher Utilities wiki. 16 |

17 |

18 | Visit the File Watcher Utilities project. 19 |

20 |

21 | Visit the File Watcher Utilities forums. 22 |

23 |

24 | Read local help. 25 |

26 |
27 |

28 | Copyright © 2006-2013 Jussi Hiltunen 29 |

30 | 31 | 32 | -------------------------------------------------------------------------------- /FileWatcherSimple/Program/FormAbout.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Simple 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.Windows.Forms; 22 | using FileWatcherUtilities.FileWatcherSimple.Properties; 23 | 24 | namespace FileWatcherUtilities.FileWatcherSimple 25 | { 26 | /// 27 | /// Provides application options dialog. 28 | /// 29 | public partial class FormAbout : Form 30 | { 31 | /// 32 | /// Initializes a new instance of the FormAbout class. 33 | /// 34 | public FormAbout() 35 | { 36 | InitializeComponent(); 37 | 38 | // Set information to labels. 39 | labelVersion.Text = Resources.AboutLabelVersion; 40 | labelCopyright.Text = Resources.CopyrightText; 41 | labelApplicationName.Text = Application.ProductName; 42 | labelVersionNumber.Text = Application.ProductVersion; 43 | } 44 | 45 | /// 46 | /// Handles OK button click. 47 | /// 48 | /// Sender of the event. 49 | /// Event data. 50 | private void ButtonOKClick(object sender, 51 | EventArgs e) 52 | { 53 | Close(); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /FileWatcherSimple/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Simple")] 8 | [assembly: AssemblyDescription("File Watcher Simple")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Simple")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("0e5d3a71-bbf3-445c-b9cd-0fa4ec92a9cc")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] 32 | -------------------------------------------------------------------------------- /FileWatcherWindowsService/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /FileWatcherWindowsService/Help/FileWatcherConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itechnology/fwutilities/d5455a56a1e0f9144dd6993fa8ea757eedd834fc/FileWatcherWindowsService/Help/FileWatcherConsole.png -------------------------------------------------------------------------------- /FileWatcherWindowsService/Help/FileWatcherSimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itechnology/fwutilities/d5455a56a1e0f9144dd6993fa8ea757eedd834fc/FileWatcherWindowsService/Help/FileWatcherSimple.png -------------------------------------------------------------------------------- /FileWatcherWindowsService/Help/FileWatcherUtilities.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | File Watcher Utilities 5 | 6 | 7 | 8 |

9 | File Watcher Utilities 10 |

11 |

12 | File Watcher Utilities project provides file system/directory monitoring utilities 13 | with loggin and task processing support. The applications have multiple configuration 14 | options. Source code libraries or binaries can be used to create a custom file system 15 | monitor. 16 |

17 |

18 | Applications 19 |

20 |

21 | File Watcher Utilities currently contains multiple applications with different type 22 | of user interface. The applications can be used together or seperately. 23 | File Watcher Simple 24 | can be used to create 25 | XML configuration files 26 | for other applications. It is also the recomended 27 | option for editing and testing any configurations. Other applications support only 28 | manual editing of the XML configuration files. 29 |

30 | 43 |

44 | Extensibility 45 |

46 |

47 | File Watcher Utilities applications doesn't support plugins because the variety 48 | of applications and threading issues. Instead the File Watcher Utilities applications 49 | support out of process type of extensibility. The File Watcher Utilities applications 50 | can consume Windows Communication Foundation services (typically web services) that 51 | use the File Watcher Utilities specific service contracts. 52 | The service contracts allow developers to create 53 | file streaming and file change information storing type of services. 54 |

55 |

56 | System requirements 57 |

58 |
    59 |
  • 60 | Microsoft Windows 2000, Windows 2003 or Windows XP Professional or Home Edition, 61 | Windows Vista, Windows 2008, Windows 7 or later. 62 |
  • 63 |
  • 64 | Microsoft .NET Framework 4.0 or later or Microsoft .NET Framework 3.0 (Service Pack 2) or Microsoft .NET Framework 2.0 (Service Pack 2)1 65 |
  • 66 |
  • 67 | Applications can be compiled and run with Mono on other operating systems. 68 | For more details see Supported Platforms - Mono. 69 |
  • 70 |
71 |

72 | 1Applications compiled with Microsoft .NET Framework 2.0 cannot call Windows Communication Foundation services. 73 |

74 |

75 | Licensing 76 |

77 |

78 | The File Watcher Utilities is licensed under GNU GENERAL PUBLIC LICENSE Version 79 | 2, June 1991. This license 80 | doesn't include 81 | the File Watcher Utilities 82 | service contracts 83 | . The File Watcher Utilities 84 | service 85 | contracts 86 | are licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 87 | 2.1, February 1999 to allow extensibility of the File Watcher Utilities applications. 88 |

89 |
90 |

91 | Copyright © 2006-2013 Jussi Hiltunen 92 |

93 | 94 | 95 | -------------------------------------------------------------------------------- /FileWatcherWindowsService/Help/Help.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | margin: 0px 0px 0px 0px; 4 | padding: 0px 0px 0px 0px; 5 | font-family: Verdana, Arial, Helvetica, sans-serif; 6 | } 7 | 8 | table 9 | { 10 | font-size: 70%; 11 | vertical-align: top; 12 | width: 100%; 13 | border-width: 0px 0px 0px 0px; 14 | border-color: rgb(0, 0, 0); 15 | border-style: solid; 16 | } 17 | 18 | td 19 | { 20 | width: 50%; 21 | border-width: 1px 1px 1px 1px; 22 | border-color: rgb(200, 200, 200); 23 | border-style: solid; 24 | padding: 4px, 4px, 4px, 4px; 25 | } 26 | 27 | h1 28 | { 29 | font-size: 95%; 30 | background-color: #99ccff; 31 | vertical-align: text-top; 32 | color: rgb(0, 0, 0); 33 | font-size: larger; 34 | border-width: 1px 1px 1px 1px; 35 | border-color: rgb(0, 0, 0); 36 | border-style: solid; 37 | padding-bottom: 10px; 38 | padding-top: 10px; 39 | } 40 | 41 | h2 42 | { 43 | font-size: 85%; 44 | width: 100%; 45 | font-weight: bold; 46 | background-color: rgb(200, 200, 200); 47 | border-width: 1px 1px 1px 1px; 48 | border-color: rgb(0, 0, 0); 49 | border-style: solid; 50 | } 51 | 52 | h3 53 | { 54 | font-size: 75%; 55 | width: 100%; 56 | font-weight: bold; 57 | background-color: rgb(200, 200, 200); 58 | border-width: 1px 1px 1px 1px; 59 | border-color: rgb(0, 0, 0); 60 | border-style: solid; 61 | } 62 | 63 | h4 64 | { 65 | font-size: 75%; 66 | width: 100%; 67 | font-weight: bold; 68 | background-color: rgb(200, 200, 200); 69 | border-width: 1px 1px 1px 1px; 70 | border-color: rgb(0, 0, 0); 71 | border-style: solid; 72 | } 73 | 74 | a:hover 75 | { 76 | color: #99ccff; 77 | background-color: rgb(255, 255, 255); 78 | text-decoration: none; 79 | } 80 | 81 | p 82 | { 83 | font-size: 70%; 84 | } 85 | 86 | ul 87 | { 88 | font-size: 70%; 89 | padding: 0px; 90 | margin-bottom: 0px; 91 | margin-left: 20px; 92 | margin-right: 0px; 93 | margin-top: 0px; 94 | } 95 | 96 | ol 97 | { 98 | font-size: 70%; 99 | padding: 0px; 100 | margin-bottom: 0px; 101 | margin-left: 20px; 102 | margin-right: 0px; 103 | margin-top: 0px; 104 | } -------------------------------------------------------------------------------- /FileWatcherWindowsService/Help/Index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | File Watcher Utilities - Help index 5 | 6 | 7 | 8 |

9 | Help index 10 |

11 |

12 | How to get help? 13 |

14 |

15 | Visit the File Watcher Utilities wiki. 16 |

17 |

18 | Visit the File Watcher Utilities project. 19 |

20 |

21 | Visit the File Watcher Utilities forums. 22 |

23 |

24 | Read local help. 25 |

26 |
27 |

28 | Copyright © 2006-2013 Jussi Hiltunen 29 |

30 | 31 | 32 | -------------------------------------------------------------------------------- /FileWatcherWindowsService/InstallFileWatcherWindowsService.bat: -------------------------------------------------------------------------------- 1 | sc delete "File Watcher Windows Service" 2 | sc create "File Watcher Windows Service" binPath= C:\FileWatcherWindowsService\FileWatcherWindowsService.exe 3 | sc description "File Watcher Windows Service" "Watches for file system changes in the system." -------------------------------------------------------------------------------- /FileWatcherWindowsService/Program/FileWatcherUtilitiesWindowsService.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Windows Service 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System.ServiceProcess; 21 | using FileWatcherUtilities.Presenter; 22 | using FileWatcherUtilities.FileWatcherWindowsService.Properties; 23 | 24 | namespace FileWatcherUtilities.FileWatcherWindowsService 25 | { 26 | /// 27 | /// File watcher utilities windows service. 28 | /// 29 | public class FileWatcherUtilitiesWindowsService : ServiceBase 30 | { 31 | /// 32 | /// Creates new FileWatcherUtilitiesWindowsService. 33 | /// 34 | public FileWatcherUtilitiesWindowsService() 35 | { 36 | CanShutdown = true; 37 | ServiceName = Resources.ServiceName; 38 | } 39 | 40 | /// 41 | /// Handles OnStart event. 42 | /// 43 | /// Windows service arguments. 44 | protected override void OnStart(string[] args) 45 | { 46 | _windowsServiceView = new WindowsServiceView(); 47 | _presenterBuilder = new PresenterBuilder(_windowsServiceView); 48 | _presenterBuilder.Build(); 49 | // Start application. 50 | _windowsServiceView.Start(args); 51 | // Set started to true; 52 | _isStarted = true; 53 | } 54 | 55 | /// 56 | /// Handles OnStop event. 57 | /// 58 | /// This method will blocks until all the processes have exited. 59 | protected override void OnStop() 60 | { 61 | if (_isStarted) 62 | { 63 | _windowsServiceView.Stop(); 64 | _isStarted = false; 65 | } 66 | if (_presenterBuilder != null) 67 | { 68 | _presenterBuilder.Dispose(); 69 | _presenterBuilder = null; 70 | } 71 | } 72 | 73 | /// 74 | /// Handles OnShutdown event. 75 | /// 76 | protected override void OnShutdown() 77 | { 78 | if (_isStarted) 79 | { 80 | OnStop(); 81 | } 82 | } 83 | 84 | /// 85 | /// Presenter builder. 86 | /// 87 | private PresenterBuilder _presenterBuilder; 88 | 89 | /// 90 | /// Windows service view. 91 | /// 92 | private WindowsServiceView _windowsServiceView; 93 | 94 | /// 95 | /// True if application was started. 96 | /// 97 | private bool _isStarted; 98 | } 99 | } -------------------------------------------------------------------------------- /FileWatcherWindowsService/Program/Program.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Windows Service 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.ServiceProcess; 22 | using System.Security.Permissions; 23 | 24 | [assembly: CLSCompliant(true)] 25 | 26 | namespace FileWatcherUtilities.FileWatcherWindowsService 27 | { 28 | /// 29 | /// Main class of the application. 30 | /// 31 | public static class Program 32 | { 33 | /// 34 | /// Application entry point. 35 | /// 36 | static void Main() 37 | { 38 | // Run service. 39 | ServiceBase.Run(new ServiceBase[] { new FileWatcherUtilitiesWindowsService() }); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /FileWatcherWindowsService/Program/ServiceInstaller.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Windows Service 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System.ServiceProcess; 21 | using System.ComponentModel; 22 | using System.Configuration.Install; 23 | using FileWatcherUtilities.FileWatcherWindowsService.Properties; 24 | 25 | namespace FileWatcherUtilities.FileWatcherWindowsService 26 | { 27 | /// 28 | /// Provides windows service installer. 29 | /// 30 | [RunInstaller(true)] 31 | public class WindowsServiceInstaller : Installer 32 | { 33 | /// 34 | /// Creates new windows service installer. 35 | /// 36 | /// Not used when using batch file to install the service. 37 | public WindowsServiceInstaller() 38 | { 39 | using (ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller()) 40 | { 41 | serviceProcessInstaller.Account = ServiceAccount.LocalSystem; 42 | serviceProcessInstaller.Username = null; 43 | serviceProcessInstaller.Password = null; 44 | 45 | using (ServiceInstaller serviceInstaller = new ServiceInstaller()) 46 | { 47 | serviceInstaller.DisplayName = Resources.ServiceName; 48 | serviceInstaller.StartType = ServiceStartMode.Automatic; 49 | serviceInstaller.ServiceName = Resources.ServiceName; 50 | serviceInstaller.Description = Resources.ServiceDescription; 51 | 52 | Installers.Add(serviceInstaller); 53 | Installers.Add(serviceProcessInstaller); 54 | } 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /FileWatcherWindowsService/Program/WindowsServiceView.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / File Watcher Windows Service 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Presenter; 22 | 23 | namespace FileWatcherUtilities.FileWatcherWindowsService 24 | { 25 | /// 26 | /// Provides console view. 27 | /// 28 | public class WindowsServiceView : IWindowsServiceView 29 | { 30 | #region IWindowsServiceView Members 31 | 32 | /// 33 | /// Occures when service is started. 34 | /// 35 | public event EventHandler ServiceStarted; 36 | 37 | /// 38 | /// Occures when service is stopped. 39 | /// 40 | public event EventHandler ServiceStopped; 41 | 42 | #endregion 43 | 44 | /// 45 | /// Start service. 46 | /// 47 | /// Service argumets. 48 | public void Start(string[] args) 49 | { 50 | if (ServiceStarted != null) 51 | { 52 | ServiceStarted(this, 53 | new ServiceStartedEventArgs(args)); 54 | } 55 | } 56 | 57 | /// 58 | /// Stop service. 59 | /// 60 | /// This method will blocks until all the processes have exited. 61 | public void Stop() 62 | { 63 | if (ServiceStopped != null) 64 | { 65 | ServiceStopped(this, 66 | new ServiceStoppedEventArgs()); 67 | } 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /FileWatcherWindowsService/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Utilities Windows Service")] 8 | [assembly: AssemblyDescription("File Watcher Utilities Windows Service")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Utilities Windows Service")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("205f2242-2cf4-473d-b903-933b9415d7c9")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("2.1.0.0")] 31 | [assembly: AssemblyFileVersion("2.1.0.0")] 32 | -------------------------------------------------------------------------------- /FileWatcherWindowsService/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18033 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FileWatcherUtilities.FileWatcherWindowsService.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileWatcherUtilities.FileWatcherWindowsService.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Watches for file system changes in the system.. 65 | /// 66 | internal static string ServiceDescription { 67 | get { 68 | return ResourceManager.GetString("ServiceDescription", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to File Watcher Utilities Windows Service. 74 | /// 75 | internal static string ServiceName { 76 | get { 77 | return ResourceManager.GetString("ServiceName", resourceCulture); 78 | } 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /FileWatcherWindowsServiceTestApplication/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /FileWatcherWindowsServiceTestApplication/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Windows Service Test Application")] 8 | [assembly: AssemblyDescription("File Watcher Utilities Windows Service Test Application")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Windows Service Test Application")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("5178fd84-0fba-4037-a991-f110085a3d1e")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] 32 | -------------------------------------------------------------------------------- /Logger/Data/MessageTypeEnum.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Logger 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | namespace FileWatcherUtilities.Logger 21 | { 22 | /// 23 | /// Log message types. 24 | /// 25 | public enum MessageType 26 | { 27 | /// 28 | /// Warn message. 29 | /// 30 | Warn, 31 | /// 32 | /// Error message. 33 | /// 34 | Error, 35 | /// 36 | /// Info message. 37 | /// 38 | Info 39 | } 40 | } -------------------------------------------------------------------------------- /Logger/Interfaces/ILogger.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Logger 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | 22 | namespace FileWatcherUtilities.Logger 23 | { 24 | /// 25 | /// Interface for logger. 26 | /// 27 | public interface ILogger : IDisposable 28 | { 29 | /// 30 | /// Writes message to log. 31 | /// 32 | /// Log message. 33 | void Log(string message); 34 | 35 | /// 36 | /// Opens log. 37 | /// 38 | void Open(bool append); 39 | 40 | /// 41 | /// Closes log. 42 | /// 43 | void Close(); 44 | } 45 | } -------------------------------------------------------------------------------- /Logger/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Utilities Logger")] 8 | [assembly: AssemblyDescription("File Watcher Utilities Logger")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Utilities Logger")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("1f98a50a-761e-49ce-aad5-720109dd73ec")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] -------------------------------------------------------------------------------- /Options/ApplicationOptions.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Options 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.Security.Permissions; 22 | using FileWatcherUtilities.Options.Properties; 23 | 24 | [assembly: CLSCompliant(true)] 25 | 26 | namespace FileWatcherUtilities.Options 27 | { 28 | /// 29 | /// Provides application options. 30 | /// 31 | public class ApplicationOptions 32 | { 33 | /// 34 | /// Get or set synchronous execution. 35 | /// 36 | public bool SynchronousExecution 37 | { 38 | get 39 | { 40 | return _synchronousExecution; 41 | } 42 | set 43 | { 44 | _synchronousExecution = value; 45 | } 46 | } 47 | 48 | /// 49 | /// Get or set run queued processes. 50 | /// 51 | public bool RunQueuedProcesses 52 | { 53 | get 54 | { 55 | return _runQueuedProcesses; 56 | } 57 | set 58 | { 59 | _runQueuedProcesses = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Get or set amount of log messages to display. 65 | /// 66 | public int LogMessages 67 | { 68 | get 69 | { 70 | return _logMessages; 71 | } 72 | set 73 | { 74 | if (value < MinLogMessages || 75 | value > MaxLogMessages) 76 | { 77 | throw new ArgumentException(Resources.ArgumentExceptionInvalidLogMessageValue, 78 | "value"); 79 | } 80 | _logMessages = value; 81 | } 82 | } 83 | 84 | /// 85 | /// Get or set auto startup. 86 | /// 87 | public bool AutoStartup 88 | { 89 | get 90 | { 91 | return _autoStartup; 92 | } 93 | set 94 | { 95 | _autoStartup = value; 96 | } 97 | } 98 | 99 | /// 100 | /// Gets or sets process batch size. 101 | /// 102 | public int ProcessBatchSize 103 | { 104 | get 105 | { 106 | return _processBatchSize; 107 | } 108 | set 109 | { 110 | _processBatchSize = value; 111 | } 112 | } 113 | 114 | /// 115 | /// Maximum number of log messages to display. 116 | /// 117 | private const int MaxLogMessages = 1000; 118 | 119 | /// 120 | /// Minumum number of log messages to display. 121 | /// 122 | private const int MinLogMessages = 10; 123 | 124 | /// 125 | /// Process batch size. 126 | /// 127 | private int _processBatchSize; 128 | 129 | /// 130 | /// Contains auto startup. True if to start file watchers at application startup. 131 | /// 132 | private bool _autoStartup; 133 | 134 | /// 135 | /// Contains run queued processes value. 136 | /// 137 | private bool _runQueuedProcesses; 138 | 139 | /// 140 | /// Contains synchronous execution value. 141 | /// 142 | private bool _synchronousExecution; 143 | 144 | /// 145 | /// Contains amount of log messages to display. Default is "100". 146 | /// 147 | private int _logMessages = 100; 148 | } 149 | } -------------------------------------------------------------------------------- /Options/ApplicationOptionsChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Options 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Options.Properties; 22 | 23 | namespace FileWatcherUtilities.Options 24 | { 25 | /// 26 | /// Provides data for ApplicationOptionsChanged event. 27 | /// 28 | public class ApplicationOptionsChangedEventArgs : EventArgs 29 | { 30 | /// 31 | /// Initializes a new instance of the ApplicationOptionsChangedEventArgs class. 32 | /// 33 | /// ApplicationOptions. 34 | /// applicationOptions is null. 35 | public ApplicationOptionsChangedEventArgs(ApplicationOptions applicationOptions) 36 | { 37 | if (applicationOptions == null) 38 | { 39 | throw new ArgumentNullException("applicationOptions", 40 | Resources.ArgumentNullException); 41 | } 42 | _applicationOptions = applicationOptions; 43 | } 44 | 45 | /// 46 | /// Gets application options. 47 | /// 48 | public ApplicationOptions ApplicationOptions 49 | { 50 | get 51 | { 52 | return _applicationOptions; 53 | } 54 | } 55 | 56 | /// 57 | /// Application options. 58 | /// 59 | private readonly ApplicationOptions _applicationOptions; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Options/DataSetBuilder.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Options 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.Data; 22 | using System.Globalization; 23 | using FileWatcherUtilities.Options.Properties; 24 | 25 | namespace FileWatcherUtilities.Options 26 | { 27 | /// 28 | /// Builds Dataset. 29 | /// 30 | public static class DataSetBuilder 31 | { 32 | /// 33 | /// Returns dataset with configuration table. 34 | /// 35 | /// Dataset with configuration table. 36 | public static DataSet CreateDataSet() 37 | { 38 | DataSet dataSet = null; 39 | 40 | try 41 | { 42 | dataSet = new DataSet(); 43 | 44 | dataSet.Locale = CultureInfo.InvariantCulture; 45 | dataSet.DataSetName = Resources.DatasetName; 46 | 47 | dataSet.Tables.Add(Resources.TableName); 48 | 49 | // Set dataset columns. 50 | dataSet.Tables[Resources.TableName].Columns.Add(Resources.ColumnAutoStartup, 51 | typeof(Boolean)); 52 | 53 | dataSet.Tables[Resources.TableName].Columns.Add(Resources.ColumnLogMessages, 54 | typeof(Int32)); 55 | 56 | dataSet.Tables[Resources.TableName].Columns.Add(Resources.ColumnProcessBatchSize, 57 | typeof(Int32)); 58 | 59 | dataSet.Tables[Resources.TableName].Columns.Add(Resources.ColumnRunQueuedProcesses, 60 | typeof(Boolean)); 61 | 62 | dataSet.Tables[Resources.TableName].Columns.Add(Resources.ColumnSynchronousExecution, 63 | typeof(Boolean)); 64 | 65 | // Set all values to NOT NULL. 66 | foreach (DataColumn dataColumn in dataSet.Tables[Resources.TableName].Columns) 67 | { 68 | dataColumn.AllowDBNull = false; 69 | } 70 | 71 | // Accept changes. 72 | dataSet.AcceptChanges(); 73 | 74 | return dataSet; 75 | } 76 | catch 77 | { 78 | if (dataSet != null) 79 | { 80 | dataSet.Dispose(); 81 | } 82 | 83 | throw; 84 | } 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /Options/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Utilities Options")] 8 | [assembly: AssemblyDescription("File Watcher Utilities Options")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Utilities Options")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("714821c5-d29d-422f-bd50-a0a6273e51d8")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] 32 | -------------------------------------------------------------------------------- /Presenter/Data/FileWatcherInfo.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Logger 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using FileWatcherUtilities.Presenter.Properties; 21 | 22 | namespace FileWatcherUtilities.Presenter 23 | { 24 | /// 25 | /// Holds file watcher infomation. 26 | /// 27 | public class FileWatcherInfo 28 | { 29 | /// 30 | /// Gets or sets file watcher statuts. 31 | /// 32 | public string Status 33 | { 34 | get 35 | { 36 | return _status; 37 | } 38 | set 39 | { 40 | _status = value; 41 | } 42 | } 43 | 44 | /// 45 | /// Gets or sets number of events. 46 | /// 47 | public int Events 48 | { 49 | get 50 | { 51 | return _events; 52 | } 53 | set 54 | { 55 | _events = value; 56 | } 57 | } 58 | 59 | /// 60 | /// Gets or sets last event type. 61 | /// 62 | public string LastEventType 63 | { 64 | get 65 | { 66 | return _lastEventType; 67 | } 68 | set 69 | { 70 | _lastEventType = value; 71 | } 72 | } 73 | 74 | /// 75 | /// Gets or sets last event time. 76 | /// 77 | public string LastEventTime 78 | { 79 | get 80 | { 81 | return _lastEventTime; 82 | } 83 | set 84 | { 85 | _lastEventTime = value; 86 | } 87 | } 88 | 89 | /// 90 | /// Gets or sets number of errors. 91 | /// 92 | public int Errors 93 | { 94 | get 95 | { 96 | return _errors; 97 | } 98 | set 99 | { 100 | _errors = value; 101 | } 102 | } 103 | 104 | /// 105 | /// Gets or sets file watcher enabled. 106 | /// 107 | public bool Enabled 108 | { 109 | get 110 | { 111 | return _enabled; 112 | } 113 | set 114 | { 115 | _enabled = value; 116 | } 117 | } 118 | 119 | /// 120 | /// Resets info. 121 | /// 122 | public void Reset() 123 | { 124 | _status = Resources.StateStopped; 125 | Events = 0; 126 | LastEventType = Resources.LastEventTypeNone; 127 | LastEventTime = Resources.LastEventTimeNone; 128 | Errors = 0; 129 | } 130 | 131 | /// 132 | /// Status of file watcher. 133 | /// 134 | private string _status = Resources.StateStopped; 135 | 136 | /// 137 | /// Number of events. 138 | /// 139 | private int _events; 140 | 141 | /// 142 | /// Last event type. Default is 'None'. 143 | /// 144 | private string _lastEventType = Resources.LastEventTypeNone; 145 | 146 | /// 147 | /// Last event time. Default is 'None'. 148 | /// 149 | private string _lastEventTime = Resources.LastEventTimeNone; 150 | 151 | /// 152 | /// True if file watcher is enabled. 153 | /// 154 | private bool _enabled; 155 | 156 | /// 157 | /// Number of errors. 158 | /// 159 | private int _errors; 160 | } 161 | } -------------------------------------------------------------------------------- /Presenter/Data/GNULicense.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | 22 | namespace FileWatcherUtilities.Presenter 23 | { 24 | /// 25 | /// Provides Gnu license. 26 | /// 27 | public class GnuLicense 28 | { 29 | /// 30 | /// Returns next part of the GNU license. 31 | /// 32 | /// Next part of the GNU license. 33 | public string NextGnuLicensePart() 34 | { 35 | string gnuTemp; 36 | 37 | if (_gnu.Length >= ReadSize) 38 | { 39 | gnuTemp = _gnu.Substring(0, 40 | ReadSize); 41 | 42 | _gnu = _gnu.Substring(ReadSize); 43 | 44 | int newLine = _gnu.IndexOf("\n\r", StringComparison.Ordinal); 45 | 46 | gnuTemp = gnuTemp + 47 | _gnu.Substring(0, 48 | newLine); 49 | 50 | _gnu = _gnu.Substring(newLine); 51 | return gnuTemp; 52 | } 53 | 54 | gnuTemp = _gnu; 55 | _gnu = String.Empty; 56 | return gnuTemp; 57 | } 58 | 59 | /// 60 | /// Returns true, if the curren part is the last part of the license. 61 | /// 62 | /// True, if the current part is the last part of the license. 63 | public bool IsLastPart() 64 | { 65 | if (_gnu.Length >= ReadSize && 66 | _gnu.Length != 0) 67 | { 68 | return true; 69 | } 70 | return false; 71 | } 72 | 73 | /// 74 | /// Contains GNU license text. 75 | /// 76 | private string _gnu = ResourceGNU.COPYING; 77 | 78 | /// 79 | /// Read size of the GNU license. 80 | /// 81 | private const int ReadSize = 1000; 82 | } 83 | } -------------------------------------------------------------------------------- /Presenter/Data/ResourceGNU.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18033 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FileWatcherUtilities.Presenter { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class ResourceGNU { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal ResourceGNU() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileWatcherUtilities.Presenter.Data.ResourceGNU", typeof(ResourceGNU).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to FILE WATCHER SERVICE CONTRACT IS LICENSED UNDER THE LGPL. OTHER PARTS 65 | ///OF THE SOFTWARE ARE LICENSED UNDER THE GPL. 66 | /// 67 | /// GNU LESSER GENERAL PUBLIC LICENSE 68 | /// Version 2.1, February 1999 69 | /// 70 | /// Copyright (C) 1991, 1999 Free Software Foundation, Inc. 71 | /// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 72 | /// Everyone is permitted to copy and distribute verbatim copies 73 | /// of this license document, but changing it is not allowed. 74 | /// 75 | ///[This is the first released version of the Lesser GPL. I [rest of string was truncated]";. 76 | /// 77 | internal static string COPYING { 78 | get { 79 | return ResourceManager.GetString("COPYING", resourceCulture); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Presenter/EventArgs/ConsoleStartedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.Collections.ObjectModel; 22 | using FileWatcherUtilities.Presenter.Properties; 23 | 24 | namespace FileWatcherUtilities.Presenter 25 | { 26 | /// 27 | /// Provides data for ConsoleStarted event. 28 | /// 29 | public class ConsoleStartedEventArgs : EventArgs 30 | { 31 | /// 32 | /// Initializes a new instance of the ConsoleStartedEventArgs class. 33 | /// 34 | /// Console args. 35 | /// args is null. 36 | public ConsoleStartedEventArgs(string[] args) 37 | { 38 | if (args == null) 39 | { 40 | throw new ArgumentNullException("args", 41 | Resources.ArgumentNullException); 42 | } 43 | for (int i = 0; i < args.Length; i++) 44 | { 45 | _args.Add(args[i]); 46 | } 47 | } 48 | 49 | /// 50 | /// Console args. 51 | /// 52 | private readonly Collection _args = new Collection(); 53 | 54 | /// 55 | /// Gets console args. 56 | /// 57 | public Collection Args 58 | { 59 | get 60 | { 61 | return _args; 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Presenter/EventArgs/DaemonSelectedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | 22 | namespace FileWatcherUtilities.Presenter 23 | { 24 | /// 25 | /// Provides data for DaemonSelected event. 26 | /// 27 | public class DaemonSelectedEventArgs : EventArgs 28 | { 29 | /// 30 | /// Initializes a new instance of the DaemonSelectedEventArgs class. 31 | /// 32 | /// Daemon name or null. 33 | public DaemonSelectedEventArgs(string daemonName) 34 | { 35 | _daemonName = daemonName; 36 | } 37 | 38 | /// 39 | /// Selected daemon name. 40 | /// 41 | private readonly string _daemonName; 42 | 43 | /// 44 | /// Gets selected daemon name. 45 | /// 46 | public string DaemonName 47 | { 48 | get 49 | { 50 | return _daemonName; 51 | } 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /Presenter/EventArgs/ServiceStartedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.Collections.ObjectModel; 22 | using FileWatcherUtilities.Presenter.Properties; 23 | 24 | namespace FileWatcherUtilities.Presenter 25 | { 26 | /// 27 | /// Provides data for ServiceStarted event. 28 | /// 29 | public class ServiceStartedEventArgs : EventArgs 30 | { 31 | /// 32 | /// Initializes a new instance of the ServiceStartedEventArgs class. 33 | /// 34 | /// Service args. 35 | /// args is null. 36 | public ServiceStartedEventArgs(string[] args) 37 | { 38 | if (args == null) 39 | { 40 | throw new ArgumentNullException("args", 41 | Resources.ArgumentNullException); 42 | } 43 | for (int i = 0; i < args.Length; i++) 44 | { 45 | _args.Add(args[i]); 46 | } 47 | } 48 | 49 | /// 50 | /// Console args. 51 | /// 52 | private readonly Collection _args = new Collection(); 53 | 54 | /// 55 | /// Gets console args. 56 | /// 57 | public Collection Args 58 | { 59 | get 60 | { 61 | return _args; 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Presenter/EventArgs/ServiceStoppedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | 22 | namespace FileWatcherUtilities.Presenter 23 | { 24 | /// 25 | /// Provides data for ServiceStopped event. 26 | /// 27 | public class ServiceStoppedEventArgs : EventArgs 28 | { 29 | } 30 | } -------------------------------------------------------------------------------- /Presenter/Interfaces/IConsoleView.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | 22 | namespace FileWatcherUtilities.Presenter 23 | { 24 | /// 25 | /// Interface for console view. 26 | /// 27 | public interface IConsoleView 28 | { 29 | /// 30 | /// Start console view. 31 | /// 32 | event EventHandler ConsoleStarted; 33 | 34 | /// 35 | /// Writes message. 36 | /// 37 | /// Message to write. 38 | void Echo(string message); 39 | 40 | /// 41 | /// Writes line. 42 | /// 43 | /// Message to write. 44 | void EchoLine(string message); 45 | 46 | /// 47 | /// Reads key. 48 | /// 49 | /// Key. 50 | string ReadKey(); 51 | 52 | /// 53 | /// Writes line and then reads key. 54 | /// 55 | /// Message to write. 56 | /// Key. 57 | string EchoReadKey(string message); 58 | 59 | /// 60 | /// Reads line. 61 | /// 62 | /// Line. 63 | string ReadLine(); 64 | 65 | /// 66 | /// Writes line an then reads line. 67 | /// 68 | /// Message to write. 69 | /// Line. 70 | string EchoReadLine(string message); 71 | } 72 | } -------------------------------------------------------------------------------- /Presenter/Interfaces/ILogView.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | 22 | namespace FileWatcherUtilities.Presenter 23 | { 24 | /// 25 | /// Interface for log view. 26 | /// 27 | public interface ILogView 28 | { 29 | /// 30 | /// Occures when view is closed. 31 | /// 32 | event EventHandler ViewClosed; 33 | 34 | /// 35 | /// Updates view. 36 | /// 37 | /// Log messages. 38 | void Update(string logMessages); 39 | } 40 | } -------------------------------------------------------------------------------- /Presenter/Interfaces/IOptionsView.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using FileWatcherUtilities.Options; 22 | 23 | namespace FileWatcherUtilities.Presenter 24 | { 25 | /// 26 | /// Interface for options view. 27 | /// 28 | public interface IOptionsView 29 | { 30 | /// 31 | /// Occures when application options are ready to be saved. 32 | /// 33 | event EventHandler Save; 34 | 35 | /// 36 | /// Display application options on the view. 37 | /// 38 | /// Application options to display. 39 | void ViewApplicationOptions(ApplicationOptions applicationOptions); 40 | 41 | /// 42 | /// Returns modified application options. 43 | /// 44 | /// Modified application options. 45 | ApplicationOptions NewApplicationOptions(); 46 | 47 | /// 48 | /// Shows view. 49 | /// 50 | void ShowView(); 51 | 52 | /// 53 | /// Hides view. 54 | /// 55 | void HideView(); 56 | 57 | /// 58 | /// Sets or gets synchronous execution enabled. 59 | /// 60 | bool SynchronousExecutionEnabled { get; set; } 61 | } 62 | } -------------------------------------------------------------------------------- /Presenter/Interfaces/IPropertiesView.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using FileWatcherUtilities.Controller; 23 | 24 | namespace FileWatcherUtilities.Presenter 25 | { 26 | /// 27 | /// Interface for properties view. 28 | /// 29 | public interface IPropertiesView 30 | { 31 | /// 32 | /// Occures when configuration is ready to be saved. 33 | /// 34 | event EventHandler Save; 35 | 36 | /// 37 | /// Display file watcher configuration on the view. 38 | /// 39 | /// File watcher configuration to display. 40 | void ViewFileWatcherConfiguration(KeyValuePair configurationKeyValuePair); 41 | 42 | /// 43 | /// Returns new or modified file watcher configuration set. 44 | /// 45 | /// New or modified file watcher configuration set. 46 | KeyValuePair NewConfigurationKeyValuePair(); 47 | 48 | /// 49 | /// Shows view. 50 | /// 51 | void ShowView(); 52 | 53 | /// 54 | /// Hides view. 55 | /// 56 | void HideView(); 57 | 58 | /// 59 | /// Shows error message. 60 | /// 61 | /// Error message to display. 62 | void ShowError(string message); 63 | } 64 | } -------------------------------------------------------------------------------- /Presenter/Interfaces/IWindowsServiceView.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Presenter 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | 22 | namespace FileWatcherUtilities.Presenter 23 | { 24 | /// 25 | /// Interface for windows service view. 26 | /// 27 | public interface IWindowsServiceView 28 | { 29 | /// 30 | /// Occures when service is started. 31 | /// 32 | event EventHandler ServiceStarted; 33 | 34 | /// 35 | /// Occures when service is stopped. 36 | /// 37 | event EventHandler ServiceStopped; 38 | } 39 | } -------------------------------------------------------------------------------- /Presenter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("File Watcher Utilities Presenter")] 8 | [assembly: AssemblyDescription("File Watcher Utilities Presenter")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("File Watcher Utilities Presenter")] 12 | [assembly: AssemblyCopyright("Copyright © 2006-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("245e9827-d6f7-4da2-91fa-7c23958ce840")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # File Watcher Utilities 2 | 3 | ## File Watcher Utilities Wiki 4 | 5 | NOTE: [File Watcher Utilities project wiki](https://github.com/itechnology/fwutilities/wiki) contains more up to date information. 6 | 7 | ## About File Watcher Utilities 8 | 9 | File Watcher Utilities project provides file system/directory monitoring utilities with loggin and task processing support. The applications have multiple [configuration options](https://github.com/itechnology/fwutilities/wiki/XML-configuration-files). Source code libraries or binaries can be used to create a custom file system monitor. 10 | 11 | ## File Watcher Utilities Applications 12 | 13 | * [File Watcher Console](https://github.com/itechnology/fwutilities/wiki/File-Watcher-Console) (command line version) 14 | * [File Watcher Simple](https://github.com/itechnology/fwutilities/wiki/File-Watcher-Simple) (graphical user interface version) 15 | * [File Watcher Windows Service](https://github.com/itechnology/fwutilities/wiki/File-Watcher-Windows-Service) (windows service version) 16 | 17 | ## File Watcher Utilities system requirements 18 | 19 | * Microsoft Windows 2000, Windows 2003 or Windows XP Professional or Home Edition or Windows Vista 20 | * Microsoft .NET Framework 4.5 -------------------------------------------------------------------------------- /SampleFileWatcherService/FileWatcherService.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Sample File Watcher Service 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.Diagnostics; 22 | using FileWatcherUtilities.FileWatcherServiceContract; 23 | 24 | namespace FileWatcherUtilities.SampleFileWatcherService 25 | { 26 | /// 27 | /// Implements the IFileWatcherService service contract. 28 | /// 29 | public class FileWatcherService : IFileWatcherService 30 | { 31 | #region IFileWatcherService Members 32 | 33 | /// 34 | /// Called when system is changed. 35 | /// 36 | /// Infomation about the system change. 37 | /// Information about the handling of the system change. 38 | /// This method can fail fail by throwing an DefaultFault exception. 39 | [DebuggerStepThrough] 40 | public SystemChangedRespDC SystemChanged(SystemChangedReqDC request) 41 | { 42 | SystemChangedRespDC systemChangedRespDC = new SystemChangedRespDC(); 43 | 44 | Console.WriteLine(Properties.Resources.MessageHandlingRequest, 45 | request.Id, 46 | request.DaemonName); 47 | systemChangedRespDC.Message = "Request handled."; 48 | return systemChangedRespDC; 49 | } 50 | 51 | #endregion 52 | } 53 | } -------------------------------------------------------------------------------- /SampleFileWatcherService/Program.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Sample File Watcher Service 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.ServiceModel; 22 | using System.Security.Permissions; 23 | using System.ServiceModel.Description; 24 | using FileWatcherUtilities.FileWatcherServiceContract; 25 | 26 | [assembly: CLSCompliant(true)] 27 | 28 | namespace FileWatcherUtilities.SampleFileWatcherService 29 | { 30 | /// 31 | /// Sample host. 32 | /// 33 | class Program 34 | { 35 | static void Main() 36 | { 37 | Uri baseAddress = new Uri("http://localhost:8000/SampleFileWatcherService"); 38 | 39 | using (ServiceHost serviceHost = new ServiceHost(typeof(FileWatcherService), baseAddress)) 40 | { 41 | try 42 | { 43 | serviceHost.AddServiceEndpoint(typeof(IFileWatcherService), 44 | new WSHttpBinding(), 45 | "SampleFileWatcherService"); 46 | 47 | ServiceMetadataBehavior serviceMetadataBehavior = new ServiceMetadataBehavior(); 48 | serviceMetadataBehavior.HttpGetEnabled = true; 49 | serviceHost.Description.Behaviors.Add(serviceMetadataBehavior); 50 | 51 | serviceHost.Open(); 52 | 53 | Console.CursorVisible = false; 54 | Console.WriteLine(Properties.Resources.MessageServiceIsReady); 55 | Console.WriteLine(Properties.Resources.MessagePressEnterToTerminate); 56 | Console.ReadLine(); 57 | 58 | serviceHost.Close(); 59 | } 60 | catch (TimeoutException ex) 61 | { 62 | Console.WriteLine(ex.Message); 63 | Console.ReadLine(); 64 | } 65 | catch (CommunicationException ex) 66 | { 67 | Console.WriteLine(ex.Message); 68 | Console.ReadLine(); 69 | } 70 | } 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /SampleFileWatcherService/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Sample File Watcher Service")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("Sample File Watcher Service")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("f6c9a9a0-7b83-4657-a0bb-f1791639d303")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] 32 | -------------------------------------------------------------------------------- /SampleFileWatcherService/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18033 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FileWatcherUtilities.SampleFileWatcherService.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileWatcherUtilities.SampleFileWatcherService.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Handling request '{0}' from '{1}' daemon.. 65 | /// 66 | internal static string MessageHandlingRequest { 67 | get { 68 | return ResourceManager.GetString("MessageHandlingRequest", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to Press <ENTER> to terminate service.. 74 | /// 75 | internal static string MessagePressEnterToTerminate { 76 | get { 77 | return ResourceManager.GetString("MessagePressEnterToTerminate", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to The Sample File Watcher Streaming Service is ready.. 83 | /// 84 | internal static string MessageServiceIsReady { 85 | get { 86 | return ResourceManager.GetString("MessageServiceIsReady", resourceCulture); 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /SampleFileWatcherStreamingService/Program.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File Watcher Utilities / Sample File Watcher Service 3 | * Copyright (c) 2006-2013 Jussi Hiltunen 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ******************************************************************************/ 19 | 20 | using System; 21 | using System.ServiceModel; 22 | using System.Security.Permissions; 23 | using System.ServiceModel.Description; 24 | using FileWatcherUtilities.FileWatcherServiceContract; 25 | 26 | [assembly: CLSCompliant(true)] 27 | 28 | namespace FileWatcherUtilities.SampleFileWatcherStreamingService 29 | { 30 | /// 31 | /// Sample host. 32 | /// 33 | class Program 34 | { 35 | static void Main() 36 | { 37 | Uri baseAddress = new Uri("http://localhost:8000/SampleFileWatcherStreamingService"); 38 | 39 | using (ServiceHost serviceHost = new ServiceHost(typeof(FileWatcherStreamingService), baseAddress)) 40 | { 41 | try 42 | { 43 | BasicHttpBinding basicHttpBinding = new BasicHttpBinding(); 44 | basicHttpBinding.TransferMode = TransferMode.StreamedRequest; 45 | basicHttpBinding.MaxReceivedMessageSize = 20480000; 46 | 47 | serviceHost.AddServiceEndpoint(typeof(IFileWatcherStreamingService), 48 | basicHttpBinding, 49 | "SampleFileWatcherStreamingService"); 50 | 51 | ServiceMetadataBehavior serviceMetadataBehavior = new ServiceMetadataBehavior(); 52 | serviceMetadataBehavior.HttpGetEnabled = true; 53 | serviceHost.Description.Behaviors.Add(serviceMetadataBehavior); 54 | 55 | serviceHost.Open(); 56 | 57 | Console.CursorVisible = false; 58 | Console.WriteLine(Properties.Resources.MessageServiceIsReady); 59 | Console.WriteLine(Properties.Resources.MessagePressEnterToTerminate); 60 | Console.ReadLine(); 61 | 62 | serviceHost.Close(); 63 | } 64 | catch (TimeoutException ex) 65 | { 66 | Console.WriteLine(ex.Message); 67 | Console.ReadLine(); 68 | } 69 | catch (CommunicationException ex) 70 | { 71 | Console.WriteLine(ex.Message); 72 | Console.ReadLine(); 73 | } 74 | } 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /SampleFileWatcherStreamingService/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Sample File Watcher Streaming Service")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("Sample File Watcher Streaming Service")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2013 Jussi Hiltunen")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("21c5fdfa-8fcb-4e26-b192-d38c3b0fd1d8")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | [assembly: AssemblyVersion("4.3.0.0")] 31 | [assembly: AssemblyFileVersion("4.3.0.0")] 32 | -------------------------------------------------------------------------------- /SampleFileWatcherStreamingService/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18033 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FileWatcherUtilities.SampleFileWatcherStreamingService.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileWatcherUtilities.SampleFileWatcherStreamingService.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Press <ENTER> to terminate service.. 65 | /// 66 | internal static string MessagePressEnterToTerminate { 67 | get { 68 | return ResourceManager.GetString("MessagePressEnterToTerminate", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to The Sample File Watcher Streaming Service is ready.. 74 | /// 75 | internal static string MessageServiceIsReady { 76 | get { 77 | return ResourceManager.GetString("MessageServiceIsReady", resourceCulture); 78 | } 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /humans.txt: -------------------------------------------------------------------------------- 1 | /* AUTHORS */ 2 | Author: Jussi Hiltunen (djmoby) 3 | Profile: https://sourceforge.net/u/djmoby/profile/ 4 | Project: https://sourceforge.net/projects/fwutilities/ --------------------------------------------------------------------------------