diff --git a/README.md b/README.md deleted file mode 100644 index af1d04e..0000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -FileWatcher -=========== - -FileWatcher is currently a Windows only C# and IronPython driven program for running scripts when files are changed. I plan on upgrading it to be driven by C++ and Python for performance reasons (Using Windows forms to make the conversion fairly painless), and I might make an effort to make it cross platform in the future (don't hold your breath); if I was to do such an upgrade it would be with QT. - -The program is still in Alpha, though it's basically useable. I still have some bugs to work out, and A LOT of features to work out. I also plan on having some premade scripts to make using it as easy as possible. I have never written a plugin system before (well, the current implementation isn't one, but I'd like to try), so bear with me, and maybe send me some feedback on how I can improve the program. - -Requirements ------------ -* IronPython 2.7.3 - -Notes ------------ -* I realize FileWatcher doesn't yet have a license specified. Bear with me as I determine the best one to use. -* FileWatcher runs in the background, it's a taskbar application. So when you close the windows, the program is still running. To exit you have to open up the menu File>Exit, or right click on the icon in the taskbar and hit Exit. -* Play/Stop buttons do not yet do anything. -* There are currently no hot keys, only keyboard shortcuts when the program is open. If you have a request for specific types of hotkeys, let me know. -* There are some issues with running at startup that may not have been resolved in this version. I need to fix this. -* Play/Stop buttons don't match the other icons because the icon pack doesn't contain such an option. I would like to fix this when I get the time. - -Features ------------ -* Script delay specifyable in units ms, s, m, and h. For instance, you can delay the script by "1s 500ms" or "1h 5m 25ms". This timer can be reset when a file is updated, or continue to count down when the first file was updated. -* Script file is monitored for changes and can be reloaded at the press of a button. -* Script Shortcut button for opening your favorite text editor and quickly updating the script. -* If there's a problem with the script you'll be told what the basic issue is and where it is in the log window, or by hovering over the warning icon in the File Group where the script was loaded. -* Create File Groups to monitor multiple directories, each group uses it's own script. (Currently you can't enable/disable groups, they're automatically active as long as everything is setup correctly) -* System Tray notifications (currently not customizable, will be at a later time) -* Console supports some basic ANSII escape sequences for colorization and what have you. This will be upgraded to support more at a later time (or if I find a support library to do it for me). This allows FileWatcher to support the Python Colorama package for colored Python output. - -Screenshots ------------ -![Screenshot 1](https://raw.github.com/leetNightshade/leetNightshade.github.io/master/FileWatcher/Screenshots/2013-12-22%2013_15_41-FileWatcher.png) - -Examples for use ------------ -* For Game Development purposes to "speed up" build times. - * Build assets (shaders/textures/models) as they're updated. Instead of building everything when you go to run the game, assets are always being built in the background. -* Your own customizable backup system. diff --git a/bin/FileWatcher.exe b/bin/FileWatcher.exe deleted file mode 100644 index 1e5a1ed..0000000 Binary files a/bin/FileWatcher.exe and /dev/null differ diff --git a/code/build/.gitkeep b/code/build/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/code/build/App.config b/code/build/App.config deleted file mode 100644 index 8e15646..0000000 --- a/code/build/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/code/build/FileWatcher.csproj b/code/build/FileWatcher.csproj deleted file mode 100644 index b930b04..0000000 --- a/code/build/FileWatcher.csproj +++ /dev/null @@ -1,251 +0,0 @@ - - - - - Debug - AnyCPU - {AA167571-AC0F-4F78-B471-951FBC597FC3} - WinExe - Properties - FileWatcher - FileWatcher - v4.5 - 512 - false - build\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - false - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - res\stock_3d-texture-and-shading_32x32.ico - - - - False - C:\Program Files (x86)\IronPython 2.7\IronPython.dll - - - False - C:\Program Files (x86)\IronPython 2.7\IronPython.Modules.dll - - - False - C:\Program Files (x86)\IronPython 2.7\Microsoft.Dynamic.dll - - - False - C:\Program Files (x86)\IronPython 2.7\Microsoft.Scripting.dll - - - - - - - - - - - - - - - - - - Form - - - FileGroupSettings.cs - - - UserControl - - - FileGroupTab.cs - - - - Form - - - Form1.cs - - - - - Form - - - NewFileGroup.cs - - - - Form - - - Preferences.cs - - - - Form - - - About.cs - - - - - - - Form - - - ScriptManager.cs - - - - Component - - - - True - True - Resources.resx - - - Form1.cs - - - About.cs - - - FileGroupSettings.cs - - - FileGroupTab.cs - - - NewFileGroup.cs - - - Preferences.cs - - - ResXFileCodeGenerator - Designer - Resources.Designer.cs - - - ScriptManager.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - False - Microsoft .NET Framework 4.5 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/build/FileWatcher.sln b/code/build/FileWatcher.sln deleted file mode 100644 index d05d807..0000000 --- a/code/build/FileWatcher.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileWatcher", "FileWatcher.csproj", "{AA167571-AC0F-4F78-B471-951FBC597FC3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AA167571-AC0F-4F78-B471-951FBC597FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA167571-AC0F-4F78-B471-951FBC597FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA167571-AC0F-4F78-B471-951FBC597FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA167571-AC0F-4F78-B471-951FBC597FC3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/code/build/Properties/AssemblyInfo.cs b/code/build/Properties/AssemblyInfo.cs deleted file mode 100644 index da3718c..0000000 --- a/code/build/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("FileWatcher")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("FileWatcher")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2fdc0178-3e49-4517-b8fd-c5fff550dc55")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/code/build/Properties/Resources.Designer.cs b/code/build/Properties/Resources.Designer.cs deleted file mode 100644 index 14b2d06..0000000 --- a/code/build/Properties/Resources.Designer.cs +++ /dev/null @@ -1,283 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18408 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace FileWatcher.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileWatcher.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap arrow_fat_down { - get { - object obj = ResourceManager.GetObject("arrow_fat_down", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap arrow_fat_up { - get { - object obj = ResourceManager.GetObject("arrow_fat_up", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap arrow_mini_down { - get { - object obj = ResourceManager.GetObject("arrow_mini_down", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap arrow_mini_up { - get { - object obj = ResourceManager.GetObject("arrow_mini_up", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap block { - get { - object obj = ResourceManager.GetObject("block", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap cross { - get { - object obj = ResourceManager.GetObject("cross", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap drop_box { - get { - object obj = ResourceManager.GetObject("drop_box", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap folder { - get { - object obj = ResourceManager.GetObject("folder", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap play { - get { - object obj = ResourceManager.GetObject("play", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap plus { - get { - object obj = ResourceManager.GetObject("plus", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap save { - get { - object obj = ResourceManager.GetObject("save", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap script { - get { - object obj = ResourceManager.GetObject("script", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap settings { - get { - object obj = ResourceManager.GetObject("settings", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap stock_3d_texture_and_shading_128x128 { - get { - object obj = ResourceManager.GetObject("stock_3d_texture_and_shading_128x128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// - internal static System.Drawing.Icon stock_3d_texture_and_shading_16x16 { - get { - object obj = ResourceManager.GetObject("stock_3d_texture_and_shading_16x16", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// - internal static System.Drawing.Icon stock_3d_texture_and_shading_32x32 { - get { - object obj = ResourceManager.GetObject("stock_3d_texture_and_shading_32x32", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap stock_3d_texture_spherical_128x128 { - get { - object obj = ResourceManager.GetObject("stock_3d_texture_spherical_128x128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// - internal static System.Drawing.Icon stock_3d_texture_spherical_16x16 { - get { - object obj = ResourceManager.GetObject("stock_3d_texture_spherical_16x16", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// - internal static System.Drawing.Icon stock_3d_texture_spherical_32x32 { - get { - object obj = ResourceManager.GetObject("stock_3d_texture_spherical_32x32", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap stop { - get { - object obj = ResourceManager.GetObject("stop", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap trash { - get { - object obj = ResourceManager.GetObject("trash", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap warning { - get { - object obj = ResourceManager.GetObject("warning", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/code/build/Properties/Resources.resx b/code/build/Properties/Resources.resx deleted file mode 100644 index f25eba4..0000000 --- a/code/build/Properties/Resources.resx +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\res\arrow_fat_down.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\arrow_fat_up.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\arrow_mini_down.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\arrow_mini_up.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\block.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\cross.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\drop_box.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\folder.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\play.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\plus.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\save.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\script.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\stock_3d-texture-and-shading_128x128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\stock_3d-texture-and-shading_16x16.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\stock_3d-texture-and-shading_32x32.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\stock_3d-texture-spherical_128x128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\stock_3d-texture-spherical_16x16.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\stock_3d-texture-spherical_32x32.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\stop.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\trash.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\res\warning.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/code/build/Properties/Settings.Designer.cs b/code/build/Properties/Settings.Designer.cs deleted file mode 100644 index cc1e6b9..0000000 --- a/code/build/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18034 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace FileWatcher.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/code/build/Properties/Settings.settings b/code/build/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/code/build/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/code/build/packages.config b/code/build/packages.config deleted file mode 100644 index 88a3709..0000000 --- a/code/build/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/code/build/res/arrow_fat_down.gif b/code/build/res/arrow_fat_down.gif deleted file mode 100644 index d37276e..0000000 Binary files a/code/build/res/arrow_fat_down.gif and /dev/null differ diff --git a/code/build/res/arrow_fat_up.gif b/code/build/res/arrow_fat_up.gif deleted file mode 100644 index 7bf81d5..0000000 Binary files a/code/build/res/arrow_fat_up.gif and /dev/null differ diff --git a/code/build/res/arrow_mini_down.gif b/code/build/res/arrow_mini_down.gif deleted file mode 100644 index d00d038..0000000 Binary files a/code/build/res/arrow_mini_down.gif and /dev/null differ diff --git a/code/build/res/arrow_mini_up.gif b/code/build/res/arrow_mini_up.gif deleted file mode 100644 index 5928a53..0000000 Binary files a/code/build/res/arrow_mini_up.gif and /dev/null differ diff --git a/code/build/res/block.gif b/code/build/res/block.gif deleted file mode 100644 index 0e3b9b9..0000000 Binary files a/code/build/res/block.gif and /dev/null differ diff --git a/code/build/res/cross.gif b/code/build/res/cross.gif deleted file mode 100644 index c3dff79..0000000 Binary files a/code/build/res/cross.gif and /dev/null differ diff --git a/code/build/res/drop_box.gif b/code/build/res/drop_box.gif deleted file mode 100644 index ce88963..0000000 Binary files a/code/build/res/drop_box.gif and /dev/null differ diff --git a/code/build/res/folder.gif b/code/build/res/folder.gif deleted file mode 100644 index 45948a0..0000000 Binary files a/code/build/res/folder.gif and /dev/null differ diff --git a/code/build/res/play.png b/code/build/res/play.png deleted file mode 100644 index b3553a5..0000000 Binary files a/code/build/res/play.png and /dev/null differ diff --git a/code/build/res/plus.gif b/code/build/res/plus.gif deleted file mode 100644 index 1624b06..0000000 Binary files a/code/build/res/plus.gif and /dev/null differ diff --git a/code/build/res/save.gif b/code/build/res/save.gif deleted file mode 100644 index 626e98d..0000000 Binary files a/code/build/res/save.gif and /dev/null differ diff --git a/code/build/res/script.gif b/code/build/res/script.gif deleted file mode 100644 index d5d99da..0000000 Binary files a/code/build/res/script.gif and /dev/null differ diff --git a/code/build/res/settings.png b/code/build/res/settings.png deleted file mode 100644 index 192f760..0000000 Binary files a/code/build/res/settings.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_128x128.ico b/code/build/res/stock_3d-texture-and-shading_128x128.ico deleted file mode 100644 index 4f0762b..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_128x128.ico and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_128x128.png b/code/build/res/stock_3d-texture-and-shading_128x128.png deleted file mode 100644 index 395907e..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_128x128.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_16x16.ico b/code/build/res/stock_3d-texture-and-shading_16x16.ico deleted file mode 100644 index 3cab31f..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_16x16.ico and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_16x16.png b/code/build/res/stock_3d-texture-and-shading_16x16.png deleted file mode 100644 index 9bb8e1d..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_16x16.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_256x256.ico b/code/build/res/stock_3d-texture-and-shading_256x256.ico deleted file mode 100644 index 0dc94fe..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_256x256.ico and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_256x256.png b/code/build/res/stock_3d-texture-and-shading_256x256.png deleted file mode 100644 index 1d3224d..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_256x256.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_32x32.ico b/code/build/res/stock_3d-texture-and-shading_32x32.ico deleted file mode 100644 index 0ea93e9..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_32x32.ico and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_32x32.png b/code/build/res/stock_3d-texture-and-shading_32x32.png deleted file mode 100644 index fad0895..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_32x32.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-and-shading_48x48.png b/code/build/res/stock_3d-texture-and-shading_48x48.png deleted file mode 100644 index 63d0ceb..0000000 Binary files a/code/build/res/stock_3d-texture-and-shading_48x48.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_128x128.ico b/code/build/res/stock_3d-texture-spherical_128x128.ico deleted file mode 100644 index a57c06e..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_128x128.ico and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_128x128.png b/code/build/res/stock_3d-texture-spherical_128x128.png deleted file mode 100644 index b575d8b..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_128x128.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_16x16.ico b/code/build/res/stock_3d-texture-spherical_16x16.ico deleted file mode 100644 index d09fe58..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_16x16.ico and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_16x16.png b/code/build/res/stock_3d-texture-spherical_16x16.png deleted file mode 100644 index 5c22d62..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_16x16.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_256x256.ico b/code/build/res/stock_3d-texture-spherical_256x256.ico deleted file mode 100644 index 9df63f3..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_256x256.ico and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_256x256.png b/code/build/res/stock_3d-texture-spherical_256x256.png deleted file mode 100644 index 8b48139..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_256x256.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_32x32.ico b/code/build/res/stock_3d-texture-spherical_32x32.ico deleted file mode 100644 index c6bc2a1..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_32x32.ico and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_32x32.png b/code/build/res/stock_3d-texture-spherical_32x32.png deleted file mode 100644 index 1985e59..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_32x32.png and /dev/null differ diff --git a/code/build/res/stock_3d-texture-spherical_48x48.png b/code/build/res/stock_3d-texture-spherical_48x48.png deleted file mode 100644 index 2d1b7b8..0000000 Binary files a/code/build/res/stock_3d-texture-spherical_48x48.png and /dev/null differ diff --git a/code/build/res/stop.png b/code/build/res/stop.png deleted file mode 100644 index eca747f..0000000 Binary files a/code/build/res/stop.png and /dev/null differ diff --git a/code/build/res/trash.gif b/code/build/res/trash.gif deleted file mode 100644 index 9e03d6d..0000000 Binary files a/code/build/res/trash.gif and /dev/null differ diff --git a/code/build/res/warning.gif b/code/build/res/warning.gif deleted file mode 100644 index 6a71565..0000000 Binary files a/code/build/res/warning.gif and /dev/null differ diff --git a/code/src/About.Designer.cs b/code/src/About.Designer.cs deleted file mode 100644 index 5d43b90..0000000 --- a/code/src/About.Designer.cs +++ /dev/null @@ -1,99 +0,0 @@ -namespace FileWatcher -{ - partial class About - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About)); - this.button1 = new System.Windows.Forms.Button(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // button1 - // - this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button1.Location = new System.Drawing.Point(379, 151); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 1; - this.button1.Text = "Ok"; - this.button1.UseVisualStyleBackColor = true; - // - // pictureBox1 - // - this.pictureBox1.Image = global::FileWatcher.Properties.Resources.stock_3d_texture_and_shading_128x128; - this.pictureBox1.Location = new System.Drawing.Point(12, 12); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(131, 135); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // richTextBox1 - // - this.richTextBox1.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.richTextBox1.Location = new System.Drawing.Point(149, 12); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(305, 133); - this.richTextBox1.TabIndex = 2; - this.richTextBox1.Text = resources.GetString("richTextBox1.Text"); - // - // About - // - this.AcceptButton = this.button1; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.button1; - this.ClientSize = new System.Drawing.Size(466, 186); - this.Controls.Add(this.richTextBox1); - this.Controls.Add(this.button1); - this.Controls.Add(this.pictureBox1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "About"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "About"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.RichTextBox richTextBox1; - } -} \ No newline at end of file diff --git a/code/src/About.cs b/code/src/About.cs deleted file mode 100644 index 422311f..0000000 --- a/code/src/About.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace FileWatcher -{ - public partial class About : Form - { - public About() - { - InitializeComponent(); - } - } -} diff --git a/code/src/About.resx b/code/src/About.resx deleted file mode 100644 index a433657..0000000 --- a/code/src/About.resx +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - This tool used to be a TextureConverter, so icons are no longer relevant, and they may be changed at some point. - -FileWatcher is a file monitor that runs python scripts when file changes happen. It's not fully fleshed out, and since time is precious, some features are incomplete or may not work as expected. - -This program was compiled with IronPython 2.7, so it is only gauranteed to be compatible with Python 2.7. IronPython 2.7 also requires at least .NET 4.0. Unfortunately IronPython is a port of Python for .NET, so it's missing certain features and has certain bugs. I'll try to figure out a better solution, but until then we have to deal with what we've got; for now, we have to use IronPython's version of the Python Standard Library, instead of 2.7.3. - - - - - AAABAAIAICAAAAEAIACoEAAAJgAAABAQAAABACAAaAQAAM4QAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQ - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAA - AAMAAAADAAAABAAAAAUAAAAGAAAABgAAAAYAAAAGAAAABgAAAAUAAAAEAAAAAwAAAAIAAAABAAAAAQAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAA - AAQAAAAGAAAACQAAAAsAAAAOAAAAEQAAABMAAAAUAAAAFQAAABMAAAASAAAADwAAAA0AAAAKAAAACAAA - AAYAAAAEAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA - AAMAAAAGAAAACgAAAA8AAAATAAAAGQAAAB4AAAAjAAAAJwAAACoAAAArAAAAKQAAACUAAAAhAAAAHAAA - ABcAAAASAAAADQAAAAkAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAACAAAABQAAAAoAAAAQA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//rZiP/51H3/+NOD//bF - YP/wogv/4qIq/8mPKP9iSBvQBwQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQjMcsqh+ - OP+8hSP/1ZQc/++qJ//xpxP/868j//jTgP/74qn/+c9s//jGTP/4yFD/+MlQ//jITv/85rH//OSu//jO - b//0tSz/87Ir//O1Ov/nmwv/3a5Z/8SYSv9SQCSzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsU - CUSNcUb1vZVR/8+fS//ovW7/8KUW//GmEv/yryP/+t2f//vjrf/3yFv/98FD//fDRv/3w0f/98JF//vi - p//75bL/+daI//OyKP/yqxz/9cBZ//LEbv/frVD/0qlh/5p5QfQnHhBFAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAPisSvJ5yLf+4iDX/2bFp/+a4Yv/vphv/87hC//XCWP/1vkr/9b9H//rbl//74aj/++Ko//vh - pf/736D/+M5w//jMbP/4zHD/9bk+//GqGv/zszj/8sl7/+W6a//EiiT/tYY1/1NAIb8AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAABRVNwvrkFoD/76QQP/MlDH/36c+//TNhP/41ZL/9sdo//KtH//zsSb/++Gr//zp - wP/86sT//OvF//zqxP/2xVv/9LMq//OwJP/63KD/+diW//bHbf/stU7/5Lxw/8KHHf+pcRD/akoV7AAA - ABQAAAAAAAAAAAAAAAAAAAAAHBEDd4liKP+meTH/qGsB/716Av/frE7/8s6J//jWlf/0vVD/8rEr//S7 - Q//868b//fDV//3y2v/98tv//fDX//jSg//0vEb/87Iw//nXlP/526D/+NSQ/9+TB//NiAj/wokk/6Zr - B/+YayL/LSIQegAAAAAAAAAAAAAAAAAAAAA9LhmrnntG/7GKTf+laQH/u3sK/9qpTf/ntFX/8btX//jU - kf/74rT/++nD//fPff/3znn/9814//fNdv/3y3L/++Kv//zv1P/87Mv/9st1//K0O//qrDT/4qpF/9CX - Lv/DjjH/w51c/6yERv9DMBWqAAAAAAAAAAAAAAA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uJyAYoJqVfLu4tc7FwLvuxsK977Ov - qsugmZR8OjQuGQAAAABwYlIDAAAAAAAAAAD//wAA//8AAPgfAADwDwAA4AcAAMADAADAAwAAgAEAAIAB - AACAAQAAgAEAAMADAADAAwAA4AcAAPAPAAD8PwAA - - - \ No newline at end of file diff --git a/code/src/EventRaisingStreamWriter.cs b/code/src/EventRaisingStreamWriter.cs deleted file mode 100644 index 6973631..0000000 --- a/code/src/EventRaisingStreamWriter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace FileWatcher -{ - public class EventRaisingStreamWriter : StreamWriter - { - public event EventHandler> StringWritten; - - public EventRaisingStreamWriter(Stream s) - : base(s) - { - } - - private void LaunchEvent(string txtWritten) - { - if (StringWritten != null) - { - StringWritten(this, new MyEvtArgs(txtWritten)); - } - } - - public override void Write(string value) - { - base.Write(value); - LaunchEvent(value); - } - public override void Write(bool value) - { - base.Write(value); - LaunchEvent(value.ToString()); - } - } -} diff --git a/code/src/FileGroupSettings.Designer.cs b/code/src/FileGroupSettings.Designer.cs deleted file mode 100644 index 2d69cea..0000000 --- a/code/src/FileGroupSettings.Designer.cs +++ /dev/null @@ -1,97 +0,0 @@ -namespace FileWatcher -{ - partial class FileGroupSettings - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FileGroupSettings)); - this.restartDelayCB = new System.Windows.Forms.CheckBox(); - this.stopScriptCB = new System.Windows.Forms.CheckBox(); - this.relativeScriptCB = new System.Windows.Forms.CheckBox(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.SuspendLayout(); - // - // restartDelayCB - // - this.restartDelayCB.AutoSize = true; - this.restartDelayCB.Location = new System.Drawing.Point(12, 233); - this.restartDelayCB.Name = "restartDelayCB"; - this.restartDelayCB.Size = new System.Drawing.Size(231, 17); - this.restartDelayCB.TabIndex = 0; - this.restartDelayCB.Text = "Restart script delay timer when file updated."; - this.restartDelayCB.UseVisualStyleBackColor = true; - // - // stopScriptCB - // - this.stopScriptCB.AutoSize = true; - this.stopScriptCB.Location = new System.Drawing.Point(12, 210); - this.stopScriptCB.Name = "stopScriptCB"; - this.stopScriptCB.Size = new System.Drawing.Size(163, 17); - this.stopScriptCB.TabIndex = 1; - this.stopScriptCB.Text = "Stop script when file updated"; - this.stopScriptCB.UseVisualStyleBackColor = true; - // - // relativeScriptCB - // - this.relativeScriptCB.AutoSize = true; - this.relativeScriptCB.Checked = true; - this.relativeScriptCB.CheckState = System.Windows.Forms.CheckState.Checked; - this.relativeScriptCB.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.relativeScriptCB.Location = new System.Drawing.Point(12, 187); - this.relativeScriptCB.Name = "relativeScriptCB"; - this.relativeScriptCB.Size = new System.Drawing.Size(120, 17); - this.relativeScriptCB.TabIndex = 2; - this.relativeScriptCB.Text = "Relative Script Path"; - this.relativeScriptCB.UseVisualStyleBackColor = true; - // - // FileGroupSettings - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(284, 262); - this.Controls.Add(this.relativeScriptCB); - this.Controls.Add(this.stopScriptCB); - this.Controls.Add(this.restartDelayCB); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "FileGroupSettings"; - this.ShowInTaskbar = false; - this.Text = "File Group Settings"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - public System.Windows.Forms.CheckBox restartDelayCB; - public System.Windows.Forms.CheckBox stopScriptCB; - public System.Windows.Forms.CheckBox relativeScriptCB; - private System.Windows.Forms.ToolTip toolTip1; - } -} \ No newline at end of file diff --git a/code/src/FileGroupSettings.cs b/code/src/FileGroupSettings.cs deleted file mode 100644 index 766b2e1..0000000 --- a/code/src/FileGroupSettings.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace FileWatcher -{ - public partial class FileGroupSettings : Form - { - public FileGroupSettings() - { - InitializeComponent(); - } - - private void comboBox1_TextChanged(object sender, EventArgs e) - { - - } - } -} diff --git a/code/src/FileGroupSettings.resx b/code/src/FileGroupSettings.resx deleted file mode 100644 index 8157236..0000000 --- a/code/src/FileGroupSettings.resx +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - - - AAABAAIAICAAAAEAIACoEAAAJgAAABAQAAABACAAaAQAAM4QAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQ - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAA - AAMAAAADAAAABAAAAAUAAAAGAAAABgAAAAYAAAAGAAAABgAAAAUAAAAEAAAAAwAAAAIAAAABA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9sdo//KtH//zsSb/++Gr//zp - wP/86sT//OvF//zqxP/2xVv/9LMq//OwJP/63KD/+diW//bHbf/stU7/5Lxw/8KHHf+pcRD/akoV7AAA - ABQAAAAAAAAAAAAAAAAAAAAAHBEDd4liKP+meTH/qGsB/716Av/frE7/8s6J//jWlf/0vVD/8rEr//S7 - Q//868b//fDV//3y2v/98tv//fDX//jSg//0vEb/87Iw//nXlP/526D/+NSQ/9+TB//NiAj/wokk/6Zr - B/+YayL/LSIQegAAAAAAAAAAAAAAAAAAAAA9LhmrnntG/7GKTf+laQH/u3sK/9qpTf/ntFX/8btX//jU - kf/74rT/++nD//fPff/3znn/9814//fNdv/3y3L/++Kv//zv1P/87Mv/9st1//K0O//qrDT/4qpF/9CX - Lv/DjjH/w51c/6yERv9DMBWqAAAAAAAAAAAAAAAAAAAAAEs5I72PZyz/pXo2/8OcXP/XtXn/yYsa/9+q - Sf/svmf/+eCw//zu0v/98dn/98t2//fKcv/3y3P/98tz//fLc//747P//fLd//3w2P/30Yb/8cFm/+av - SP/mv3v/4L+E/86oZf+iaw//nHAp/1RAJL0AAAAAAAAAAAAAAAAAAAAATDoizIFWF/+WaSD/x6Zw/9Sz - fP/TqFz/4Llx/+e+cf/34br//O/X//3y3f/3zHv/9sp0//fKdf/3y3X/98p1//rjt//99OL//fHc//TS - kf/rwHD/5bxw/+rQov/dvof/z61y/5dfAf+Zbir/alc90QAAAAAAAAAAAAAAAAAAAABRQCnMfFIV/5Jm - IP/DpHH/3ceh/9m5gv/dunr/4756//XkxP/679z//PLh//TNg//0ynn/9ct5//bLef/1y3n/+eS7//z1 - 5//78uD/8NKb/+fAef/hvHn/7Nm4/+POp//MrXf/kVoB/49jIP9NOBrKAAAAAAAAAAAAAAAAAAAAAEc4 - JL2ObDz/nHdA/7eVYP/h0LT/17uL/9q6gv/fvYL/9OXM//nw3//78+X/7s2N/+7Jgv/vyYL/8MqC/+/J - gv/35MH//Pbq//vz5P/s0aD/4r+B/928gv/o1rX/5NGy/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AAAAAAP//////////////////////8A///8AD//8A - AP/+AAB//AAAP/gAAB/wAAAP8AAAD+AAAAfgAAAH4AAAB8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA+AA - AAfgAAAH4AAAB/AAAA/wAAAP+AAAH/wAAD/+AAB//wAA///AA///+B//KAAAABAAAAAgAAAAAQAgAAAA - AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaFhEFRTEPCVVAEwoWGQ8LFx8fC0w+ - HAtHNRMLGBQMBgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEhFwYJGBIECwAAAAwAAAAmAAAANgAA - ADcAAAAqAAAAERMMAA8dEwMMAAAAAgAAAAAAAAAAAAAAAAAAAABVQSEDAAAAABYZJCVuTBCHqoAt0MOi - UebDplvlsIk70X5cG4oZGB0pAAAAAFhEIAMAAAAAAAAAAAAAAAB/XioCAAAAAD4sEEqth0Tn6rVM//7O - W/7/7ab//++l///UZP7ywl//vI435kkvAEoAAAAAl2sdAgAAAABkRBADAAAAAD0rEUiXYwf38LE4//3U - fPz30nX9+tuL/vrbhv741Hn9+9iJ/Pm1MP+0eRH4Uj8hSAAAAAB+Wx4DAAAAAAAAERePbzzh2aJA//Cj - DPz1xmH/+tqO//fBPP/3xkv//Oaz//bDVv/yriX87bdU/6SCR+EAAw0XAAAAAAAAAABLLwlwonQp/+Gv - U/v1xGX/9Lg8//fJaP/968P//Oa2//bDVf/1wVP/9sVm/+y7YPuyfyT/X0MUcQAAAAAAAAAAdFgxu6l0 - Hf/LjyL88sp8//bJb//41o3/+uGu//rgqv/41Ir/+NGD//TGbf/ZmST8vIcs/35dKLsAAAAAAABQB25M - HdazjEz/1Klf/eKxVf/77tT/++Cw//bEYf/3yGr//fDX//rkuv/ptVT/5seP/bmMPv99WCDWAAWNBwAA - PQdrTSLWrYlQ/9zEmv3fvYL/9+vU//fhuP/wxnf/8sp///vu1P/14sD/48GE/+bSsP23j0//elko1gAA - SAcAAAAAWDwXuZ99S//ezbH87+TR/+TLoP/t2bX/+/Tn//v05//q0qj/7Ni1//Hn1P/aw538rYxZ/3BU - LrsAAAAAAAAAADYfAW+olHr/6+HS+9zNs//m1rr/7d/J//Pr3v/z697/7d7F/+bXvP/j1L3/8Ojc+6yW - dv9HLw5wAAAAAAAAAAAAAAAViHpn3t3Sw//bzrv87efd//Hp4P/dzK//386y//by7f/o3s//2865/OLY - yf+UhXPfAAAAFQAAAABVRjYDAAAAACobDEannJH49fHs/+zm3Pzf1cj99PDs//Lu6P/h18n98u7o/PHs - 5P+qn5H4NSYVRgAAAABgUT8DAAAAAJOJfgIAAAAAWVNMR8G8t+Xk4Nv/8+/r/vbz8P/28+//8u7o/ufj - 3v/Gwr3mYFpTSAAAAACbkYQCAAAAAAAAAAAAAAAAYVNEAwAAAAAuJyAYoJqVfLu4tc7FwLvuxsK977Ov - qsugmZR8OjQuGQAAAABwYlIDAAAAAAAAAAD//wAA//8AAPgfAADwDwAA4AcAAMADAADAAwAAgAEAAIAB - AACAAQAAgAEAAMADAADAAwAA4AcAAPAPAAD8PwAA - - - \ No newline at end of file diff --git a/code/src/FileGroupTab.Designer.cs b/code/src/FileGroupTab.Designer.cs deleted file mode 100644 index 9404097..0000000 --- a/code/src/FileGroupTab.Designer.cs +++ /dev/null @@ -1,352 +0,0 @@ -namespace FileWatcher -{ - partial class FileGroupTab - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.toolStrip = new System.Windows.Forms.ToolStrip(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); - this.FileExtensionsToolBox = new System.Windows.Forms.ToolStripTextBox(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.scriptPathTextBox = new System.Windows.Forms.ToolStripTextBox(); - this.toolStripTextBox1 = new System.Windows.Forms.ToolStripTextBox(); - this.delayCountDownLabel = new System.Windows.Forms.ToolStripLabel(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.scriptWatcher1 = new System.IO.FileSystemWatcher(); - this.scriptWorker = new System.ComponentModel.BackgroundWorker(); - this.foldersListBox = new System.Windows.Forms.ListBox(); - this.toolStripButton5 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton6 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.extensionWarning = new System.Windows.Forms.ToolStripLabel(); - this.scriptWarning = new System.Windows.Forms.ToolStripLabel(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.scriptMonitorButton = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton7 = new System.Windows.Forms.ToolStripButton(); - this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); - this.toolStrip.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.scriptWatcher1)).BeginInit(); - this.SuspendLayout(); - // - // toolStrip - // - this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton5, - this.toolStripButton6, - this.toolStripSeparator1, - this.toolStripButton2, - this.toolStripLabel1, - this.FileExtensionsToolBox, - this.extensionWarning, - this.toolStripSeparator2, - this.scriptPathTextBox, - this.scriptWarning, - this.toolStripButton1, - this.scriptMonitorButton, - this.toolStripButton7, - this.toolStripTextBox1, - this.toolStripLabel2, - this.delayCountDownLabel, - this.toolStripButton3, - this.toolStripButton4}); - this.toolStrip.Location = new System.Drawing.Point(0, 0); - this.toolStrip.Name = "toolStrip"; - this.toolStrip.Size = new System.Drawing.Size(669, 25); - this.toolStrip.TabIndex = 1; - this.toolStrip.Text = "toolStrip3"; - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); - // - // toolStripLabel1 - // - this.toolStripLabel1.Name = "toolStripLabel1"; - this.toolStripLabel1.Size = new System.Drawing.Size(86, 22); - this.toolStripLabel1.Text = "File Extensions:"; - // - // FileExtensionsToolBox - // - this.FileExtensionsToolBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.FileExtensionsToolBox.Name = "FileExtensionsToolBox"; - this.FileExtensionsToolBox.Size = new System.Drawing.Size(100, 25); - this.FileExtensionsToolBox.ToolTipText = "*.mp *.wav *.flac"; - this.FileExtensionsToolBox.TextChanged += new System.EventHandler(this.FileExtensionsToolBox_TextChanged); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); - // - // scriptPathTextBox - // - this.scriptPathTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.scriptPathTextBox.Name = "scriptPathTextBox"; - this.scriptPathTextBox.Size = new System.Drawing.Size(125, 25); - this.scriptPathTextBox.ToolTipText = "Script path"; - this.scriptPathTextBox.TextChanged += new System.EventHandler(this.scriptPathTextBox_TextChanged); - // - // toolStripTextBox1 - // - this.toolStripTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.toolStripTextBox1.Name = "toolStripTextBox1"; - this.toolStripTextBox1.Size = new System.Drawing.Size(50, 25); - this.toolStripTextBox1.Text = "5s"; - this.toolStripTextBox1.ToolTipText = "Script Delay (ex: 5m 5s) (units: ms,s,m,h)"; - this.toolStripTextBox1.TextChanged += new System.EventHandler(this.toolStripTextBox1_TextChanged); - // - // delayCountDownLabel - // - this.delayCountDownLabel.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.delayCountDownLabel.Name = "delayCountDownLabel"; - this.delayCountDownLabel.Size = new System.Drawing.Size(33, 22); - this.delayCountDownLabel.Text = "--ms"; - this.delayCountDownLabel.ToolTipText = "Remaining time on script delay."; - // - // openFileDialog1 - // - this.openFileDialog1.FileName = "openFileDialog1"; - this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk); - // - // splitContainer1 - // - this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 25); - this.splitContainer1.Name = "splitContainer1"; - this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Window; - this.splitContainer1.Panel1.Controls.Add(this.foldersListBox); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.richTextBox1); - this.splitContainer1.Size = new System.Drawing.Size(669, 355); - this.splitContainer1.SplitterDistance = 179; - this.splitContainer1.TabIndex = 3; - // - // richTextBox1 - // - this.richTextBox1.BackColor = System.Drawing.SystemColors.AppWorkspace; - this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.richTextBox1.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.richTextBox1.Location = new System.Drawing.Point(0, 0); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.ReadOnly = true; - this.richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedBoth; - this.richTextBox1.Size = new System.Drawing.Size(667, 170); - this.richTextBox1.TabIndex = 0; - this.richTextBox1.Text = ":Script Output:\n"; - // - // scriptWatcher1 - // - this.scriptWatcher1.EnableRaisingEvents = true; - this.scriptWatcher1.Filter = "."; - this.scriptWatcher1.SynchronizingObject = this; - this.scriptWatcher1.Changed += new System.IO.FileSystemEventHandler(this.scriptWatcher1_Changed); - // - // scriptWorker - // - this.scriptWorker.WorkerSupportsCancellation = true; - this.scriptWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork); - // - // foldersListBox - // - this.foldersListBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.foldersListBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.foldersListBox.FormattingEnabled = true; - this.foldersListBox.Location = new System.Drawing.Point(0, 0); - this.foldersListBox.Name = "foldersListBox"; - this.foldersListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; - this.foldersListBox.Size = new System.Drawing.Size(667, 177); - this.foldersListBox.TabIndex = 3; - // - // toolStripButton5 - // - this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton5.Image = global::FileWatcher.Properties.Resources.plus; - this.toolStripButton5.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton5.Name = "toolStripButton5"; - this.toolStripButton5.Size = new System.Drawing.Size(23, 22); - this.toolStripButton5.Text = "Add a new directory to watch for file changes."; - this.toolStripButton5.Click += new System.EventHandler(this.toolStripButton5_Click_1); - // - // toolStripButton6 - // - this.toolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton6.Image = global::FileWatcher.Properties.Resources.cross; - this.toolStripButton6.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton6.Name = "toolStripButton6"; - this.toolStripButton6.Size = new System.Drawing.Size(23, 22); - this.toolStripButton6.Text = "Remove selected directories"; - this.toolStripButton6.Click += new System.EventHandler(this.toolStripButton6_Click); - // - // toolStripButton2 - // - this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton2.Image = global::FileWatcher.Properties.Resources.settings; - this.toolStripButton2.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(23, 22); - this.toolStripButton2.Text = "File Group Settings"; - this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click); - // - // extensionWarning - // - this.extensionWarning.Image = global::FileWatcher.Properties.Resources.warning; - this.extensionWarning.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.extensionWarning.Margin = new System.Windows.Forms.Padding(2, 1, 2, 2); - this.extensionWarning.Name = "extensionWarning"; - this.extensionWarning.Size = new System.Drawing.Size(10, 22); - this.extensionWarning.ToolTipText = "Invalid File Extension/s"; - // - // scriptWarning - // - this.scriptWarning.Image = global::FileWatcher.Properties.Resources.warning; - this.scriptWarning.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.scriptWarning.Margin = new System.Windows.Forms.Padding(2, 1, 2, 2); - this.scriptWarning.Name = "scriptWarning"; - this.scriptWarning.Size = new System.Drawing.Size(10, 22); - this.scriptWarning.ToolTipText = "Invalid Script"; - // - // toolStripButton1 - // - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Image = global::FileWatcher.Properties.Resources.folder; - this.toolStripButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(23, 22); - this.toolStripButton1.Text = "Load and link script"; - this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); - // - // scriptMonitorButton - // - this.scriptMonitorButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.scriptMonitorButton.Enabled = false; - this.scriptMonitorButton.Image = global::FileWatcher.Properties.Resources.block; - this.scriptMonitorButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.scriptMonitorButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.scriptMonitorButton.Name = "scriptMonitorButton"; - this.scriptMonitorButton.Size = new System.Drawing.Size(23, 22); - this.scriptMonitorButton.Text = "Script Monitor (when script is updated check here to reload script)"; - this.scriptMonitorButton.Click += new System.EventHandler(this.scriptMonitorButton_Click); - // - // toolStripButton7 - // - this.toolStripButton7.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton7.Image = global::FileWatcher.Properties.Resources.script; - this.toolStripButton7.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton7.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton7.Name = "toolStripButton7"; - this.toolStripButton7.Size = new System.Drawing.Size(23, 22); - this.toolStripButton7.Text = "Edit Script using the default editor set in Preferences"; - this.toolStripButton7.Click += new System.EventHandler(this.toolStripButton7_Click_1); - // - // toolStripLabel2 - // - this.toolStripLabel2.Image = global::FileWatcher.Properties.Resources.warning; - this.toolStripLabel2.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripLabel2.Margin = new System.Windows.Forms.Padding(2, 1, 2, 2); - this.toolStripLabel2.Name = "toolStripLabel2"; - this.toolStripLabel2.Size = new System.Drawing.Size(10, 22); - this.toolStripLabel2.ToolTipText = "Invalid Delay"; - // - // toolStripButton3 - // - this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton3.Image = global::FileWatcher.Properties.Resources.play; - this.toolStripButton3.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(23, 22); - this.toolStripButton3.Text = "toolStripButton3"; - // - // toolStripButton4 - // - this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton4.Image = global::FileWatcher.Properties.Resources.stop; - this.toolStripButton4.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton4.Name = "toolStripButton4"; - this.toolStripButton4.Size = new System.Drawing.Size(23, 22); - this.toolStripButton4.Text = "toolStripButton4"; - // - // FileGroupTab - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.AutoSize = true; - this.Controls.Add(this.splitContainer1); - this.Controls.Add(this.toolStrip); - this.Name = "FileGroupTab"; - this.Size = new System.Drawing.Size(669, 380); - this.toolStrip.ResumeLayout(false); - this.toolStrip.PerformLayout(); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); - this.splitContainer1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.scriptWatcher1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ToolStrip toolStrip; - private System.Windows.Forms.ToolStripButton toolStripButton5; - private System.Windows.Forms.ToolStripButton toolStripButton6; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripLabel toolStripLabel1; - private System.Windows.Forms.ToolStripTextBox FileExtensionsToolBox; - private System.Windows.Forms.ToolStripLabel extensionWarning; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripButton toolStripButton7; - private System.Windows.Forms.ToolStripTextBox scriptPathTextBox; - private System.Windows.Forms.OpenFileDialog openFileDialog1; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private System.Windows.Forms.ToolStripLabel scriptWarning; - private System.Windows.Forms.ToolStripTextBox toolStripTextBox1; - private System.Windows.Forms.ToolStripLabel toolStripLabel2; - private System.Windows.Forms.ToolStripButton toolStripButton2; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.RichTextBox richTextBox1; - private System.IO.FileSystemWatcher scriptWatcher1; - private System.ComponentModel.BackgroundWorker scriptWorker; - private System.Windows.Forms.ToolStripButton scriptMonitorButton; - private System.Windows.Forms.ToolStripLabel delayCountDownLabel; - private System.Windows.Forms.ListBox foldersListBox; - private System.Windows.Forms.ToolStripButton toolStripButton3; - private System.Windows.Forms.ToolStripButton toolStripButton4; - } -} diff --git a/code/src/FileGroupTab.cs b/code/src/FileGroupTab.cs deleted file mode 100644 index 3645681..0000000 --- a/code/src/FileGroupTab.cs +++ /dev/null @@ -1,792 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Drawing; -using System.Data; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Forms; - -using IronPython.Hosting; -using IronPython.Runtime; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; - -using Microsoft.Win32; - -namespace FileWatcher -{ - public partial class FileGroupTab : UserControl - { - /// - /// Used for catching output from the Python runtime - /// - private EventRaisingStreamWriter m_LogStream = null; - private EventRaisingStreamWriter m_ErrorStream = null; - private MemoryStream m_MemoryStream = new MemoryStream(); - private delegate void SetTextCallback(object sender, MyEvtArgs e); - private delegate void SetStringCallback(string e); - - // TODO: Push the updated files to a multiprocessing queue that I create inside of the scope of the script - private ScriptEngine pyEngine = null; - private ScriptRuntime pyRuntime = null; - private ScriptScope pyScope = null; - - BindingList m_FolderList = new BindingList(); - - List m_FileWatchers = new List(); - List m_UpdatedFiles = new List(); - - TimerPlus m_Timer = new TimerPlus(); - System.Timers.Timer m_TickCounter = new System.Timers.Timer(); - - - private FileGroupSettings m_Settings = null; - - private static Regex regexSpaces = new Regex(@"^([a-zA-Z0-9_]*\*?[a-zA-Z0-9_]*(\.(\*|[a-zA-Z0-9]+))\s?)+$"); - - private static Regex regexMS = new Regex(@"^\d+ms$"); - private static Regex regexS = new Regex(@"^\d+s$"); - private static Regex regexM = new Regex(@"^\d+m$"); - private static Regex regexH = new Regex(@"^\d+h$"); - private static Regex regexTime = new Regex(@"^(\d+(ms|s|m|h)\s?)+$"); - - private static Regex regexAbsolutePath = new Regex(@"^[a-zA-Z]\:\\$"); - private static Regex regexNetworkPath = new Regex(@"^\\\\$"); - - public FileGroupTab() - { - InitializeComponent(); - - m_Timer.Enabled = false; - m_Timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Tick); - - m_TickCounter.Enabled = false; - m_TickCounter.Elapsed += new System.Timers.ElapsedEventHandler(timer_TickCountdown); - - if (pyEngine == null) - { - Dictionary options = new Dictionary(); - options["Debug"] = true; - pyEngine = Python.CreateEngine(options); - pyScope = pyEngine.CreateScope(); - - m_LogStream = new EventRaisingStreamWriter(m_MemoryStream); - m_LogStream.StringWritten += new EventHandler>(script_StringWritten); - pyEngine.Runtime.IO.SetOutput(m_MemoryStream, m_LogStream); - - m_ErrorStream = new EventRaisingStreamWriter(m_MemoryStream); - m_ErrorStream.StringWritten += new EventHandler>(script_ErrorStringWritten); - pyEngine.Runtime.IO.SetErrorOutput(m_MemoryStream, m_ErrorStream); - } - foldersListBox.DataSource = m_FolderList; - m_FolderList.ListChanged += new ListChangedEventHandler(foldersListBox_ListChanged); - - toolStripTextBox1_TextChanged(this, null); - } - - public List GetPaths() - { - List paths = new List(); - - foreach (string str in foldersListBox.Items) - { - paths.Add(str); - } - - return paths; - } - - public bool AreExtenionsValid() - { - return regexSpaces.Matches(FileExtensionsToolBox.Text).Count != 0; - } - - public string ExtensionString - { - get { return FileExtensionsToolBox.Text; } - set { FileExtensionsToolBox.Text = value; } - } - - public string[] Extensions - { - get { return FileExtensionsToolBox.Text.Split(' '); } - set { FileExtensionsToolBox.Text = string.Join(" ", value); } - } - - public string ScriptPath - { - get { return scriptPathTextBox.Text; } - set { scriptPathTextBox.Text = value; } - } - - public string GetScriptAbsolutePath() - { - bool match1 = regexAbsolutePath.Matches(ScriptPath).Count > 0; - bool match2 = regexNetworkPath.Matches(ScriptPath).Count > 0; - - if (match1 == false && match2 == false) - { - // Path is not an absolute path, make it one - return Path.GetFullPath(Path.Combine(new FileInfo(Application.ExecutablePath).DirectoryName, ScriptPath)); - } return ScriptPath; - } - - public string Delay - { - get { return toolStripTextBox1.Text; } - set { toolStripTextBox1.Text = value; } - } - - public FileGroupSettings Settings - { - get - { - if (null == m_Settings || m_Settings.IsDisposed) - { - m_Settings = new FileGroupSettings(); - //m_Settings.Text = ""; - } return m_Settings; - } - } - - public List Directories - { - get { return m_FolderList.Cast().ToList(); } - set - { - m_FolderList.Clear(); - - foldersListBox.DataSource = null; - foldersListBox.SelectionMode = SelectionMode.None; - - foreach (string i in value) - m_FolderList.Add(i); - - foldersListBox.DataSource = m_FolderList; - foldersListBox.SelectionMode = SelectionMode.MultiExtended; - } - } - - static public string GetPythonDir() - { - // if you want better debugging information, return the iron python path - String ironPythonDir = "C:\\Program Files (x86)\\IronPython 2.7"; - if (Directory.Exists(ironPythonDir)) - { - return ironPythonDir; - } - - // Use the Libs folder in the local path (and let there be an error if it's not there) - return new FileInfo(Application.ExecutablePath).DirectoryName; - - // Iron Python doesn't seem properly compatible with Python, don't use the Python libs. - /*string[] paths = Environment.GetEnvironmentVariable("PATH").Split(';'); - foreach (string s in paths) - { - if (s.ToLower().IndexOf("python") != -1 && File.Exists(Path.Combine(s, "python.exe"))) - { - return s; - } - } - - return null;*/ - } - - private bool CompileSourceAndExecute() - { - string code = ""; - - string pythonDir = GetPythonDir(); - if (pythonDir == null) - { - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "Could not find your Python path, try adding it to your system PATH and try again."; - - Logger.LogError("Could not find your Python path, try adding it to your system PATH and try again."); - return false; - } - string pythonLibs = Path.Combine(pythonDir, "Lib"); - - if (Directory.Exists(pythonLibs)) - { - code += "import sys" + Environment.NewLine + "if '" + pythonLibs + "' not in sys.path: sys.path.append('" + pythonLibs + "')" + Environment.NewLine; - } - else - { - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "Could not find your Python Lib path in '" + pythonLibs + "'. Good luck."; - - Logger.LogError("Could not find your Python Lib path in '" + pythonLibs + "'. Good luck."); - - return false; - } - - try - { - // TODO: backup list of unprocessed files and move it to the new scope - - // WARNING: for some reason the dependencies that are loaded from the - // previous script do not get reloaded, even though they should be in - // the scope that we're disposing and not in the new scope. Will have - // to consider destroying the Python Engine and recreating that as well. - - pyScope = pyEngine.CreateScope(); - pyEngine.Execute(code.Replace("\\", "\\\\"), pyScope); - pyEngine.ExecuteFile(GetScriptAbsolutePath(),pyScope); - - //ScriptSource source = pyEngine.CreateScriptSourceFromString(code); - // object result = source.Execute(pyScope); - - } - catch (Exception e) - { - if (e is Microsoft.Scripting.SyntaxErrorException) - { - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "There is a syntax error: '" + e.Message + "' on line " + ((Microsoft.Scripting.SyntaxErrorException)e).Line; - - Logger.LogError("There is a syntax error in '" + Path.GetFileName(ScriptPath) + "': " + e.Message + "' on line " + ((Microsoft.Scripting.SyntaxErrorException)e).Line); - return false; - } - else if (e is System.Reflection.TargetInvocationException) - { - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "There is an invokation error: '" + e.Message + "'" + Environment.NewLine + e.StackTrace; - - Logger.LogError("There is an invokation error in '" + Path.GetFileName(ScriptPath) + "': " + e.Message + "'" + Environment.NewLine + e.StackTrace); - return false; - } - else if (e is System.ArgumentException) - { - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "There is an argument error: '" + e.Message + "'" + Environment.NewLine + e.StackTrace; - - Logger.LogError("There is an argument error in '" + Path.GetFileName(ScriptPath) + "': " + e.Message + "'" + Environment.NewLine + e.StackTrace); - return false; - } - else if (e is IronPython.Runtime.Exceptions.ImportException) - { - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "There is an import error: '" + e.Message + "'" + Environment.NewLine + e.StackTrace; - - Logger.LogError("There is an import error in '" + Path.GetFileName(ScriptPath) + "': " + e.Message + "'" + Environment.NewLine + e.StackTrace); - return false; - } - else - { - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "There is an unknown error: '" + e.Message + "'" + Environment.NewLine + e.StackTrace; - - Logger.LogError("There is an unknown error in '" + Path.GetFileName(ScriptPath) + "': " + e.Message + "'" + Environment.NewLine + e.StackTrace); - return false; - } - } - - try - { - Func, bool> updated = pyScope.GetVariable, bool>>("process_updated_files"); - } - catch (System.MissingMemberException) - { - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "The function 'process_updated_files' is missing, it accepts a list of files."; - - Logger.LogError("'" + Path.GetFileName(ScriptPath) + "' is missing the function 'process_updated_files', which accepts a list of files. "); - - return false; - } - - Logger.Log("Loaded and compiled '" + Path.GetFileName(ScriptPath) + "'"); - - SetInterval(); - - return true; - } - - private void toolStripButton5_Click(object sender, EventArgs e) - { - - } - - private void toolStripButton7_Click(object sender, EventArgs e) - { - - } - - public void AddWatchPath(string path ) - { - foldersListBox.DataSource = null; - foldersListBox.SelectionMode = SelectionMode.None; - - m_FolderList.Add(path); - - foldersListBox.DataSource = m_FolderList; - foldersListBox.SelectionMode = SelectionMode.MultiExtended; - } - - public void RemoveWatchPath(string path) - { - foldersListBox.DataSource = null; - foldersListBox.SelectionMode = SelectionMode.None; - - m_FolderList.Remove(path); - - foldersListBox.DataSource = m_FolderList; - foldersListBox.SelectionMode = SelectionMode.MultiExtended; - } - - private void toolStripButton5_Click_1(object sender, EventArgs e) - { - //Form1.s_FolderDialogue.InitialDirectory = Environment.CurrentDirectory; - if (Form1.s_FolderDialogue.ShowDialog()) - { - AddWatchPath(Form1.s_FolderDialogue.FileName); - Form1.Instance.AutoSave(); - } - } - - private void toolStripButton6_Click(object sender, EventArgs e) - { - while (foldersListBox.SelectedItems.Count > 0) - { - RemoveWatchPath((string)foldersListBox.SelectedItems[0]); - } - Form1.Instance.AutoSave(); - } - - private void toolStripButton7_Click_1(object sender, EventArgs e) - { - Process myProcess = new Process(); - - myProcess.StartInfo.FileName = Preferences.Instance.GetDefaultEditor(); //not the full application path - if (String.IsNullOrEmpty(myProcess.StartInfo.FileName)) - { - MessageBox.Show("Your selected default and backup text editors cannot be found, please open up preferences ( Ctrl + P ) and select an editor that can be found on the local computer.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - - // TODO: check if directory is relative or not - myProcess.StartInfo.Arguments = GetScriptAbsolutePath(); - myProcess.Start(); - } - - - private void FileExtensionsToolBox_TextChanged(object sender, EventArgs e) - { - bool isMatch = regexSpaces.IsMatch(FileExtensionsToolBox.Text); - extensionWarning.Visible = isMatch == false; - UpdateFileWatchers(); - } - - private void openFileDialog1_FileOk(object sender, CancelEventArgs e) - { - - } - - private void toolStripButton1_Click(object sender, EventArgs e) - { - // TODO: check if directory is relative or not - openFileDialog1.InitialDirectory = Path.GetDirectoryName(GetScriptAbsolutePath()); - openFileDialog1.FileName = Path.GetFileName(ScriptPath); - if (openFileDialog1.ShowDialog() == DialogResult.OK) - { - scriptPathTextBox.Text = Utils.MakeRelativePath(System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), openFileDialog1.FileName); - LoadScript(); - } - } - - private void toolStripButton2_Click(object sender, EventArgs e) - { - Settings.ShowDialog(this); - } - - public void SetDelayCountDownText(string str) - { - if (toolStrip.InvokeRequired) - { - SetStringCallback d = new SetStringCallback(SetDelayCountDownText); - this.Invoke(d, new object[] { str }); - } - else - { - delayCountDownLabel.Text = str; - } - } - - private void script_StringWritten(object sender, MyEvtArgs e) - { - if (richTextBox1.InvokeRequired) - { - SetTextCallback d = new SetTextCallback(script_StringWritten); - this.Invoke(d, new object[] { sender, e }); - } - else - { - richTextBox1.AppendText(e.Value, Color.Black); - richTextBox1.SelectionStart = richTextBox1.Text.Length; - richTextBox1.ScrollToCaret(); - } - } - - private void script_ErrorStringWritten(object sender, MyEvtArgs e) - { - if (richTextBox1.InvokeRequired) - { - SetTextCallback d = new SetTextCallback(script_ErrorStringWritten); - this.Invoke(d, new object[] { sender, e }); - } - else - { - richTextBox1.AppendText(e.Value, Color.Maroon); - richTextBox1.SelectionStart = richTextBox1.Text.Length; - richTextBox1.ScrollToCaret(); - } - } - - private void fileSystemWatcher1_Changed(object sender, FileSystemEventArgs e) - { - try - { - // DO NOT check to see if equal to directory - if ((File.GetAttributes(e.FullPath) & FileAttributes.Directory) == FileAttributes.Directory) - { - return; - } - } - catch (FileNotFoundException) - { - return; - } - - if (m_Timer.Enabled == false || Settings.restartDelayCB.Checked) - { - m_Timer.Stop(); - m_TickCounter.Stop(); - - m_Timer.Enabled = false; - m_TickCounter.Enabled = false; - SetInterval(); - m_Timer.Enabled = true; - m_TickCounter.Enabled = true; - - m_Timer.Start(); - m_TickCounter.Start(); - } - - if (Settings.stopScriptCB.Checked) - { - scriptWorker.CancelAsync(); - } - - // TODO: check to see if the path is relative or absolute - string fullPath = Path.Combine(new FileInfo(Application.ExecutablePath).DirectoryName, e.FullPath); - - if (false == m_UpdatedFiles.Contains(fullPath)) - { - m_UpdatedFiles.Add(fullPath); - } - } - - private void scriptPathTextBox_TextChanged(object sender, EventArgs e) - { - LoadScript(); - } - - void UpdateFileWatchers() - { - if (false == AreExtenionsValid()) - { - return; - } - foreach (FileSystemWatcher fsw in m_FileWatchers) - { - fsw.Dispose(); - } - m_FileWatchers.Clear(); - foreach (string s in Directories) - { - string path = Path.Combine(new FileInfo(Application.ExecutablePath).DirectoryName, s); - foreach (string ext in Extensions) - { - if (false == Directory.Exists(path)) continue; - - FileSystemWatcher fileWatcher = new FileSystemWatcher(); - - // TODO: check to see if the path is relative - fileWatcher.Path = path; - - fileWatcher.Filter = ext; - - fileWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName; - - fileWatcher.Created += fileSystemWatcher1_Changed; - fileWatcher.Changed += fileSystemWatcher1_Changed; - fileWatcher.Renamed += fileSystemWatcher1_Changed; - fileWatcher.Deleted += fileSystemWatcher1_Changed; - - // TODO: handle deleted files differently - - fileWatcher.EnableRaisingEvents = true; - fileWatcher.IncludeSubdirectories = true; - - m_FileWatchers.Add(fileWatcher); - } - } - } - - void foldersListBox_ListChanged(object sender, ListChangedEventArgs e) - { - switch (e.ListChangedType) - { - case ListChangedType.ItemMoved: - case ListChangedType.ItemAdded: - case ListChangedType.ItemChanged: - case ListChangedType.ItemDeleted: - UpdateFileWatchers(); - break; - } - } - - private void timer_Tick(object sender, EventArgs e) - { - SetDelayCountDownText("--ms"); - m_Timer.Stop(); - m_Timer.Enabled = false; - m_TickCounter.Stop(); - m_TickCounter.Enabled = false; - - - Form1.Instance.notifyIcon1.ShowBalloonTip(1000, "Script Running", "Running '" + ScriptPath + "'", ToolTipIcon.Info); - - //scriptWorker.RunWorkerAsync(m_UpdatedFiles); - - // run script in separate thread - Func, bool> updated = pyScope.GetVariable, bool>>("process_updated_files"); - - try - { - var updateFiles = m_UpdatedFiles; - m_UpdatedFiles.Clear(); - - updated(updateFiles); - - Logger.Log("Just finished running '" + ScriptPath + "'"); - - Form1.Instance.notifyIcon1.ShowBalloonTip(500, "Script Ran", "Finished running '" + ScriptPath + "'", ToolTipIcon.Info); - } - catch (System.Exception ex) - { - Logger.LogError("'" + ScriptPath + "' finished running with errors"); - - Form1.Instance.notifyIcon1.ShowBalloonTip(500, "Script Error", "'" + ScriptPath + "' finished running with errors", ToolTipIcon.Error); - - if (ex is IronPython.Runtime.Exceptions.ImportException) - { - Logger.Log("Import exception in '" + ScriptPath + "':" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.TargetSite); - } - else if (ex is System.MissingMemberException) - { - Logger.Log("Missing member exception in '" + ScriptPath + "':" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.TargetSite); - } - else if (ex is System.IO.DirectoryNotFoundException) - { - Logger.Log("Directory not found exception in '" + ScriptPath + "':" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.TargetSite); - } - else if (ex is System.ArgumentException) - { - Logger.Log("Directory not found exception in '" + ScriptPath + "':" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.TargetSite); - } - else - { - Logger.Log("Error running '" + ScriptPath + "':" + ex.Message + Environment.NewLine + ex.StackTrace); - } - } - - SetInterval(); - } - - private void timer_TickCountdown(object sender, EventArgs e) - { - string time_elapsed = ""; - - const double one_hour_to_ms = 3600000; - const double one_minute_to_ms = 60000; - const double one_second_to_ms = 1000.0; - - double ms = m_Timer.TimeRemaining.TotalMilliseconds; - - int hours = 0; - while (ms > one_hour_to_ms) - { - ms -= one_hour_to_ms; - ++hours; - } - - int minutes = 0; - while (ms > one_minute_to_ms) - { - ms -= one_minute_to_ms; - ++minutes; - } - - int seconds = 0; - while (ms > one_second_to_ms) - { - ms -= one_second_to_ms; - ++seconds; - } - - // round up - if (ms > 0) - { - ++seconds; - } - - if (hours > 0) - { - time_elapsed += hours + "h"; - } - - if (minutes > 0) - { - time_elapsed += (time_elapsed.Length > 0 ? " " : "") + minutes + "m"; - } - - if (seconds > 0) - { - time_elapsed += (time_elapsed.Length > 0 ? " " : "") + seconds + "s"; - } - - SetDelayCountDownText(time_elapsed); - } - - bool SetInterval() - { - // disable timer before setting interval - if (m_Timer.Enabled) return false; - - bool matches = regexTime.IsMatch(toolStripTextBox1.Text); - toolStripLabel2.Visible = matches == false; - toolStripLabel2.ToolTipText = "Invalid delay"; - - if (matches) - { - int interval = 0; - - string[] values = toolStripTextBox1.Text.Split(' '); - foreach (string val in values) - { - if (val.Length == 0) continue; - - if (regexMS.IsMatch(val)) - { - interval += Convert.ToInt32(Regex.Match(val, @"\d+").Value); - } - else if (regexS.IsMatch(val)) - { - interval += Convert.ToInt32(Regex.Match(val, @"\d+").Value) * 1000; - } - else if (regexM.IsMatch(val)) - { - interval += Convert.ToInt32(Regex.Match(val, @"\d+").Value) * 1000 * 60; - } - else if (regexH.IsMatch(val)) - { - interval += Convert.ToInt32(Regex.Match(val, @"\d+").Value) * 1000 * 60 * 24; - } - else - { - throw new Exception("Unexpected format"); - } - } - - if (interval != 0) - { - m_Timer.Interval = interval; - m_TickCounter.Interval = 1000; - return true; - } - - toolStripLabel2.Visible = true; - toolStripLabel2.ToolTipText = "Cannot have a value of 0"; - } - return false; - } - - private void toolStripTextBox1_TextChanged(object sender, EventArgs e) - { - SetInterval(); - } - - public void ToggleScriptUpdate(bool enabled) - { - if (enabled) - { - scriptMonitorButton.Image = Properties.Resources.drop_box; - scriptMonitorButton.Enabled = true; - scriptMonitorButton.ToolTipText = "Script updated, press to reload it"; - } - else - { - scriptMonitorButton.Image = Properties.Resources.block; - scriptMonitorButton.Enabled = false; - scriptMonitorButton.ToolTipText = "Script Monitor (when script is updated check here to reload script)"; - } - } - - public bool LoadScript() - { - ToggleScriptUpdate(false); - - string absolutePath = GetScriptAbsolutePath(); - - if ( false == File.Exists(absolutePath)) - { - scriptWatcher1.EnableRaisingEvents = false; - - scriptWarning.Visible = true; - scriptWarning.ToolTipText = "The source file '" + absolutePath + "' could not be found."; - - Logger.Log("The source file '" + absolutePath + "' could not be found."); - - return false; - } - - scriptWatcher1.Path = new FileInfo(absolutePath).DirectoryName; - scriptWatcher1.Filter = Path.GetFileName(absolutePath); - scriptWatcher1.Changed += scriptWatcher1_Changed; - scriptWatcher1.EnableRaisingEvents = true; - - if (false == CompileSourceAndExecute()) - { - return false; - } - - scriptWarning.Visible = false; - scriptWarning.ToolTipText = ""; - return true; - } - - private void scriptWatcher1_Changed(object sender, FileSystemEventArgs e) - { - // script updated - ToggleScriptUpdate(true); - } - - private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) - { - - } - - private void scriptMonitorButton_Click(object sender, EventArgs e) - { - LoadScript(); - } - } -} diff --git a/code/src/FileGroupTab.resx b/code/src/FileGroupTab.resx deleted file mode 100644 index 28a4c57..0000000 --- a/code/src/FileGroupTab.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - 157, 17 - - - 297, 17 - - - 430, 17 - - \ No newline at end of file diff --git a/code/src/FilePath.cs b/code/src/FilePath.cs deleted file mode 100644 index cc45a3b..0000000 --- a/code/src/FilePath.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace FileWatcher -{ - class FilePath - { - protected string m_RelativePath; - protected string m_AbsolutePath; - - protected bool m_IsRelative; - - private static Regex regexAbsolutePath = new Regex(@"^[a-zA-Z]\:\\$"); - private static Regex regexNetworkPath = new Regex(@"^\\\\$"); - - FilePath(string path) - { - bool match1 = regexAbsolutePath.Matches(path).Count > 0; - bool match2 = regexNetworkPath.Matches(path).Count > 0; - - if (match1 == false && match2 == false) - { - // Path is not an absolute path - m_RelativePath = path; - m_AbsolutePath = System.IO.Path.GetFullPath(System.IO.Path.Combine(new System.IO.FileInfo(Application.ExecutablePath).DirectoryName, path)); - - m_IsRelative = true; - } - else - { - m_RelativePath = Utils.MakeRelativePath(System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), path); - m_AbsolutePath = path; - - m_IsRelative = false; - } - } - - - public string AbsolutePath - { - get { return m_AbsolutePath; } - } - - public string RelativePath - { - get { return m_RelativePath; } - } - - public bool IsRelative - { - get { return m_IsRelative; } - } - } -} diff --git a/code/src/FolderSelectDialog.cs b/code/src/FolderSelectDialog.cs deleted file mode 100644 index f23e2fd..0000000 --- a/code/src/FolderSelectDialog.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.Windows.Forms; - -// ------------------------------------------------------------------ -// Wraps System.Windows.Forms.OpenFileDialog to make it present -// a vista-style dialog. -// ------------------------------------------------------------------ - -namespace FolderSelect -{ - /// - /// Wraps System.Windows.Forms.OpenFileDialog to make it present - /// a vista-style dialog. - /// - public class FolderSelectDialog : IDisposable - { - // Wrapped dialog - System.Windows.Forms.OpenFileDialog ofd = null; - - /// - /// Default constructor - /// - public FolderSelectDialog() - { - ofd = new System.Windows.Forms.OpenFileDialog(); - - ofd.Filter = "Folders|\n"; - ofd.AddExtension = false; - ofd.CheckFileExists = false; - ofd.DereferenceLinks = true; - ofd.Multiselect = false; - } - - ~FolderSelectDialog() - { - Dispose(false); - } - - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - ofd.Dispose(); - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - #region Properties - - /// - /// Gets/Sets the initial folder to be selected. A null value selects the current directory. - /// - public string InitialDirectory - { - get { return ofd.InitialDirectory; } - set { ofd.InitialDirectory = value == null || value.Length == 0 ? Environment.CurrentDirectory : value; } - } - - /// - /// Gets/Sets the title to show in the dialog - /// - public string Title - { - get { return ofd.Title; } - set { ofd.Title = value == null ? "Select a folder" : value; } - } - - /// - /// Gets the selected folder - /// - public string FileName - { - get { return ofd.FileName; } - } - - #endregion - - #region Methods - - /// - /// Shows the dialog - /// - /// True if the user presses OK else false - public bool ShowDialog() - { - return ShowDialog(IntPtr.Zero); - } - - /// - /// Shows the dialog - /// - /// Handle of the control to be parent - /// True if the user presses OK else false - public bool ShowDialog(IntPtr hWndOwner) - { - bool flag = false; - - if (Environment.OSVersion.Version.Major >= 6) - { - var r = new Reflector("System.Windows.Forms"); - - uint num = 0; - Type typeIFileDialog = r.GetType("FileDialogNative.IFileDialog"); - object dialog = r.Call(ofd, "CreateVistaDialog"); - r.Call(ofd, "OnBeforeVistaDialog", dialog); - - uint options = (uint)r.CallAs(typeof(System.Windows.Forms.FileDialog), ofd, "GetOptions"); - options |= (uint)r.GetEnum("FileDialogNative.FOS", "FOS_PICKFOLDERS"); - r.CallAs(typeIFileDialog, dialog, "SetOptions", options); - - object pfde = r.New("FileDialog.VistaDialogEvents", ofd); - object[] parameters = new object[] { pfde, num }; - r.CallAs2(typeIFileDialog, dialog, "Advise", parameters); - num = (uint)parameters[1]; - try - { - int num2 = (int)r.CallAs(typeIFileDialog, dialog, "Show", hWndOwner); - flag = 0 == num2; - } - finally - { - r.CallAs(typeIFileDialog, dialog, "Unadvise", num); - GC.KeepAlive(pfde); - } - } - else - { - var fbd = new FolderBrowserDialog(); - fbd.Description = this.Title; - fbd.SelectedPath = this.InitialDirectory; - fbd.ShowNewFolderButton = false; - if (fbd.ShowDialog(new WindowWrapper(hWndOwner)) != DialogResult.OK) return false; - ofd.FileName = fbd.SelectedPath; - flag = true; - } - - return flag; - } - - #endregion - } - - /// - /// Creates IWin32Window around an IntPtr - /// - public class WindowWrapper : System.Windows.Forms.IWin32Window - { - /// - /// Constructor - /// - /// Handle to wrap - public WindowWrapper(IntPtr handle) - { - _hwnd = handle; - } - - /// - /// Original ptr - /// - public IntPtr Handle - { - get { return _hwnd; } - } - - private IntPtr _hwnd; - } - -} diff --git a/code/src/Form1.Designer.cs b/code/src/Form1.Designer.cs deleted file mode 100644 index 542bbe1..0000000 --- a/code/src/Form1.Designer.cs +++ /dev/null @@ -1,480 +0,0 @@ -namespace FileWatcher -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.hideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.foldersListBox = new System.Windows.Forms.ListBox(); - this.toolStrip3 = new System.Windows.Forms.ToolStrip(); - this.toolStripButton5 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton6 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); - this.FileExtensionsToolBox = new System.Windows.Forms.ToolStripTextBox(); - this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButton7 = new System.Windows.Forms.ToolStripButton(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); - this.textBox2 = new System.Windows.Forms.RichTextBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); - this.trayContextStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.exit = new System.Windows.Forms.ToolStripMenuItem(); - this.directoryEntry1 = new System.DirectoryServices.DirectoryEntry(); - this.menuStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.toolStrip3.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.trayContextStrip.SuspendLayout(); - this.SuspendLayout(); - // - // menuStrip1 - // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.helpToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(588, 24); - this.menuStrip1.TabIndex = 0; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.saveToolStripMenuItem, - this.toolStripSeparator5, - this.preferencesToolStripMenuItem, - this.toolStripSeparator3, - this.hideToolStripMenuItem, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "File"; - // - // saveToolStripMenuItem - // - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(176, 22); - this.saveToolStripMenuItem.Text = "Save"; - this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(173, 6); - // - // preferencesToolStripMenuItem - // - this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem"; - this.preferencesToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); - this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(176, 22); - this.preferencesToolStripMenuItem.Text = "Preferences"; - this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.preferencesToolStripMenuItem_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(173, 6); - // - // hideToolStripMenuItem - // - this.hideToolStripMenuItem.Name = "hideToolStripMenuItem"; - this.hideToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.H))); - this.hideToolStripMenuItem.Size = new System.Drawing.Size(176, 22); - this.hideToolStripMenuItem.Text = "Hide"; - this.hideToolStripMenuItem.ToolTipText = "Or use Escape to hide the window."; - this.hideToolStripMenuItem.Click += new System.EventHandler(this.hideToolStripMenuItem_Click); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); - this.exitToolStripMenuItem.Size = new System.Drawing.Size(176, 22); - this.exitToolStripMenuItem.Text = "Exit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "Help"; - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22); - this.aboutToolStripMenuItem.Text = "About"; - this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); - // - // statusStrip1 - // - this.statusStrip1.Location = new System.Drawing.Point(0, 471); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(588, 22); - this.statusStrip1.TabIndex = 1; - this.statusStrip1.Text = "statusStrip1"; - // - // splitContainer1 - // - this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 24); - this.splitContainer1.Name = "splitContainer1"; - this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.tabControl1); - this.splitContainer1.Panel1.Controls.Add(this.toolStrip1); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.ControlDarkDark; - this.splitContainer1.Panel2.Controls.Add(this.textBox2); - this.splitContainer1.Panel2.Controls.Add(this.textBox1); - this.splitContainer1.Panel2.ForeColor = System.Drawing.SystemColors.GradientInactiveCaption; - this.splitContainer1.Size = new System.Drawing.Size(588, 447); - this.splitContainer1.SplitterDistance = 340; - this.splitContainer1.TabIndex = 3; - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(0, 25); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(586, 313); - this.tabControl1.TabIndex = 2; - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.foldersListBox); - this.tabPage1.Controls.Add(this.toolStrip3); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(578, 287); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "tabPage1"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // foldersListBox - // - this.foldersListBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.foldersListBox.FormattingEnabled = true; - this.foldersListBox.Location = new System.Drawing.Point(3, 28); - this.foldersListBox.Name = "foldersListBox"; - this.foldersListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; - this.foldersListBox.Size = new System.Drawing.Size(572, 256); - this.foldersListBox.TabIndex = 1; - // - // toolStrip3 - // - this.toolStrip3.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton5, - this.toolStripButton6, - this.toolStripSeparator1, - this.toolStripLabel1, - this.FileExtensionsToolBox, - this.toolStripLabel2, - this.toolStripSeparator2, - this.toolStripButton7}); - this.toolStrip3.Location = new System.Drawing.Point(3, 3); - this.toolStrip3.Name = "toolStrip3"; - this.toolStrip3.Size = new System.Drawing.Size(572, 25); - this.toolStrip3.TabIndex = 0; - this.toolStrip3.Text = "toolStrip3"; - // - // toolStripButton5 - // - this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton5.Image = global::FileWatcher.Properties.Resources.plus; - this.toolStripButton5.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton5.Name = "toolStripButton5"; - this.toolStripButton5.Size = new System.Drawing.Size(23, 22); - this.toolStripButton5.Text = "toolStripButton5"; - // - // toolStripButton6 - // - this.toolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton6.Image = global::FileWatcher.Properties.Resources.cross; - this.toolStripButton6.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton6.Name = "toolStripButton6"; - this.toolStripButton6.Size = new System.Drawing.Size(23, 22); - this.toolStripButton6.Text = "toolStripButton6"; - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); - // - // toolStripLabel1 - // - this.toolStripLabel1.Name = "toolStripLabel1"; - this.toolStripLabel1.Size = new System.Drawing.Size(86, 22); - this.toolStripLabel1.Text = "File Extensions:"; - // - // FileExtensionsToolBox - // - this.FileExtensionsToolBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.FileExtensionsToolBox.Name = "FileExtensionsToolBox"; - this.FileExtensionsToolBox.Size = new System.Drawing.Size(100, 25); - // - // toolStripLabel2 - // - this.toolStripLabel2.Image = global::FileWatcher.Properties.Resources.warning; - this.toolStripLabel2.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripLabel2.Margin = new System.Windows.Forms.Padding(2, 1, 2, 2); - this.toolStripLabel2.Name = "toolStripLabel2"; - this.toolStripLabel2.Size = new System.Drawing.Size(10, 22); - this.toolStripLabel2.ToolTipText = "Invalid File Extension/s"; - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); - // - // toolStripButton7 - // - this.toolStripButton7.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton7.Image = global::FileWatcher.Properties.Resources.script; - this.toolStripButton7.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton7.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton7.Name = "toolStripButton7"; - this.toolStripButton7.Size = new System.Drawing.Size(23, 22); - this.toolStripButton7.Text = "toolStripButton7"; - // - // toolStrip1 - // - this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton1, - this.toolStripSeparator4, - this.toolStripButton3, - this.toolStripButton4, - this.toolStripSeparator6}); - this.toolStrip1.Location = new System.Drawing.Point(0, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(586, 25); - this.toolStrip1.TabIndex = 1; - this.toolStrip1.Text = "toolStrip1"; - // - // toolStripButton1 - // - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Image = global::FileWatcher.Properties.Resources.save; - this.toolStripButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(23, 22); - this.toolStripButton1.Text = "toolStripButton1"; - this.toolStripButton1.ToolTipText = "Save your current settings."; - this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25); - // - // toolStripButton3 - // - this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton3.Image = global::FileWatcher.Properties.Resources.plus; - this.toolStripButton3.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(23, 22); - this.toolStripButton3.Text = "New File Group"; - this.toolStripButton3.ToolTipText = "Create File Group"; - this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click_1); - // - // toolStripButton4 - // - this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton4.Image = global::FileWatcher.Properties.Resources.cross; - this.toolStripButton4.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton4.Name = "toolStripButton4"; - this.toolStripButton4.Size = new System.Drawing.Size(23, 22); - this.toolStripButton4.Text = "Delete File Group"; - this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click); - // - // toolStripSeparator6 - // - this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(6, 25); - // - // textBox2 - // - this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.textBox2.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox2.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.textBox2.Location = new System.Drawing.Point(0, 0); - this.textBox2.Name = "textBox2"; - this.textBox2.ReadOnly = true; - this.textBox2.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; - this.textBox2.Size = new System.Drawing.Size(586, 78); - this.textBox2.TabIndex = 1; - this.textBox2.Text = ""; - // - // textBox1 - // - this.textBox1.BackColor = System.Drawing.SystemColors.Window; - this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.textBox1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.textBox1.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.textBox1.Location = new System.Drawing.Point(0, 78); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(586, 23); - this.textBox1.TabIndex = 0; - this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); - this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); - // - // notifyIcon1 - // - this.notifyIcon1.ContextMenuStrip = this.trayContextStrip; - this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); - this.notifyIcon1.Text = "FileWatcher"; - this.notifyIcon1.Visible = true; - this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick); - // - // trayContextStrip - // - this.trayContextStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.exit}); - this.trayContextStrip.Name = "trayContextStrip"; - this.trayContextStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.trayContextStrip.Size = new System.Drawing.Size(93, 26); - this.trayContextStrip.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); - // - // exit - // - this.exit.Name = "exit"; - this.exit.Size = new System.Drawing.Size(92, 22); - this.exit.Text = "Exit"; - this.exit.Click += new System.EventHandler(this.toolStripMenuItem1_Click); - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(588, 493); - this.Controls.Add(this.splitContainer1); - this.Controls.Add(this.statusStrip1); - this.Controls.Add(this.menuStrip1); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.KeyPreview = true; - this.MainMenuStrip = this.menuStrip1; - this.Name = "Form1"; - this.Text = "FileWatcher"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); - this.Load += new System.EventHandler(this.Form1_Load); - this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form1_KeyPress); - this.Resize += new System.EventHandler(this.Form1_Resize); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel1.PerformLayout(); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.Panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); - this.splitContainer1.ResumeLayout(false); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.tabPage1.PerformLayout(); - this.toolStrip3.ResumeLayout(false); - this.toolStrip3.PerformLayout(); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.trayContextStrip.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem hideToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; - private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.SplitContainer splitContainer1; - public System.Windows.Forms.NotifyIcon notifyIcon1; - private System.Windows.Forms.ContextMenuStrip trayContextStrip; - private System.Windows.Forms.ToolStripMenuItem exit; - private System.DirectoryServices.DirectoryEntry directoryEntry1; - private System.Windows.Forms.ToolStripMenuItem preferencesToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ToolStripButton toolStripButton3; - private System.Windows.Forms.ToolStripButton toolStripButton4; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; - private System.Windows.Forms.ListBox foldersListBox; - private System.Windows.Forms.ToolStrip toolStrip3; - private System.Windows.Forms.ToolStripButton toolStripButton5; - private System.Windows.Forms.ToolStripButton toolStripButton6; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripLabel toolStripLabel1; - private System.Windows.Forms.ToolStripTextBox FileExtensionsToolBox; - private System.Windows.Forms.ToolStripLabel toolStripLabel2; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripButton toolStripButton7; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; - public System.Windows.Forms.RichTextBox textBox2; - } -} - diff --git a/code/src/Form1.cs b/code/src/Form1.cs deleted file mode 100644 index 9e71010..0000000 --- a/code/src/Form1.cs +++ /dev/null @@ -1,857 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Xml; - -using IronPython.Hosting; -using IronPython.Runtime; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; - -using FolderSelect; - -namespace FileWatcher -{ - public sealed partial class Form1 : Form - { - public static FolderSelectDialog s_FolderDialogue = null; - public About m_About = null; - public NewFileGroup m_NewFileGroup = null; - - public TabPage m_TabPageReference = null; - - private ScriptEngine pyEngine = null; - private ScriptScope pyScope = null; - - private EventRaisingStreamWriter m_LogStream = null; - private EventRaisingStreamWriter m_ErrorStream = null; - private MemoryStream m_MemoryStream = new MemoryStream(); - - private delegate void SetTextCallback(object sender, MyEvtArgs e); - - private List CommandHistory = new List(); - private int MaxCommandHistorySize; - private int CurrentCommandHistoryItem; - - - private static bool m_ReallyClose; - - // Better folder dialogue - // http://www.etcoding.com/post/2012/01/03/Better-folder-browser-dialog-in-WinForms - // Or just use this reflector hack: - // http://www.lyquidity.com/devblog/?p=136 - - #region Singleton - - private static readonly Form1 instance = new Form1(); - - static Form1() - { - } - - public static Form1 Instance - { - get - { - return instance; - } - } - #endregion - - private Form1() - { - pyEngine = Python.CreateEngine(); - - // Adding these search paths, besides Lib, fixed IronPython import exceptions. Code may run a little faster now. - var paths = pyEngine.GetSearchPaths(); - paths.Clear(); - paths.Add(FileGroupTab.GetPythonDir()); - paths.Add(Path.Combine(FileGroupTab.GetPythonDir(), "DLLs")); - paths.Add(Path.Combine(FileGroupTab.GetPythonDir(), "Lib")); - paths.Add(Path.Combine(FileGroupTab.GetPythonDir(), "Lib", "site-packages")); - paths.Add(Path.GetDirectoryName(GetType().Assembly.Location)); - pyEngine.SetSearchPaths(paths); - - pyEngine.Runtime.LoadAssembly(Assembly.GetAssembly(typeof(FileWatcher.Form1))); - - pyScope = pyEngine.CreateScope(); - - m_LogStream = new EventRaisingStreamWriter(m_MemoryStream); - m_LogStream.StringWritten += new EventHandler>(script_StringWritten); - pyEngine.Runtime.IO.SetOutput(m_MemoryStream, m_LogStream); - - m_ErrorStream = new EventRaisingStreamWriter(m_MemoryStream); - m_ErrorStream.StringWritten += new EventHandler>(script_ErrorStringWritten); - pyEngine.Runtime.IO.SetErrorOutput(m_MemoryStream, m_ErrorStream); - - /*string pythonDir = FileGroupTab.GetPythonDir(); - if (pythonDir != null) - { - string pythonLibs = Path.Combine(pythonDir, "Lib"); - - if (Directory.Exists(pythonLibs)) - { - //string import = "import sys" + Environment.NewLine + "sys.path.append('" + pythonLibs + "')" + Environment.NewLine; - //string import = "import clr" + Environment.NewLine; - - //import += "clr.AddReference('StdLib')" + Environment.NewLine; - - import += "clr.AddReference('IronPython')" + Environment.NewLine; - import += "clr.AddReference('IronPython.Modules')" + Environment.NewLine; - import += "clr.AddReference('Microsoft.Scripting.Metadata')" + Environment.NewLine; - import += "clr.AddReference('Microsoft.Scripting')" + Environment.NewLine; - import += "clr.AddReference('Microsoft.Dynamic')" + Environment.NewLine; - import += "clr.AddReference('mscorlib')" + Environment.NewLine; - import += "clr.AddReference('System')" + Environment.NewLine; - import += "clr.AddReference('System.Data')" + Environment.NewLine; - - - ScriptSource source = pyEngine.CreateScriptSourceFromString(import, SourceCodeKind.AutoDetect); - object result = source.Execute(pyScope); - } - }*/ - - InitializeComponent(); - - s_FolderDialogue = new FolderSelectDialog(); - s_FolderDialogue.Title = "Select a folder"; - s_FolderDialogue.InitialDirectory = @"c:\"; - - m_ReallyClose = false; - - Title = ""; - - LoadFileGroups(); - - if (Program.Args.ContainsKey("--minimize") || Program.Args.ContainsKey("-m")) - { - WindowState = FormWindowState.Minimized; - Form1_Resize(this, null); - } - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - SetTrayIcon(); - - #if DEBUG - System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly(); - string[] names = a.GetManifestResourceNames(); - foreach (string name in names) - System.Console.WriteLine(name); - #endif - } - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) components.Dispose(); - - if (m_LogStream != null) m_LogStream.Dispose(); - - if (m_ErrorStream != null) m_ErrorStream.Dispose(); - - if (m_MemoryStream != null) m_MemoryStream.Dispose(); - } - base.Dispose(disposing); - } - - public static string ApplicationName - { - get { return "FileWatcher"; } - } - - public string Title - { - get { return Text; } - set { Text = value.Length > 0 ? ApplicationName + " - " + value : ApplicationName; } - } - - public static void Quit() - { - Application.Exit(); - } - - - public void Save() - { - XmlDocument xmlDoc = new XmlDocument(); - - XmlNode xmlnode = xmlDoc.CreateNode(XmlNodeType.XmlDeclaration, "", ""); - xmlDoc.AppendChild(xmlnode); - - XmlElement root; - XmlElement xmlelem1; - XmlElement xmlelem2; - XmlElement xmlelem3; - XmlElement xmlelem4; - - root = xmlDoc.CreateElement("", "root", ""); - xmlDoc.AppendChild(root); - - xmlelem1 = xmlDoc.CreateElement("", "groups", ""); - root.AppendChild(xmlelem1); - - foreach (TabPage tabPage in tabControl1.TabPages) - { - xmlelem2 = xmlDoc.CreateElement("", "group", ""); - xmlelem2.SetAttribute("name", tabPage.Text); - xmlelem1.AppendChild(xmlelem2); - - xmlelem3 = xmlDoc.CreateElement("", "directories", ""); - xmlelem2.AppendChild(xmlelem3); - - FileGroupTab fileGroup = null; - - foreach (FileGroupTab fg in tabPage.Controls) - { - fileGroup = fg; - } - - if (fileGroup != null) - { - foreach (string str in fileGroup.GetPaths()) - { - xmlelem4 = xmlDoc.CreateElement("", "directory", ""); - xmlelem4.SetAttribute("path", str); - xmlelem3.AppendChild(xmlelem4); - } - - xmlelem3 = xmlDoc.CreateElement("", "extensions", ""); - xmlelem3.SetAttribute("value", fileGroup.ExtensionString); - xmlelem2.AppendChild(xmlelem3); - - xmlelem3 = xmlDoc.CreateElement("", "script", ""); - xmlelem3.SetAttribute("path", fileGroup.ScriptPath); - xmlelem2.AppendChild(xmlelem3); - - xmlelem3 = xmlDoc.CreateElement("", "delay", ""); - xmlelem3.SetAttribute("value", fileGroup.Delay); - xmlelem2.AppendChild(xmlelem3); - - if (fileGroup.Settings.relativeScriptCB.Checked) - { - xmlelem3 = xmlDoc.CreateElement("", "relativeScriptPath", ""); - xmlelem2.AppendChild(xmlelem3); - } - - if (fileGroup.Settings.stopScriptCB.Checked) - { - xmlelem3 = xmlDoc.CreateElement("", "stopScriptWhenFileUpdated", ""); - xmlelem2.AppendChild(xmlelem3); - } - - if (fileGroup.Settings.restartDelayCB.Checked) - { - xmlelem3 = xmlDoc.CreateElement("", "restartDelayTimerWhenFileUpdated", ""); - xmlelem2.AppendChild(xmlelem3); - } - } - } - - xmlelem1 = xmlDoc.CreateElement("", "preferences", ""); - root.AppendChild(xmlelem1); - - if (Preferences.Instance.autoSaveCB.Checked) - { - xmlelem2 = xmlDoc.CreateElement("", "autosave", ""); - xmlelem1.AppendChild(xmlelem2); - } - - xmlelem2 = xmlDoc.CreateElement("", "editor", ""); - xmlelem1.AppendChild(xmlelem2); - - xmlelem3 = xmlDoc.CreateElement("", "defaults", ""); - xmlelem2.AppendChild(xmlelem3); - - foreach (string str in Preferences.Instance.GetDefaultPrograms()) - { - xmlelem4 = xmlDoc.CreateElement("", "default", ""); - xmlelem4.SetAttribute("name", str); - xmlelem3.AppendChild(xmlelem4); - } - - xmlelem3 = xmlDoc.CreateElement("", "programs", ""); - xmlelem2.AppendChild(xmlelem3); - - foreach (Tuple tuple in Preferences.Instance.GetEditorProgramPaths()) - { - xmlelem4 = xmlDoc.CreateElement("", "program", ""); - xmlelem4.SetAttribute("name", tuple.Item1); - xmlelem4.SetAttribute("path", tuple.Item2); - xmlelem3.AppendChild(xmlelem4); - } - - xmlDoc.Save(Path.Combine(new FileInfo(Application.ExecutablePath).DirectoryName, "settings.xml")); - - Logger.Log("Saved settings.xml"); - } - - public void AutoSave() - { - if (Preferences.Instance.autoSaveCB.Checked) - { - Save(); - } - } - - public void SetTrayIcon() - { - if (WindowState == FormWindowState.Minimized) - { - notifyIcon1.Icon = new Icon(GetType().Module.Assembly.GetManifestResourceStream("FileWatcher.res.stock_3d-texture-spherical_16x16.ico")); - - } - else - { - notifyIcon1.Icon = new Icon(GetType().Module.Assembly.GetManifestResourceStream("FileWatcher.res.stock_3d-texture-and-shading_16x16.ico")); - } - } - - public void LoadFileGroups() - { - if ( null == m_TabPageReference ) - { - m_TabPageReference = tabPage1; - - tabControl1.TabPages.Remove(tabPage1); - } - } - - public void NewFileGroup() - { - - } - - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) - { - if (keyData == (Keys.Control | Keys.E)) - { - //tabControl1.SelectedTab.Controls. - //return true; - } - return base.ProcessCmdKey(ref msg, keyData); - } - - private void aboutToolStripMenuItem_Click(object sender, EventArgs e) - { - if (null == m_About || m_About.IsDisposed) - { - m_About = new About(); - } - m_About.ShowDialog(this); - } - - private void preferencesToolStripMenuItem_Click(object sender, EventArgs e) - { - Preferences.Instance.ShowDialog(this); - } - - private void toolStripButton3_Click(object sender, EventArgs e) - { - if (null == m_NewFileGroup || m_NewFileGroup.IsDisposed) - { - m_NewFileGroup = new NewFileGroup(); - } - - while (true) - { - DialogResult result = m_NewFileGroup.ShowDialog(this); - if (result == DialogResult.OK) - { - String groupName = m_NewFileGroup.GetFileGroupName(); - String groupExtensions = m_NewFileGroup.GetFileGroupExtensions(); - String scriptName = m_NewFileGroup.GetFileGroupScript(); - - foreach (TabPage page in tabControl1.TabPages) - { - if (page.Name == groupName) - { - continue; - } - } - - TabPage tp = new TabPage(); - tp.Text = groupName; - - tabControl1.SuspendLayout(); - tabControl1.TabPages.Add(tp); - tabControl1.ResumeLayout(); - - FileGroupTab groupTab = new FileGroupTab(); - - groupTab.ExtensionString = groupExtensions; - groupTab.ScriptPath = scriptName; - - tp.SuspendLayout(); - tp.Controls.Add(groupTab); - groupTab.Dock = DockStyle.Fill; - tp.ResumeLayout(); - break; - } - else - { - break; - } - } - } - - private void toolStripButton5_Click(object sender, EventArgs e) - { - - } - - private void fileSystemWatcher1_Changed(object sender, System.IO.FileSystemEventArgs e) - { - - } - - private void folderBrowserDialog1_HelpRequest(object sender, EventArgs e) - { - - } - - private void listView1_SelectedIndexChanged(object sender, EventArgs e) - { - - } - - private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) - { - Show(); - WindowState = FormWindowState.Normal; - SetTrayIcon(); - Activate(); - } - - private void Form1_Load(object sender, EventArgs e) - { - //global::FileWatcher.Properties.Resources - - XmlDocument xmlDoc = new XmlDocument(); - try - { - xmlDoc.Load(Path.Combine(new FileInfo(Application.ExecutablePath).DirectoryName, "settings.xml")); - } - catch (System.IO.FileNotFoundException) - { - Save(); - return; - } - catch (XmlException exc) - { - Console.WriteLine(exc.Message); - MessageBox.Show("There is an error in your settings.xml: " + exc.Message, "XML Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - Save(); - return; - } - - List invalidPaths = new List(); - - XmlNode root = xmlDoc.SelectSingleNode("root"); - if (root == null) - { - return; - } - - XmlNode groupsXML = root.SelectSingleNode("groups"); - if (groupsXML != null) - { - foreach (XmlNode node in groupsXML.SelectNodes("group")) - { - XmlAttribute nameXML = node.Attributes["name"]; - XmlNode directoriesXML = node.SelectSingleNode("directories"); - XmlNode extensionsXML = node.SelectSingleNode("extensions"); - XmlNode scriptXML = node.SelectSingleNode("script"); - XmlNode delayXML = node.SelectSingleNode("delay"); - - XmlNode relativeScriptPathXML = node.SelectSingleNode("relativeScriptPath"); - XmlNode stopScriptWhenFileUpdatedXML = node.SelectSingleNode("stopScriptWhenFileUpdated"); - XmlNode restartDelayTimerWhenFileUpdatedXML = node.SelectSingleNode("restartDelayTimerWhenFileUpdated"); - - string name = nameXML != null ? nameXML.InnerText : ""; - string extensions = ""; - string scriptPath = ""; - string delay = ""; - List directories = new List(); - - if (directoriesXML != null) - { - foreach (XmlNode directory in directoriesXML) - { - string dir = directory.Attributes["path"].InnerText; - // TODO: check to see if the directory is relative or not - if (!Directory.Exists(Path.Combine(new FileInfo(Application.ExecutablePath).DirectoryName, dir))) - { - invalidPaths.Add(dir); - } - directories.Add(dir); - } - } - - if (extensionsXML != null) - { - XmlAttribute elem = extensionsXML.Attributes["value"]; - if (elem != null) - { - extensions = elem.InnerText; - } - } - - if (scriptXML != null) - { - XmlAttribute elem = scriptXML.Attributes["path"]; - if (elem != null) - { - scriptPath = elem.InnerText; - } - } - - if (delayXML != null) - { - XmlAttribute elem = delayXML.Attributes["value"]; - if (elem != null) - { - delay = elem.InnerText; - } - } - - if (name.Length > 0) - { - FileGroupTab groupTab = new FileGroupTab(); - - groupTab.ExtensionString = extensions; - groupTab.ScriptPath = scriptPath; - groupTab.Directories = directories; - groupTab.Delay = delay; - groupTab.Settings.relativeScriptCB.Checked = relativeScriptPathXML != null; - groupTab.Settings.stopScriptCB.Checked = stopScriptWhenFileUpdatedXML != null; - groupTab.Settings.restartDelayCB.Checked = restartDelayTimerWhenFileUpdatedXML != null; - - TabPage tp = new TabPage(); - tp.Text = name; - - tabControl1.SuspendLayout(); - tabControl1.TabPages.Add(tp); - tabControl1.ResumeLayout(); - - tp.SuspendLayout(); - tp.Controls.Add(groupTab); - groupTab.Dock = DockStyle.Fill; - tp.ResumeLayout(); - } - else - { - MessageBox.Show("There is a group with no name that was not loaded, the next time the settings are saved this unnamed group will be lost. Edit your settings.xml to save it, or carry on.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - } - - if (invalidPaths.Count > 0) - { - MessageBox.Show("There are invalid paths in your settings file: '" + String.Join("', ", invalidPaths.ToArray()) + "'", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - } - - - XmlNode preferencesXML = root.SelectSingleNode("preferences"); - if (preferencesXML != null) - { - XmlNode autosaveXML = preferencesXML.SelectSingleNode("autosave"); - if (autosaveXML != null) - { - Preferences.Instance.autoSaveCB.Checked = true; - } - - XmlNode editorXML = preferencesXML.SelectSingleNode("editor"); - if (editorXML != null) - { - List defaultPrograms = new List(); - List> userDefinedPrograms = new List>(); - - XmlNode defaultsXML = editorXML.SelectSingleNode("defaults"); - if (defaultsXML != null) - { - foreach (XmlNode node in defaultsXML.SelectNodes("default")) - { - XmlAttribute attName = node.Attributes["name"]; - if (attName != null) - { - defaultPrograms.Add(attName.InnerText); - } - } - } - - XmlNode programsXML = editorXML.SelectSingleNode("programs"); - if (programsXML != null) - { - foreach (XmlNode node in programsXML.SelectNodes("program")) - { - XmlAttribute attName = node.Attributes["name"]; - XmlAttribute attPath = node.Attributes["path"]; - if (attName != null && attPath != null) - { - userDefinedPrograms.Add(new Tuple(attName.InnerText, attPath.InnerText)); - } - } - } - - Preferences.Instance.LoadEditorPreferences(defaultPrograms, userDefinedPrograms); - } - } - - Logger.Log("Loaded settings.xml"); - } - - private void Form1_Resize(object sender, EventArgs e) - { - if (FormWindowState.Minimized == WindowState) - { - Hide(); - SetTrayIcon(); - } - } - - private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) - { - - } - - private void toolStripMenuItem1_Click(object sender, EventArgs e) - { - m_ReallyClose = true; - Form1.Quit(); - } - - private void exitToolStripMenuItem_Click(object sender, EventArgs e) - { - m_ReallyClose = true; - Form1.Quit(); - } - - private void Form1_FormClosing(object sender, FormClosingEventArgs e) - { - if (!m_ReallyClose) - { - e.Cancel = true; - WindowState = FormWindowState.Minimized; - } - } - - private void Form1_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == (char)Keys.Escape) - { - WindowState = FormWindowState.Minimized; - Form1_Resize(this, null); - - e.Handled = true; - } - } - - private void toolStripButton2_Click(object sender, EventArgs e) - { - if (s_FolderDialogue.ShowDialog()) - { - foldersListBox.Items.Add(s_FolderDialogue.FileName); - Save(); - } - } - - private void toolStripButton1_Click(object sender, EventArgs e) - { - while (foldersListBox.SelectedItems.Count > 0) - { - foldersListBox.Items.Remove(foldersListBox.SelectedItems[0]); - } - Save(); - } - - private void toolStripButton7_Click(object sender, EventArgs e) - { - - } - - private void hideToolStripMenuItem_Click(object sender, EventArgs e) - { - WindowState = FormWindowState.Minimized; - Form1_Resize(this, null); - } - - private void saveToolStripMenuItem_Click(object sender, EventArgs e) - { - Save(); - } - - private void toolStripButton1_Click_1(object sender, EventArgs e) - { - Save(); - } - - private void toolStripButton3_Click_1(object sender, EventArgs e) - { - if (null == m_NewFileGroup || m_NewFileGroup.IsDisposed) - { - m_NewFileGroup = new NewFileGroup(); - } - - while (true) - { - DialogResult result = m_NewFileGroup.ShowDialog(this); - if (result == DialogResult.OK) - { - String groupName = m_NewFileGroup.GetFileGroupName(); - String groupExtensions = m_NewFileGroup.GetFileGroupExtensions(); - String scriptName = m_NewFileGroup.GetFileGroupScript(); - - foreach (TabPage page in tabControl1.TabPages) - { - if (page.Name == groupName) - { - continue; - } - } - - TabPage tp = new TabPage(); - tp.Text = groupName; - - tabControl1.SuspendLayout(); - tabControl1.TabPages.Add(tp); - tabControl1.SelectedTab = tp; - tabControl1.ResumeLayout(); - - FileGroupTab groupTab = new FileGroupTab(); - - groupTab.ExtensionString = groupExtensions; - groupTab.ScriptPath = scriptName; - - tp.SuspendLayout(); - tp.Controls.Add(groupTab); - groupTab.Dock = DockStyle.Fill; - tp.ResumeLayout(); - break; - } - else - { - break; - } - } - } - - private void toolStripButton4_Click(object sender, EventArgs e) - { - if (tabControl1.SelectedTab != null) - { - if (MessageBox.Show( - "Are you sure you want to delete " + tabControl1.SelectedTab.Text + "?", - "Confirm delete", - MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) - { - FileGroupTab fileGroup = null; - - foreach (FileGroupTab fg in tabControl1.SelectedTab.Controls) - { - fileGroup = fg; - } - - if (fileGroup != null && MessageBox.Show( - "Do you want to delete the script associated with this file group?", - "Delete script?", - MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) - { - string script_path = fileGroup.ScriptPath; - File.Delete(script_path); - } - - tabControl1.TabPages.Remove(tabControl1.SelectedTab); - } - } - } - - private void textBox1_TextChanged(object sender, EventArgs e) - { - - } - - private void textBox1_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == (char)Keys.Enter) - { - try - { - Logger.WriteLine("> " + textBox1.Text); - - //CompiledCode compiled = source.Compile(); - //compiled.Execute(pyScope); - //pyEngine.Execute(textBox1.Text, pyScope); - - ScriptSource source = pyEngine.CreateScriptSourceFromString(textBox1.Text, SourceCodeKind.AutoDetect); - object result = source.Execute(pyScope); - - if (result != null) - { - Logger.WriteLine(result.ToString()); - } - } - catch (Microsoft.Scripting.SyntaxErrorException ex) - { - Logger.Error("Syntax error:" + ex.Message); - } - catch (IronPython.Runtime.UnboundNameException ex) - { - Logger.Error(ex.Message); - } - catch (System.MissingMemberException ex) - { - Logger.Error(ex.Message); - } - - e.Handled = true; - } - } - - private void script_StringWritten(object sender, MyEvtArgs e) - { - if (textBox2.InvokeRequired) - { - SetTextCallback d = new SetTextCallback(script_StringWritten); - this.Invoke(d, new object[] { sender, e }); - } - else - { - textBox2.AppendText(e.Value); - textBox2.SelectionStart = textBox2.Text.Length; - textBox2.ScrollToCaret(); - } - } - - private void script_ErrorStringWritten(object sender, MyEvtArgs e) - { - if (textBox2.InvokeRequired) - { - SetTextCallback d = new SetTextCallback(script_ErrorStringWritten); - this.Invoke(d, new object[] { sender, e }); - } - else - { - textBox2.AppendText(e.Value, Color.Maroon); - textBox2.SelectionStart = textBox2.Text.Length; - textBox2.ScrollToCaret(); - } - } - } -} diff --git a/code/src/Form1.resx b/code/src/Form1.resx deleted file mode 100644 index 33f751c..0000000 --- a/code/src/Form1.resx +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - 291, 17 - - - 606, 56 - - - 501, 56 - - - 786, 17 - - - 17, 56 - - - - - AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAJ0EAACdBAAAAAAAAAAA - AAD///8A////AP///wD///8AAAAAAQAAAAMAAAAGAAAACAAAAAgAAAAHAAAABAAAAAL///8A////AP// - /wD///8A////AP///wD///8AAAAAAwAAAAsAAAAXAAAAJAAAADAAAAAyAAAALAAAAB8AAAASAAAABwAA - AAH///8A////AP///wD///8AAAAAAQAAAAcDAwIjRT4ylXZrXMGhmYrisa6h45CKfspdVUuhAgIBNAAA - ABMAAAAD////AP///wD///8A////AP///wAuKRxGj4V12L+xnf/PxK//5+HS/+rm1v/d1cL/1Mq5/5KG - dtQzLCBFAAAAAf///wD///8A////AP///wAwKhw/cWNI8q2chf/Rxrb/0sm1/+DZyf/h28r/2tK//97X - yf+6qpP/k4Ns8kc/MUD///8A////AP///wAWFREHeXBe1p+Rev+nk3j/w7ah/9jPwP/Hu6L/yr6l/+jj - 2f/Jvaj/vKyV/7utmP+WjX3ZDQsHB////wD///8APjcne4F0Wv+qnIf/vrGd/72umP/LwK3/5+LY/+fi - 2P/Jvaj/yb2p/8S3pP/Guqr/l4hv/1FKOnz///8A////AFVOOqt9b1T/lIRr/8K2pf/Iu6r/1cy//97X - zP/f2M3/2dDD/9LIuf/Iu6r/oZB2/5iJcP9lW0ms////AP///wBVTDfQjoNs/6abhf+zp5P/5d/Y/93U - yv/Huqj/x7qp/+zo4v/h29L/uq2a/8rCtf+WiXL/bmRR0v///wD///8AVEw30IyAav+9tqj/t62c/+fj - 3f/d1s3/xLmo/8W6qf/t6uX/4tzV/7yyof/V0Mb/mo14/2phTtL///8A////AEdALKmFe2T/wryw/+Dc - 1f/IwLP/19HG/+/t6f/z8e7/0szB/9bQxv/p5uH/urKk/5aMd/9vaFi0////AP///wBCPS5/oZqJ/9PP - xv/Iwrf/087E/9rWzf/l4tz/5+Pe/9vWz//W0cj/0czD/+He1/+mn47/Ukw+gv///wD///8AEQ8MB4F8 - bNvEwLX/zcm//97b1f/l497/xsC1/8bAtf/x7+z/2NTM/8/Lwv/Lx73/hYBw2wkHAwf///8A////AP// - /wArJhc+p6KV+drY0f/d29X/zcnA/+7s6f/s6uf/zcm//+vq5v/Y1c7/qaWY+S0oGT7///8A////AP// - /wD///8A////AE5LP0vGw7zu19TO/+De2f/i4Nv/4uDb/97c1v/e3Nf/xsS97kdEN0n///8A////AP// - /wD///8A////AP///wD///8AFhQRB3ZzZ4+xrqbRwL627cC+tu2pppzNfXpukggGAgf///8A////AP// - /wD///8A8A8AAOADAADAAwAA4AMAAMADAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAMAD - AADgBwAA8A8AAA== - - - - 157, 56 - - - 95 - - - - AAABAAIAICAAAAEAIACoEAAAJgAAABAQAAABACAAaAQAAM4QAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQ - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAA - AAMAAAADAAAABAAAAAUAAAAGAAAABgAAAAYAAA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NwvrkFoD/76QQP/MlDH/36c+//TNhP/41ZL/9sdo//KtH//zsSb/++Gr//zp - wP/86sT//OvF//zqxP/2xVv/9LMq//OwJP/63KD/+diW//bHbf/stU7/5Lxw/8KHHf+pcRD/akoV7AAA - ABQAAAAAAAAAAAAAAAAAAAAAHBEDd4liKP+meTH/qGsB/716Av/frE7/8s6J//jWlf/0vVD/8rEr//S7 - Q//868b//fDV//3y2v/98tv//fDX//jSg//0vEb/87Iw//nXlP/526D/+NSQ/9+TB//NiAj/wokk/6Zr - B/+YayL/LSIQegAAAAAAAAAAAAAAAAAAAAA9LhmrnntG/7GKTf+laQH/u3sK/9qpTf/ntFX/8btX//jU - kf/74rT/++nD//fPff/3znn/9814//fNdv/3y3L/++Kv//zv1P/87Mv/9st1//K0O//qrDT/4qpF/9CX - Lv/DjjH/w51c/6yERv9DMBWqAAAAAAAAAAAAAAAAAAAAAEs5I72PZyz/pXo2/8OcXP/XtXn/yYsa/9+q - Sf/svmf/+eCw//zu0v/98dn/98t2//fKcv/3y3P/98tz//fLc//747P//fLd//3w2P/30Yb/8cFm/+av - SP/mv3v/4L+E/86oZf+iaw//nHAp/1RAJL0AAAAAAAAAAAAAAAAAAAAATDoizIFWF/+WaSD/x6Zw/9Sz - fP/TqFz/4Llx/+e+cf/34br//O/X//3y3f/3zHv/9sp0//fKdf/3y3X/98p1//rjt//99OL//fHc//TS - kf/rwHD/5bxw/+rQov/dvof/z61y/5dfAf+Zbir/alc90QAAAAAAAAAAAAAAAAAAAABRQCnMfFIV/5Jm - IP/DpHH/3ceh/9m5gv/dunr/4756//XkxP/679z//PLh//TNg//0ynn/9ct5//bLef/1y3n/+eS7//z1 - 5//78uD/8NKb/+fAef/hvHn/7Nm4/+POp//MrXf/kVoB/49jIP9NOBrKAAAAAAAAAAAAAAAAAAAAAEc4 - JL2ObDz/nHdA/7eVYP/h0LT/17uL/9q6gv/fvYL/9OXM//nw3//78+X/7s2N/+7Jgv/vyYL/8MqC/+/J - gv/35MH//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/14sD/48GE/+bSsP23j0//elko1gAA - SAcAAAAAWDwXuZ99S//ezbH87+TR/+TLoP/t2bX/+/Tn//v05//q0qj/7Ni1//Hn1P/aw538rYxZ/3BU - LrsAAAAAAAAAADYfAW+olHr/6+HS+9zNs//m1rr/7d/J//Pr3v/z697/7d7F/+bXvP/j1L3/8Ojc+6yW - dv9HLw5wAAAAAAAAAAAAAAAViHpn3t3Sw//bzrv87efd//Hp4P/dzK//386y//by7f/o3s//2865/OLY - yf+UhXPfAAAAFQAAAABVRjYDAAAAACobDEannJH49fHs/+zm3Pzf1cj99PDs//Lu6P/h18n98u7o/PHs - 5P+qn5H4NSYVRgAAAABgUT8DAAAAAJOJfgIAAAAAWVNMR8G8t+Xk4Nv/8+/r/vbz8P/28+//8u7o/ufj - 3v/Gwr3mYFpTSAAAAACbkYQCAAAAAAAAAAAAAAAAYVNEAwAAAAAuJyAYoJqVfLu4tc7FwLvuxsK977Ov - qsugmZR8OjQuGQAAAABwYlIDAAAAAAAAAAD//wAA//8AAPgfAADwDwAA4AcAAMADAADAAwAAgAEAAIAB - AACAAQAAgAEAAMADAADAAwAA4AcAAPAPAAD8PwAA - - - \ No newline at end of file diff --git a/code/src/Logger.cs b/code/src/Logger.cs deleted file mode 100644 index 0f1ae51..0000000 --- a/code/src/Logger.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FileWatcher -{ - public sealed class Logger - { - private delegate void SetTextCallback(string str, Color? color); - - #region Singleton - - private static readonly Logger instance = new Logger(); - - static Logger() - { - } - - public static Logger Instance - { - get - { - return instance; - } - } - #endregion - - private Logger() - { - } - - public void Print(string str, Color? color = null) - { - if (Form1.Instance.textBox2.InvokeRequired) - { - SetTextCallback d = new SetTextCallback(Print); - Form1.Instance.textBox2.Invoke(d, new object[] { str, color }); - } - else - { - Form1.Instance.textBox2.AppendText(str, color.HasValue ? color.Value : Color.Black); - Form1.Instance.textBox2.SelectionStart = Form1.Instance.textBox2.Text.Length; - Form1.Instance.textBox2.ScrollToCaret(); - } - } - - public void PrintLine(string str, Color? color = null) - { - if (Form1.Instance.textBox2.InvokeRequired) - { - SetTextCallback d = new SetTextCallback(PrintLine); - Form1.Instance.textBox2.Invoke(d, new object[] { str, color }); - } - else - { - Form1.Instance.textBox2.AppendText(str + Environment.NewLine, color.HasValue ? color.Value : Color.Black); - Form1.Instance.textBox2.SelectionStart = Form1.Instance.textBox2.Text.Length; - Form1.Instance.textBox2.ScrollToCaret(); - } - } - - public void ErrorLine(string str, Color? color = null) - { - if (Form1.Instance.textBox2.InvokeRequired) - { - SetTextCallback d = new SetTextCallback(ErrorLine); - Form1.Instance.textBox2.Invoke(d, new object[] { str, color }); - } - else - { - Form1.Instance.textBox2.AppendText(str + Environment.NewLine, color.HasValue ? color.Value : Color.Red); - Form1.Instance.textBox2.SelectionStart = Form1.Instance.textBox2.Text.Length; - Form1.Instance.textBox2.ScrollToCaret(); - } - } - - public void LogLine(string str) - { - Print(DateTime.Now.ToString("R") + " ", Color.Maroon); - PrintLine(str); - } - - public void LogErrorLine(string str) - { - Print(DateTime.Now.ToString("R") + " ", Color.Maroon); - PrintLine(str, Color.Red); - } - - static public void WriteLine(string str) - { - Logger.Instance.PrintLine(str); - } - - static public void Error(string str) - { - Logger.Instance.ErrorLine(str); - } - - static public void Log(string str) - { - Logger.Instance.LogLine(str); - } - - static public void LogError(string str) - { - Logger.Instance.LogErrorLine(str); - } - } -} diff --git a/code/src/MyEvtArgs.cs b/code/src/MyEvtArgs.cs deleted file mode 100644 index 8df0ea5..0000000 --- a/code/src/MyEvtArgs.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FileWatcher -{ - public class MyEvtArgs : EventArgs - { - public T Value - { - get; - private set; - } - public MyEvtArgs(T value) - { - this.Value = value; - } - } -} diff --git a/code/src/NewFileGroup.Designer.cs b/code/src/NewFileGroup.Designer.cs deleted file mode 100644 index f524cfd..0000000 --- a/code/src/NewFileGroup.Designer.cs +++ /dev/null @@ -1,173 +0,0 @@ -namespace FileWatcher -{ - partial class NewFileGroup - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewFileGroup)); - this.label1 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.label3 = new System.Windows.Forms.Label(); - this.textBox3 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.createButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(13, 13); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(86, 13); - this.label1.TabIndex = 0; - this.label1.Text = "File Group Name"; - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(199, 10); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(219, 20); - this.textBox1.TabIndex = 1; - this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(13, 39); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(170, 13); - this.label2.TabIndex = 2; - this.label2.Text = "File Extensions (comma separated)"; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(199, 36); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(219, 20); - this.textBox2.TabIndex = 3; - // - // openFileDialog1 - // - this.openFileDialog1.FileName = "openFileDialog1"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(13, 65); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(34, 13); - this.label3.TabIndex = 4; - this.label3.Text = "Script"; - // - // textBox3 - // - this.textBox3.Location = new System.Drawing.Point(199, 62); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(187, 20); - this.textBox3.TabIndex = 5; - this.textBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox3_KeyPress); - // - // button1 - // - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.button1.Image = global::FileWatcher.Properties.Resources.folder; - this.button1.Location = new System.Drawing.Point(392, 60); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(26, 23); - this.button1.TabIndex = 6; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // createButton - // - this.createButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.createButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.createButton.Location = new System.Drawing.Point(253, 99); - this.createButton.Name = "createButton"; - this.createButton.Size = new System.Drawing.Size(84, 23); - this.createButton.TabIndex = 7; - this.createButton.Text = "Create Group"; - this.createButton.UseVisualStyleBackColor = true; - this.createButton.Click += new System.EventHandler(this.createButton_Click); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cancelButton.Location = new System.Drawing.Point(343, 99); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 8; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // NewFileGroup - // - this.AcceptButton = this.createButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(430, 134); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.createButton); - this.Controls.Add(this.button1); - this.Controls.Add(this.textBox3); - this.Controls.Add(this.label3); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.label2); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "NewFileGroup"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "New File Group"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.OpenFileDialog openFileDialog1; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox textBox3; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button createButton; - private System.Windows.Forms.Button cancelButton; - } -} \ No newline at end of file diff --git a/code/src/NewFileGroup.cs b/code/src/NewFileGroup.cs deleted file mode 100644 index 4d3591b..0000000 --- a/code/src/NewFileGroup.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace FileWatcher -{ - public partial class NewFileGroup : Form - { - public bool setScriptDirectory = false; - - public NewFileGroup() - { - InitializeComponent(); - } - - public String GetFileGroupName() - { - return textBox1.Text; - } - - public String GetFileGroupExtensions() - { - return textBox2.Text; - } - - public String GetFileGroupScript() - { - return textBox3.Text; - } - - private void NewFileGroup_KeyPress(object sender, KeyPressEventArgs e) - { - - } - - private void createButton_Click(object sender, EventArgs e) - { - Directory.CreateDirectory(Path.GetDirectoryName(textBox3.Text)); - using (var fileStream = File.Open(textBox3.Text, FileMode.OpenOrCreate, FileAccess.ReadWrite)); - } - - private void textBox3_KeyPress(object sender, KeyPressEventArgs e) - { - setScriptDirectory = true; - } - - private void textBox1_VisibleChanged(object sender, EventArgs e) - { - - } - - private void textBox1_TextChanged(object sender, EventArgs e) - { - if (setScriptDirectory && textBox3.Text.Length == 0) - { - setScriptDirectory = false; - } - - if (false == setScriptDirectory) - { - textBox3.Text = "scripts\\" + textBox1.Text.ToLower().Replace(' ', '_') + ".py"; - } - } - - private void button1_Click(object sender, EventArgs e) - { - if (openFileDialog1.ShowDialog() == DialogResult.OK) - { - textBox3.Text = openFileDialog1.FileName; - } - } - } -} diff --git a/code/src/NewFileGroup.resx b/code/src/NewFileGroup.resx deleted file mode 100644 index 6cb5ce1..0000000 --- a/code/src/NewFileGroup.resx +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - - - AAABAAIAICAAAAEAIACoEAAAJgAAABAQAAABACAAaAQAAM4QAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQ - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAA - AAMAAAADAAAABAAAAAUAAAAGAAAABgAAAAYAAAAGAAAABgAAAAUAAAAEAAAAAwAAAAIAAAABAAAAAQAA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H//zsSb/++Gr//zp - wP/86sT//OvF//zqxP/2xVv/9LMq//OwJP/63KD/+diW//bHbf/stU7/5Lxw/8KHHf+pcRD/akoV7AAA - ABQAAAAAAAAAAAAAAAAAAAAAHBEDd4liKP+meTH/qGsB/716Av/frE7/8s6J//jWlf/0vVD/8rEr//S7 - Q//868b//fDV//3y2v/98tv//fDX//jSg//0vEb/87Iw//nXlP/526D/+NSQ/9+TB//NiAj/wokk/6Zr - B/+YayL/LSIQegAAAAAAAAAAAAAAAAAAAAA9LhmrnntG/7GKTf+laQH/u3sK/9qpTf/ntFX/8btX//jU - kf/74rT/++nD//fPff/3znn/9814//fNdv/3y3L/++Kv//zv1P/87Mv/9st1//K0O//qrDT/4qpF/9CX - Lv/DjjH/w51c/6yERv9DMBWqAAAAAAAAAAAAAAAAAAAAAEs5I72PZyz/pXo2/8OcXP/XtXn/yYsa/9+q - Sf/svmf/+eCw//zu0v/98dn/98t2//fKcv/3y3P/98tz//fLc//747P//fLd//3w2P/30Yb/8cFm/+av - SP/mv3v/4L+E/86oZf+iaw//nHAp/1RAJL0AAAAAAAAAAAAAAAAAAAAATDoizIFWF/+WaSD/x6Zw/9Sz - fP/TqFz/4Llx/+e+cf/34br//O/X//3y3f/3zHv/9sp0//fKdf/3y3X/98p1//rjt//99OL//fHc//TS - kf/rwHD/5bxw/+rQov/dvof/z61y/5dfAf+Zbir/alc90QAAAAAAAAAAAAAAAAAAAABRQCnMfFIV/5Jm - IP/DpHH/3ceh/9m5gv/dunr/4756//XkxP/679z//PLh//TNg//0ynn/9ct5//bLef/1y3n/+eS7//z1 - 5//78uD/8NKb/+fAef/hvHn/7Nm4/+POp//MrXf/kVoB/49jIP9NOBrKAAAAAAAAAAAAAAAAAAAAAEc4 - JL2ObDz/nHdA/7eVYP/h0LT/17uL/9q6gv/fvYL/9OXM//nw3//78+X/7s2N/+7Jgv/vyYL/8MqC/+/J - gv/35MH//Pbq//vz5P/s0aD/4r+B/928gv/o1rX/5NGy/76cYv+vi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//////////////////////8A///8AD//8A - AP/+AAB//AAAP/gAAB/wAAAP8AAAD+AAAAfgAAAH4AAAB8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA+AA - AAfgAAAH4AAAB/AAAA/wAAAP+AAAH/wAAD/+AAB//wAA///AA///+B//KAAAABAAAAAgAAAAAQAgAAAA - AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaFhEFRTEPCVVAEwoWGQ8LFx8fC0w+ - HAtHNRMLGBQMBgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEhFwYJGBIECwAAAAwAAAAmAAAANgAA - ADcAAAAqAAAAERMMAA8dEwMMAAAAAgAAAAAAAAAAAAAAAAAAAABVQSEDAAAAABYZJCVuTBCHqoAt0MOi - UebDplvlsIk70X5cG4oZGB0pAAAAAFhEIAMAAAAAAAAAAAAAAAB/XioCAAAAAD4sEEqth0Tn6rVM//7O - W/7/7ab//++l///UZP7ywl//vI435kkvAEoAAAAAl2sdAgAAAABkRBADAAAAAD0rEUiXYwf38LE4//3U - fPz30nX9+tuL/vrbhv741Hn9+9iJ/Pm1MP+0eRH4Uj8hSAAAAAB+Wx4DAAAAAAAAERePbzzh2aJA//Cj - DPz1xmH/+tqO//fBPP/3xkv//Oaz//bDVv/yriX87bdU/6SCR+EAAw0XAAAAAAAAAABLLwlwonQp/+Gv - U/v1xGX/9Lg8//fJaP/968P//Oa2//bDVf/1wVP/9sVm/+y7YPuyfyT/X0MUcQAAAAAAAAAAdFgxu6l0 - Hf/LjyL88sp8//bJb//41o3/+uGu//rgqv/41Ir/+NGD//TGbf/ZmST8vIcs/35dKLsAAAAAAABQB25M - HdazjEz/1Klf/eKxVf/77tT/++Cw//bEYf/3yGr//fDX//rkuv/ptVT/5seP/bmMPv99WCDWAAWNBwAA - PQdrTSLWrYlQ/9zEmv3fvYL/9+vU//fhuP/wxnf/8sp///vu1P/14sD/48GE/+bSsP23j0//elko1gAA - SAcAAAAAWDwXuZ99S//ezbH87+TR/+TLoP/t2bX/+/Tn//v05//q0qj/7Ni1//Hn1P/aw538rYxZ/3BU - LrsAAAAAAAAAADYfAW+olHr/6+HS+9zNs//m1rr/7d/J//Pr3v/z697/7d7F/+bXvP/j1L3/8Ojc+6yW - dv9HLw5wAAAAAAAAAAAAAAAViHpn3t3Sw//bzrv87efd//Hp4P/dzK//386y//by7f/o3s//2865/OLY - yf+UhXPfAAAAFQAAAABVRjYDAAAAACobDEannJH49fHs/+zm3Pzf1cj99PDs//Lu6P/h18n98u7o/PHs - 5P+qn5H4NSYVRgAAAABgUT8DAAAAAJOJfgIAAAAAWVNMR8G8t+Xk4Nv/8+/r/vbz8P/28+//8u7o/ufj - 3v/Gwr3mYFpTSAAAAACbkYQCAAAAAAAAAAAAAAAAYVNEAwAAAAAuJyAYoJqVfLu4tc7FwLvuxsK977Ov - qsugmZR8OjQuGQAAAABwYlIDAAAAAAAAAAD//wAA//8AAPgfAADwDwAA4AcAAMADAADAAwAAgAEAAIAB - AACAAQAAgAEAAMADAADAAwAA4AcAAPAPAAD8PwAA - - - \ No newline at end of file diff --git a/code/src/Preferences.Designer.cs b/code/src/Preferences.Designer.cs deleted file mode 100644 index cca9346..0000000 --- a/code/src/Preferences.Designer.cs +++ /dev/null @@ -1,318 +0,0 @@ -namespace FileWatcher -{ - partial class Preferences - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Preferences)); - this.cancelButton = new System.Windows.Forms.Button(); - this.saveButton = new System.Windows.Forms.Button(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.autoSaveCB = new System.Windows.Forms.CheckBox(); - this.runAtStartupCB = new System.Windows.Forms.CheckBox(); - this.scriptEditorTab = new System.Windows.Forms.TabPage(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.listBox1 = new System.Windows.Forms.ListBox(); - this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.scriptEditorTab.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cancelButton.Location = new System.Drawing.Point(197, 273); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 0; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // saveButton - // - this.saveButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.saveButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.saveButton.Location = new System.Drawing.Point(116, 273); - this.saveButton.Name = "saveButton"; - this.saveButton.Size = new System.Drawing.Size(75, 23); - this.saveButton.TabIndex = 1; - this.saveButton.Text = "Save"; - this.saveButton.UseVisualStyleBackColor = true; - this.saveButton.Click += new System.EventHandler(this.saveButton_Click); - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.scriptEditorTab); - this.tabControl1.Location = new System.Drawing.Point(12, 12); - this.tabControl1.Multiline = true; - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(260, 255); - this.tabControl1.TabIndex = 2; - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.label2); - this.tabPage1.Controls.Add(this.label1); - this.tabPage1.Controls.Add(this.comboBox1); - this.tabPage1.Controls.Add(this.autoSaveCB); - this.tabPage1.Controls.Add(this.runAtStartupCB); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(252, 229); - this.tabPage1.TabIndex = 1; - this.tabPage1.Text = "General"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Enabled = false; - this.label2.Location = new System.Drawing.Point(127, 58); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(19, 13); - this.label2.TabIndex = 8; - this.label2.Text = ": 2"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Enabled = false; - this.label1.Location = new System.Drawing.Point(64, 58); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(57, 13); - this.label1.TabIndex = 7; - this.label1.Text = "Max Cores"; - // - // comboBox1 - // - this.comboBox1.Enabled = false; - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Location = new System.Drawing.Point(7, 55); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(52, 21); - this.comboBox1.TabIndex = 6; - // - // autoSaveCB - // - this.autoSaveCB.AutoSize = true; - this.autoSaveCB.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.autoSaveCB.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.autoSaveCB.Location = new System.Drawing.Point(7, 32); - this.autoSaveCB.Name = "autoSaveCB"; - this.autoSaveCB.Size = new System.Drawing.Size(71, 17); - this.autoSaveCB.TabIndex = 3; - this.autoSaveCB.Text = "Autosave"; - this.autoSaveCB.UseVisualStyleBackColor = true; - // - // runAtStartupCB - // - this.runAtStartupCB.AutoSize = true; - this.runAtStartupCB.Location = new System.Drawing.Point(7, 8); - this.runAtStartupCB.Name = "runAtStartupCB"; - this.runAtStartupCB.Size = new System.Drawing.Size(93, 17); - this.runAtStartupCB.TabIndex = 2; - this.runAtStartupCB.Text = "Run at startup"; - this.runAtStartupCB.UseVisualStyleBackColor = true; - this.runAtStartupCB.CheckedChanged += new System.EventHandler(this.runAtStartupCB_CheckedChanged); - // - // scriptEditorTab - // - this.scriptEditorTab.Controls.Add(this.groupBox1); - this.scriptEditorTab.Location = new System.Drawing.Point(4, 22); - this.scriptEditorTab.Name = "scriptEditorTab"; - this.scriptEditorTab.Padding = new System.Windows.Forms.Padding(3); - this.scriptEditorTab.Size = new System.Drawing.Size(252, 229); - this.scriptEditorTab.TabIndex = 0; - this.scriptEditorTab.Text = "ScriptEditor"; - this.scriptEditorTab.UseVisualStyleBackColor = true; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.toolStrip1); - this.groupBox1.Controls.Add(this.textBox1); - this.groupBox1.Controls.Add(this.label3); - this.groupBox1.Controls.Add(this.listBox1); - this.groupBox1.Location = new System.Drawing.Point(4, 7); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(242, 216); - this.groupBox1.TabIndex = 3; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Text Editors"; - // - // toolStrip1 - // - this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton3, - this.toolStripButton4, - this.toolStripButton1, - this.toolStripButton2}); - this.toolStrip1.Location = new System.Drawing.Point(3, 16); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(236, 25); - this.toolStrip1.TabIndex = 7; - this.toolStrip1.Text = "toolStrip1"; - // - // toolStripButton3 - // - this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton3.Enabled = false; - this.toolStripButton3.Image = global::FileWatcher.Properties.Resources.plus; - this.toolStripButton3.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(23, 22); - this.toolStripButton3.Text = "toolStripButton3"; - this.toolStripButton3.ToolTipText = "Add Editor to open scripts with"; - this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click); - // - // toolStripButton4 - // - this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton4.Enabled = false; - this.toolStripButton4.Image = global::FileWatcher.Properties.Resources.trash; - this.toolStripButton4.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton4.Name = "toolStripButton4"; - this.toolStripButton4.Size = new System.Drawing.Size(23, 22); - this.toolStripButton4.Text = "toolStripButton4"; - this.toolStripButton4.ToolTipText = "Delete Selected Editor"; - this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click); - // - // toolStripButton1 - // - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Image = global::FileWatcher.Properties.Resources.arrow_fat_down; - this.toolStripButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(23, 22); - this.toolStripButton1.Text = "toolStripButton1"; - this.toolStripButton1.ToolTipText = "Move selected editor to a lower priority."; - this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); - // - // toolStripButton2 - // - this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton2.Image = global::FileWatcher.Properties.Resources.arrow_fat_up; - this.toolStripButton2.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(23, 22); - this.toolStripButton2.Text = "toolStripButton2"; - this.toolStripButton2.ToolTipText = "Move selected editor to a higher priority."; - this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click); - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(44, 190); - this.textBox1.Name = "textBox1"; - this.textBox1.ReadOnly = true; - this.textBox1.Size = new System.Drawing.Size(195, 20); - this.textBox1.TabIndex = 6; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 193); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(32, 13); - this.label3.TabIndex = 5; - this.label3.Text = "Path:"; - // - // listBox1 - // - this.listBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.listBox1.FormattingEnabled = true; - this.listBox1.Location = new System.Drawing.Point(2, 45); - this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(234, 130); - this.listBox1.TabIndex = 0; - this.listBox1.SelectedValueChanged += new System.EventHandler(this.listBox1_SelectedValueChanged); - // - // Preferences - // - this.AcceptButton = this.saveButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(284, 308); - this.Controls.Add(this.tabControl1); - this.Controls.Add(this.saveButton); - this.Controls.Add(this.cancelButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "Preferences"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "Preferences"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Preferences_FormClosing); - this.Load += new System.EventHandler(this.Preferences_Load); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.tabPage1.PerformLayout(); - this.scriptEditorTab.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Button cancelButton; - private System.Windows.Forms.Button saveButton; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage scriptEditorTab; - private System.Windows.Forms.ListBox listBox1; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.CheckBox runAtStartupCB; - public System.Windows.Forms.CheckBox autoSaveCB; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private System.Windows.Forms.ToolStripButton toolStripButton2; - private System.Windows.Forms.ToolStripButton toolStripButton3; - private System.Windows.Forms.ToolStripButton toolStripButton4; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.ComboBox comboBox1; - - } -} \ No newline at end of file diff --git a/code/src/Preferences.cs b/code/src/Preferences.cs deleted file mode 100644 index b57aa1f..0000000 --- a/code/src/Preferences.cs +++ /dev/null @@ -1,308 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -using Microsoft.Win32; - -namespace FileWatcher -{ - public sealed partial class Preferences : Form - { - #region Singleton - - private static readonly Preferences instance = new Preferences(); - - static Preferences() - { - } - - public static Preferences Instance - { - get - { - return instance; - } - } - #endregion - - private class ProgramData - { - public string Path; - public bool Save; - - public ProgramData(string path, bool save = false) - { - Path = path; - Save = save; - } - } - - private Dictionary programs = new Dictionary(); - - private BindingList UnboundBindingList = null; - - - private Preferences() - { - InitializeComponent(); - - // TODO: load preferences - - UnboundBindingList = new BindingList(new List(programs.Keys)); - - listBox1.DataSource = UnboundBindingList; - - RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); - SetRunAtStartup(registryKey.GetValue(Form1.ApplicationName) != null); - - LoadEditorPreferences(new List(), new List>()); - } - - public void LoadEditorPreferences(List defaultPrograms, List> userDefinedPrograms) - { - programs.Clear(); - - - #region Get System Default Text Editor - - //http://stackoverflow.com/questions/11365984/c-sharp-open-file-with-default-application-and-parameters - - string textEditorDefault = ""; - - string InstallPath = (string)Registry.GetValue(@"HKEY_CLASSES_ROOT\.txt", "", null); - if (InstallPath != null) - { - string commandPath = (string)Registry.GetValue(@"HKEY_CLASSES_ROOT\\" + InstallPath + "\\Shell\\Open\\Command", "", null); - - string ext = ".exe"; - int indexOf = commandPath.ToLower().LastIndexOf(ext); - - if (indexOf > 0) - { - // strip off arguments (%1,%2,etc) - textEditorDefault = commandPath.Substring(0, indexOf + ext.Length); - } - } - - #endregion - - string pfx64 = Utils.ProgramFilesx64(); - string pfx86 = Utils.ProgramFilesx86(); - string sys = Utils.SystemDirectory(); - - - // Add system default options first so the user options can overwrite these - if (File.Exists(textEditorDefault)) - { - programs.Add("System Default", new ProgramData(textEditorDefault)); - } - - if (File.Exists(pfx64 + "\\Sublime Text 3\\sublime_text.exe")) - { - programs.Add("Sublime Text 3", new ProgramData(pfx64 + "\\Sublime Text 3\\sublime_text.exe")); - } - if (File.Exists(pfx64 + "\\Sublime Text 2\\sublime_text.exe")) - { - programs.Add("Sublime Text 2", new ProgramData(pfx64 + "\\Sublime Text 2\\sublime_text.exe")); - } - if (File.Exists(pfx64 + "\\Sublime Text\\sublime_text.exe")) - { - programs.Add("Sublime Text", new ProgramData(pfx64 + "\\Sublime Text\\sublime_text.exe")); - } - - if (File.Exists(pfx86 + "\\Notepad++\\notepad++.exe")) - { - programs.Add("Notepad++", new ProgramData(pfx86 + "\\Notepad++\\notepad++.exe")); - } - - if (File.Exists(sys + "\\notepad.exe")) - { - programs.Add("NotePad", new ProgramData(sys + "\\notepad.exe")); - } - - foreach (Tuple t in userDefinedPrograms) - { - programs.Add(t.Item1, new ProgramData(t.Item2,true)); - - if (File.Exists(t.Item2) == false) - { - Logger.WriteLine("A program set as one of the default text editors does not exist on your system: " + t.Item2); - } - } - - UnboundBindingList = new BindingList(defaultPrograms); - foreach (string str in programs.Keys) - { - if (defaultPrograms.Contains(str) == false) - { - defaultPrograms.Add(str); - } - } - - - listBox1.DataSource = UnboundBindingList; - } - - public string GetDefaultEditor() - { - foreach (string programName in UnboundBindingList) - { - string path = programs[programName].Path; - if (File.Exists(path)) - { - return path; - } - } - return ""; - } - - public List GetDefaultPrograms() - { - return new List(UnboundBindingList); - } - - // Gets user defined paths - public List> GetEditorProgramPaths() - { - List> programNames = new List>(); - - foreach (KeyValuePair t in programs) - { - if (t.Value.Save) - { - programNames.Add(new Tuple(t.Key, t.Value.Path)); - } - } - - return programNames; - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - private void saveButton_Click(object sender, EventArgs e) - { - Form1.Instance.Save(); - } - - private void cancelButton_Click(object sender, EventArgs e) - { - - } - - private void listBox1_SelectedValueChanged(object sender, EventArgs e) - { - if (listBox1.SelectedValue != null) - { - string path = programs[(string)listBox1.SelectedValue].Path; - textBox1.Text = path; - } - } - - private void Preferences_FormClosing(object sender, FormClosingEventArgs e) - { - this.Hide(); - e.Cancel = true; - } - - private void toolStripButton3_Click(object sender, EventArgs e) - { - - } - - private void toolStripButton4_Click(object sender, EventArgs e) - { - - } - - private void toolStripButton1_Click(object sender, EventArgs e) - { - int selectedIndex = listBox1.SelectedIndex; - if (selectedIndex >= listBox1.Items.Count - 1) - { - return; - } - - listBox1.DataSource = null; - listBox1.SelectionMode = SelectionMode.None; - - string obj1 = UnboundBindingList[selectedIndex]; - - UnboundBindingList[selectedIndex] = UnboundBindingList[selectedIndex + 1]; - UnboundBindingList[selectedIndex + 1] = obj1; - - listBox1.DataSource = UnboundBindingList; - listBox1.SelectionMode = SelectionMode.One; - listBox1.SelectedIndex = selectedIndex + 1; - } - - private void toolStripButton2_Click(object sender, EventArgs e) - { - int selectedIndex = listBox1.SelectedIndex; - if (selectedIndex == 0) - { - return; - } - - listBox1.DataSource = null; - listBox1.SelectionMode = SelectionMode.None; - - string obj1 = UnboundBindingList[selectedIndex]; - - UnboundBindingList[selectedIndex] = UnboundBindingList[selectedIndex - 1]; - UnboundBindingList[selectedIndex - 1] = obj1; - - listBox1.DataSource = UnboundBindingList; - listBox1.SelectionMode = SelectionMode.One; - listBox1.SelectedIndex = selectedIndex - 1; - } - - public void SetRunAtStartup(bool yes) - { - RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); - if (registryKey == null) - { - return; - } - - if (yes) - { - registryKey.SetValue(Form1.ApplicationName, Application.ExecutablePath + " --minimize"); - } - else - { - if (registryKey.GetValue(Form1.ApplicationName) != null) - { - registryKey.DeleteValue(Form1.ApplicationName); - } - } - runAtStartupCB.Checked = yes; - } - - private void runAtStartupCB_CheckedChanged(object sender, EventArgs e) - { - SetRunAtStartup(runAtStartupCB.Checked); - } - - private void Preferences_Load(object sender, EventArgs e) - { - - } - } -} diff --git a/code/src/Preferences.resx b/code/src/Preferences.resx deleted file mode 100644 index db4ac94..0000000 --- a/code/src/Preferences.resx +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - - - AAABAAIAICAAAAEAIACoEAAAJgAAABAQAAABACAAaAQAAM4QAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQ - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAA - AAMAAAADAAAABAAAAAUAAAAGAAAABgAAAAYAAAAGAAAABgAAAAUAAAAEAAAAAwAAAAIAAAABAAAAAQAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAA - AAQAAAAGAAAACQAAAAsAAAAOAAAAEQAAABMAAAAUAAAAFQAAABMAAAASAAAADwAAAA0AAAAKAAAACAAA - AAYAAAAEAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA - AAMAAAAGAAAACgAAAA8AAAATAAAAGQAAAB4AAAAjAAAAJwAAACoAAAArAAAAKQAAACUAAAAhAAAAHAAA - ABcAAAASAAAADQAAAAkAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAACAAAABQAAAAoAAAAQAAAAFgAAAB0AAAAkAAAAKwAAADEAAAA3AAAAOgAAADsAAAA5AAAANQAA - AC8AAAApAAAAIgAAABsAAAAUAAAADQAAAAcAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAIAAAAFAAAACQAAAA8AAAAVAAAAHAQEBDksIhO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O1Ov/nmwv/3a5Z/8SYSv9SQCSzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsU - CUSNcUb1vZVR/8+fS//ovW7/8KUW//GmEv/yryP/+t2f//vjrf/3yFv/98FD//fDRv/3w0f/98JF//vi - p//75bL/+daI//OyKP/yqxz/9cBZ//LEbv/frVD/0qlh/5p5QfQnHhBFAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAPisSvJ5yLf+4iDX/2bFp/+a4Yv/vphv/87hC//XCWP/1vkr/9b9H//rbl//74aj/++Ko//vh - pf/736D/+M5w//jMbP/4zHD/9bk+//GqGv/zszj/8sl7/+W6a//EiiT/tYY1/1NAIb8AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAABRVNwvrkFoD/76QQP/MlDH/36c+//TNhP/41ZL/9sdo//KtH//zsSb/++Gr//zp - wP/86sT//OvF//zqxP/2xVv/9LMq//OwJP/63KD/+diW//bHbf/stU7/5Lxw/8KHHf+pcRD/akoV7AAA - ABQAAAAAAAAAAAAAAAAAAAAAHBEDd4liKP+meTH/qGsB/716Av/frE7/8s6J//jWlf/0vVD/8rEr//S7 - Q//868b//fDV//3y2v/98tv//fDX//jSg//0vEb/87Iw//nXlP/526D/+NSQ/9+TB//NiAj/wokk/6Zr - B/+YayL/LSIQegAAAAAAAAAAAAAAAAAAAAA9LhmrnntG/7GKTf+laQH/u3sK/9qpTf/ntFX/8btX//jU - kf/74rT/++nD//fPff/3znn/9814//fNdv/3y3L/++Kv//zv1P/87Mv/9st1//K0O//qrDT/4qpF/9CX - Lv/DjjH/w51c/6yERv9DMBWqAAAAAAAAAAAAAAAAAAAAAEs5I72PZyz/pXo2/8OcXP/XtXn/yYsa/9+q - Sf/svmf/+eCw//zu0v/98dn/98t2//fKcv/3y3P/98tz//fLc//747P//fLd//3w2P/30Yb/8cFm/+av - SP/mv3v/4L+E/86oZf+iaw//nHAp/1RAJL0AAAAAAAAAAAAAAAAAAAAATDoizIFWF/+WaSD/x6Zw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SAAAAAB+Wx4DAAAAAAAAERePbzzh2aJA//Cj - DPz1xmH/+tqO//fBPP/3xkv//Oaz//bDVv/yriX87bdU/6SCR+EAAw0XAAAAAAAAAABLLwlwonQp/+Gv - U/v1xGX/9Lg8//fJaP/968P//Oa2//bDVf/1wVP/9sVm/+y7YPuyfyT/X0MUcQAAAAAAAAAAdFgxu6l0 - Hf/LjyL88sp8//bJb//41o3/+uGu//rgqv/41Ir/+NGD//TGbf/ZmST8vIcs/35dKLsAAAAAAABQB25M - HdazjEz/1Klf/eKxVf/77tT/++Cw//bEYf/3yGr//fDX//rkuv/ptVT/5seP/bmMPv99WCDWAAWNBwAA - PQdrTSLWrYlQ/9zEmv3fvYL/9+vU//fhuP/wxnf/8sp///vu1P/14sD/48GE/+bSsP23j0//elko1gAA - SAcAAAAAWDwXuZ99S//ezbH87+TR/+TLoP/t2bX/+/Tn//v05//q0qj/7Ni1//Hn1P/aw538rYxZ/3BU - LrsAAAAAAAAAADYfAW+olHr/6+HS+9zNs//m1rr/7d/J//Pr3v/z697/7d7F/+bXvP/j1L3/8Ojc+6yW - dv9HLw5wAAAAAAAAAAAAAAAViHpn3t3Sw//bzrv87efd//Hp4P/dzK//386y//by7f/o3s//2865/OLY - yf+UhXPfAAAAFQAAAABVRjYDAAAAACobDEannJH49fHs/+zm3Pzf1cj99PDs//Lu6P/h18n98u7o/PHs - 5P+qn5H4NSYVRgAAAABgUT8DAAAAAJOJfgIAAAAAWVNMR8G8t+Xk4Nv/8+/r/vbz8P/28+//8u7o/ufj - 3v/Gwr3mYFpTSAAAAACbkYQCAAAAAAAAAAAAAAAAYVNEAwAAAAAuJyAYoJqVfLu4tc7FwLvuxsK977Ov - qsugmZR8OjQuGQAAAABwYlIDAAAAAAAAAAD//wAA//8AAPgfAADwDwAA4AcAAMADAADAAwAAgAEAAIAB - AACAAQAAgAEAAMADAADAAwAA4AcAAPAPAAD8PwAA - - - \ No newline at end of file diff --git a/code/src/Program.cs b/code/src/Program.cs deleted file mode 100644 index 4556447..0000000 --- a/code/src/Program.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace FileWatcher -{ - static class Program - { - public static Dictionary Args = null; - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main(string[] args) - { - Args = args.ToDictionary( - k => k.Split(new char[] { '=' }, 2)[0].ToLower(), - v => v.Split(new char[] { '=' }, 2).Count() > 1 ? v.Split(new char[] { '=' }, 2)[1] : null - ); - - //AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); - - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(Form1.Instance); - } - - /*static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) - { - string dllName = args.Name.Contains(',') ? args.Name.Substring(0, args.Name.IndexOf(',')) : args.Name.Replace(".dll", ""); - - dllName = dllName.Replace(".", "_"); - - if (dllName.EndsWith("_resources")) return null; - - System.Resources.ResourceManager rm = new System.Resources.ResourceManager("FileWatcher.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly()); - - byte[] bytes = (byte[])rm.GetObject(dllName); - - return System.Reflection.Assembly.Load(bytes); - }*/ - } -} diff --git a/code/src/Reflector.cs b/code/src/Reflector.cs deleted file mode 100644 index ae0661f..0000000 --- a/code/src/Reflector.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System; -using System.Reflection; - -namespace FolderSelect -{ - /// - /// This class is from the Front-End for Dosbox and is used to present a 'vista' dialog box to select folders. - /// Being able to use a vista style dialog box to select folders is much better then using the shell folder browser. - /// http://code.google.com/p/fed/ - /// - /// Example: - /// var r = new Reflector("System.Windows.Forms"); - /// - public class Reflector - { - #region variables - - string m_ns; - Assembly m_asmb; - - #endregion - - #region Constructors - - /// - /// Constructor - /// - /// The namespace containing types to be used - public Reflector(string ns) - : this(ns, ns) - { } - - /// - /// Constructor - /// - /// A specific assembly name (used if the assembly name does not tie exactly with the namespace) - /// The namespace containing types to be used - public Reflector(string an, string ns) - { - m_ns = ns; - m_asmb = null; - foreach (AssemblyName aN in Assembly.GetExecutingAssembly().GetReferencedAssemblies()) - { - if (aN.FullName.StartsWith(an)) - { - m_asmb = Assembly.Load(aN); - break; - } - } - } - - #endregion - - #region Methods - - /// - /// Return a Type instance for a type 'typeName' - /// - /// The name of the type - /// A type instance - public Type GetType(string typeName) - { - Type type = null; - string[] names = typeName.Split('.'); - - if (names.Length > 0) - type = m_asmb.GetType(m_ns + "." + names[0]); - - for (int i = 1; i < names.Length; ++i) { - type = type.GetNestedType(names[i], BindingFlags.NonPublic); - } - return type; - } - - /// - /// Create a new object of a named type passing along any params - /// - /// The name of the type to create - /// - /// An instantiated type - public object New(string name, params object[] parameters) - { - Type type = GetType(name); - - ConstructorInfo[] ctorInfos = type.GetConstructors(); - foreach (ConstructorInfo ci in ctorInfos) { - try { - return ci.Invoke(parameters); - } catch { } - } - - return null; - } - - /// - /// Calls method 'func' on object 'obj' passing parameters 'parameters' - /// - /// The object on which to excute function 'func' - /// The function to execute - /// The parameters to pass to function 'func' - /// The result of the function invocation - public object Call(object obj, string func, params object[] parameters) - { - return Call2(obj, func, parameters); - } - - /// - /// Calls method 'func' on object 'obj' passing parameters 'parameters' - /// - /// The object on which to excute function 'func' - /// The function to execute - /// The parameters to pass to function 'func' - /// The result of the function invocation - public object Call2(object obj, string func, object[] parameters) - { - return CallAs2(obj.GetType(), obj, func, parameters); - } - - /// - /// Calls method 'func' on object 'obj' which is of type 'type' passing parameters 'parameters' - /// - /// The type of 'obj' - /// The object on which to excute function 'func' - /// The function to execute - /// The parameters to pass to function 'func' - /// The result of the function invocation - public object CallAs(Type type, object obj, string func, params object[] parameters) - { - return CallAs2(type, obj, func, parameters); - } - - /// - /// Calls method 'func' on object 'obj' which is of type 'type' passing parameters 'parameters' - /// - /// The type of 'obj' - /// The object on which to excute function 'func' - /// The function to execute - /// The parameters to pass to function 'func' - /// The result of the function invocation - public object CallAs2(Type type, object obj, string func, object[] parameters) { - MethodInfo methInfo = type.GetMethod(func, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - return methInfo.Invoke(obj, parameters); - } - - /// - /// Returns the value of property 'prop' of object 'obj' - /// - /// The object containing 'prop' - /// The property name - /// The property value - public object Get(object obj, string prop) - { - return GetAs(obj.GetType(), obj, prop); - } - - /// - /// Returns the value of property 'prop' of object 'obj' which has type 'type' - /// - /// The type of 'obj' - /// The object containing 'prop' - /// The property name - /// The property value - public object GetAs(Type type, object obj, string prop) { - PropertyInfo propInfo = type.GetProperty(prop, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - return propInfo.GetValue(obj, null); - } - - /// - /// Returns an enum value - /// - /// The name of enum type - /// The name of the value - /// The enum value - public object GetEnum(string typeName, string name) { - Type type = GetType(typeName); - FieldInfo fieldInfo = type.GetField(name); - return fieldInfo.GetValue(null); - } - - #endregion - - } -} diff --git a/code/src/RichTextBoxExtensions.cs b/code/src/RichTextBoxExtensions.cs deleted file mode 100644 index 0fde449..0000000 --- a/code/src/RichTextBoxExtensions.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace FileWatcher -{ - public static class RichTextBoxExtensions - { - // In case a string stream doesn't reset the text color, reset it automatically when done appending text - // TODO: override the single parameter AppendText - public static bool g_ResetANSIIColorOnAppend = true; - - public static void AppendText(this RichTextBox box, string text, Color color) - { - box.SelectionStart = box.TextLength; - box.SelectionLength = 0; - box.SelectionColor = color; - - string ANSIIEscape = "\u001B["; - int index = text.IndexOf(ANSIIEscape); - while (index != -1) - { - string substring = text.Substring(0, index); - if (substring.Length > 0) - { - box.AppendText(substring); - } - - text = text.Substring(index + ANSIIEscape.Length); - - if (text.Length < 3) - { - if (g_ResetANSIIColorOnAppend) - { - box.SelectionColor = box.ForeColor; - } - return; - } - - int number; - try - { - number = Int32.Parse(text[0] + "" + text[1]); - } - catch (FormatException) - { - box.SelectionColor = Color.Red; - box.AppendText("ERROR - Invalid ANSII Escape sequence: '" + text + "'"); - if (g_ResetANSIIColorOnAppend) - { - box.SelectionColor = box.ForeColor; - } - return; - } - - // http://en.wikipedia.org/wiki/ANSI_escape_code - if (number / 10 == 3) - { - switch (number) - { - case 30: - box.SelectionColor = Color.Black; - break; - case 31: - box.SelectionColor = Color.Red; - break; - case 32: - box.SelectionColor = Color.Green; - break; - case 3: - box.SelectionColor = Color.Yellow; - break; - case 34: - box.SelectionColor = Color.Blue; - break; - case 35: - box.SelectionColor = Color.Magenta; - break; - case 36: - box.SelectionColor = Color.Cyan; - break; - case 37: - box.SelectionColor = Color.White; - break; - - case 39: - box.SelectionColor = color; - break; - } - } - - index = text.IndexOf("m"); - if (index == -1) - { - box.SelectionColor = Color.Red; - box.AppendText("ERROR - couldn't find the sequence escape, 'm', for the ANSII Escape sequence: '" + text + "'"); - if (g_ResetANSIIColorOnAppend) - { - box.SelectionColor = box.ForeColor; - } - return; - } - - text = text.Substring(index + 1); - index = text.IndexOf(ANSIIEscape); - } - - if (text.Length > 0) - { - box.SelectionColor = color; - box.AppendText(text); - } - if (g_ResetANSIIColorOnAppend) - { - box.SelectionColor = box.ForeColor; - } - } - } -} diff --git a/code/src/Script.cs b/code/src/Script.cs deleted file mode 100644 index 741aa6d..0000000 --- a/code/src/Script.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FileWatcher -{ - class Script - { - protected string m_Label; - protected string m_EntryPoint; - - public string Label - { - get { return m_Label; } - set { m_Label = value; } - } - - public string EntryPoint - { - get { return m_EntryPoint; } - set { m_EntryPoint = value; } - } - } -} diff --git a/code/src/ScriptManager.Designer.cs b/code/src/ScriptManager.Designer.cs deleted file mode 100644 index 990b508..0000000 --- a/code/src/ScriptManager.Designer.cs +++ /dev/null @@ -1,246 +0,0 @@ -namespace FileWatcher -{ - partial class ScriptManager - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.listBox1 = new System.Windows.Forms.ListBox(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.panel1 = new System.Windows.Forms.Panel(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.label3 = new System.Windows.Forms.Label(); - this.textBox3 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStrip1.SuspendLayout(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - this.SuspendLayout(); - // - // listBox1 - // - this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.listBox1.FormattingEnabled = true; - this.listBox1.Location = new System.Drawing.Point(0, 25); - this.listBox1.Name = "listBox1"; - this.listBox1.ScrollAlwaysVisible = true; - this.listBox1.Size = new System.Drawing.Size(346, 342); - this.listBox1.TabIndex = 3; - // - // toolStrip1 - // - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton1, - this.toolStripButton2, - this.toolStripButton3}); - this.toolStrip1.Location = new System.Drawing.Point(0, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.toolStrip1.Size = new System.Drawing.Size(346, 25); - this.toolStrip1.TabIndex = 2; - this.toolStrip1.Text = "toolStrip1"; - // - // panel1 - // - this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panel1.Controls.Add(this.button1); - this.panel1.Controls.Add(this.textBox3); - this.panel1.Controls.Add(this.label3); - this.panel1.Controls.Add(this.pictureBox2); - this.panel1.Controls.Add(this.pictureBox1); - this.panel1.Controls.Add(this.textBox2); - this.panel1.Controls.Add(this.label2); - this.panel1.Controls.Add(this.label1); - this.panel1.Controls.Add(this.textBox1); - this.panel1.Location = new System.Drawing.Point(0, 368); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(346, 92); - this.panel1.TabIndex = 4; - // - // toolStripButton1 - // - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Image = global::FileWatcher.Properties.Resources.plus; - this.toolStripButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(23, 22); - this.toolStripButton1.Text = "toolStripButton1"; - // - // toolStripButton2 - // - this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton2.Image = global::FileWatcher.Properties.Resources.cross; - this.toolStripButton2.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(23, 22); - this.toolStripButton2.Text = "toolStripButton2"; - this.toolStripButton2.ToolTipText = "Remove Selected Scripts"; - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(81, 34); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(118, 20); - this.textBox1.TabIndex = 0; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(8, 37); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(63, 13); - this.label1.TabIndex = 1; - this.label1.Text = "Script Label"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(8, 61); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(55, 13); - this.label2.TabIndex = 2; - this.label2.Text = "EntryPoint"; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(81, 58); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(118, 20); - this.textBox2.TabIndex = 3; - // - // pictureBox1 - // - this.pictureBox1.Image = global::FileWatcher.Properties.Resources.warning; - this.pictureBox1.Location = new System.Drawing.Point(205, 64); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(10, 10); - this.pictureBox1.TabIndex = 4; - this.pictureBox1.TabStop = false; - // - // pictureBox2 - // - this.pictureBox2.Image = global::FileWatcher.Properties.Resources.warning; - this.pictureBox2.Location = new System.Drawing.Point(205, 40); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(10, 10); - this.pictureBox2.TabIndex = 5; - this.pictureBox2.TabStop = false; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(8, 13); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(59, 13); - this.label3.TabIndex = 6; - this.label3.Text = "Script Path"; - // - // textBox3 - // - this.textBox3.Location = new System.Drawing.Point(82, 10); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(233, 20); - this.textBox3.TabIndex = 7; - // - // button1 - // - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.button1.Image = global::FileWatcher.Properties.Resources.folder; - this.button1.Location = new System.Drawing.Point(321, 10); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(18, 18); - this.button1.TabIndex = 8; - this.button1.UseVisualStyleBackColor = true; - // - // toolStripButton3 - // - this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton3.Image = global::FileWatcher.Properties.Resources.script; - this.toolStripButton3.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(23, 22); - this.toolStripButton3.Text = "toolStripButton3"; - this.toolStripButton3.ToolTipText = "Edit all selected scripts."; - // - // ScriptManager - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(346, 459); - this.Controls.Add(this.panel1); - this.Controls.Add(this.listBox1); - this.Controls.Add(this.toolStrip1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.Name = "ScriptManager"; - this.Text = "ScriptManager"; - this.Load += new System.EventHandler(this.ScriptManager_Load); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ListBox listBox1; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private System.Windows.Forms.ToolStripButton toolStripButton2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.TextBox textBox3; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.ToolStripButton toolStripButton3; - - - } -} \ No newline at end of file diff --git a/code/src/ScriptManager.cs b/code/src/ScriptManager.cs deleted file mode 100644 index 96708bc..0000000 --- a/code/src/ScriptManager.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace FileWatcher -{ - public partial class ScriptManager : Form - { - public ScriptManager() - { - InitializeComponent(); - } - - // each script has a script id, so the user can rename or redirect at there will, and the scripts will remain correctly linked. - private void ScriptManager_Load(object sender, EventArgs e) - { - - } - } -} diff --git a/code/src/ScriptManager.resx b/code/src/ScriptManager.resx deleted file mode 100644 index 5da7a24..0000000 --- a/code/src/ScriptManager.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/code/src/Singleton.cs b/code/src/Singleton.cs deleted file mode 100644 index d89c467..0000000 --- a/code/src/Singleton.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace FileWatcher -{ - //http://csharpindepth.com/articles/general/singleton.aspx - public sealed class Singleton - { - private static readonly Singleton instance = new Singleton(); - - // Explicit static constructor to tell C# compiler - // not to mark type as beforefieldinit - static Singleton() - { - } - - private Singleton() - { - } - - public static Singleton Instance - { - get - { - return instance; - } - } - } -} diff --git a/code/src/TimerPlus.cs b/code/src/TimerPlus.cs deleted file mode 100644 index fe56b2f..0000000 --- a/code/src/TimerPlus.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Timers; -using System.Threading; -using System.Threading.Tasks; - -namespace FileWatcher -{ - /// - /// DO NOT CAST TO A TIMER, always interact with this class directly. Start and Stop are not overridden. - /// - public class TimerPlus : System.Timers.Timer - { - private bool m_Running; - private DateTime m_Start; - private DateTime m_End; - - public TimerPlus() - { - } - - public TimerPlus(double interval) - : base(interval) - { - } - - public void Start() - { - m_Running = true; - m_Start = DateTime.Now; - base.Start(); - } - - public void Stop() - { - m_End = DateTime.Now; - m_Running = false; - base.Stop(); - } - - public TimeSpan TimeElapsed - { - get { return m_Running ? DateTime.Now - m_Start : m_End - m_Start; } - } - - public TimeSpan TimeRemaining - { - get { return TimeSpan.FromMilliseconds(Interval) - TimeElapsed; } - } - } -} diff --git a/code/src/Utils.cs b/code/src/Utils.cs deleted file mode 100644 index c6696fc..0000000 --- a/code/src/Utils.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FileWatcher -{ - class Utils - { - public static string ProgramFilesx86() - { - if (8 == IntPtr.Size - || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) - { - return Environment.GetEnvironmentVariable("ProgramFiles(x86)"); - } - - return Environment.GetEnvironmentVariable("ProgramFiles"); - } - - public static string ProgramFilesx64() - { - return Environment.GetEnvironmentVariable("ProgramW6432"); - } - - /// - /// Gets the program default, Program Fils(x86) when program is compiled - /// for 32 bit Windows, and Program Files when program is compiled for - /// 64bit Windows. - /// - /// - public static string ProgramFiles() - { - return Environment.GetEnvironmentVariable("ProgramFiles"); - } - - /// - /// Returns Windows/System32 or Windows/SysWOW64 depending on your program - /// - /// - public static string SystemDirectory() - { - return Environment.SystemDirectory; - } - - /// - /// Creates a relative path from one file or folder to another. - /// - /// Contains the directory that defines the start of the relative path. - /// Contains the path that defines the endpoint of the relative path. - /// Boolean indicating whether to add uri safe escapes to the relative path - /// The relative path from the start directory to the end path. - /// - public static String MakeRelativePath(String fromPath, String toPath) - { - if (String.IsNullOrEmpty(fromPath)) throw new ArgumentNullException("fromPath"); - if (String.IsNullOrEmpty(toPath)) throw new ArgumentNullException("toPath"); - - // If path doesn't end with '\\' it's assumed to be a file. - if (fromPath.EndsWith("\\") == false) - { - fromPath += "\\"; - } - - Uri fromUri = new Uri(fromPath); - Uri toUri = new Uri(toPath); - - Uri relativeUri = fromUri.MakeRelativeUri(toUri); - String relativePath = Uri.UnescapeDataString(relativeUri.ToString()); - - return relativePath.Replace('/', Path.DirectorySeparatorChar); - } - } -} diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/scripts/.gitkeep b/scripts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/scripts/sample.py b/scripts/sample.py deleted file mode 100644 index 0a29071..0000000 --- a/scripts/sample.py +++ /dev/null @@ -1,3 +0,0 @@ -def process_updated_files( files ): - for f in files: - print f \ No newline at end of file