# HG changeset patch # User stevenhollidge # Date 1335512677 -3600 # Node ID e84dc4926a5a5717596c8d4d4e151f86b1fc41fd # Parent 8bb84cc9ba3f07afa44f78cf414c9ebf22965a2e OSL work from 2011 diff -r 8bb84cc9ba3f -r e84dc4926a5a .hgignore --- a/.hgignore Thu Apr 26 13:23:35 2012 +0100 +++ b/.hgignore Fri Apr 27 08:44:37 2012 +0100 @@ -10,3 +10,10 @@ *.stats */Bin/* */ClientBin/* +*crunchsolution.* +*crunchproject* +*.ncrunchsolution +*.7z +*Debug* +*/Release/* +*.ReSharper.user diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/DatabaseScript.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/DatabaseScript.sql Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,52 @@ +USE [master] +GO +/****** Object: Database [FileMonitoring] Script Date: 01/13/2011 19:12:24 ******/ +CREATE DATABASE [FileMonitoring] +GO +USE [FileMonitoring] +GO +/****** Object: Table [dbo].[FileEvents] Script Date: 01/13/2011 19:12:25 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_PADDING ON +GO +CREATE TABLE [dbo].[FileEvents]( + [Id] [int] IDENTITY(1,1) NOT NULL, + [FileEvent] [varchar](50) NOT NULL, + [CreateTimestamp] [smalldatetime] NULL, + CONSTRAINT [PK_FileEvents] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +SET ANSI_PADDING OFF +GO +/****** Object: StoredProcedure [dbo].[FileEvents_insert] Script Date: 01/13/2011 19:12:31 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +-- ============================================= +-- Author: OSL +-- Create date: 12/01/2011 +-- Description: Demo for OSL +-- ============================================= +CREATE PROCEDURE [dbo].[FileEvents_insert] + -- Add the parameters for the stored procedure here + @FileEvent VARCHAR(50), @Id INT OUTPUT +AS +BEGIN + SET NOCOUNT ON; + + -- Insert statements for procedure here + INSERT dbo.FileEvents (FileEvent) SELECT @FileEvent + + SELECT @Id = SCOPE_IDENTITY() +END +GO +/****** Object: Default [DF_FileEvents_CreateTimestamp] Script Date: 01/13/2011 19:12:25 ******/ +ALTER TABLE [dbo].[FileEvents] ADD CONSTRAINT [DF_FileEvents_CreateTimestamp] DEFAULT (getdate()) FOR [CreateTimestamp] +GO diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService.sln Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,35 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OslFileMonitorService", "OslFileMonitorService\OslFileMonitorService.csproj", "{F860BBC3-5715-47CD-BF90-FE92C4217727}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "OslFileMonitorService_Setup", "OslFileMonitorService_Setup\OslFileMonitorService_Setup.vdproj", "{4F067179-BFB4-4C00-8BE4-50EAB2B6E437}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F860BBC3-5715-47CD-BF90-FE92C4217727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F860BBC3-5715-47CD-BF90-FE92C4217727}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F860BBC3-5715-47CD-BF90-FE92C4217727}.Debug|x86.ActiveCfg = Debug|x86 + {F860BBC3-5715-47CD-BF90-FE92C4217727}.Debug|x86.Build.0 = Debug|x86 + {F860BBC3-5715-47CD-BF90-FE92C4217727}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F860BBC3-5715-47CD-BF90-FE92C4217727}.Release|Any CPU.Build.0 = Release|Any CPU + {F860BBC3-5715-47CD-BF90-FE92C4217727}.Release|x86.ActiveCfg = Release|x86 + {F860BBC3-5715-47CD-BF90-FE92C4217727}.Release|x86.Build.0 = Release|x86 + {4F067179-BFB4-4C00-8BE4-50EAB2B6E437}.Debug|Any CPU.ActiveCfg = Debug + {4F067179-BFB4-4C00-8BE4-50EAB2B6E437}.Debug|Any CPU.Build.0 = Debug + {4F067179-BFB4-4C00-8BE4-50EAB2B6E437}.Debug|x86.ActiveCfg = Debug + {4F067179-BFB4-4C00-8BE4-50EAB2B6E437}.Debug|x86.Build.0 = Debug + {4F067179-BFB4-4C00-8BE4-50EAB2B6E437}.Release|Any CPU.ActiveCfg = Release + {4F067179-BFB4-4C00-8BE4-50EAB2B6E437}.Release|Any CPU.Build.0 = Release + {4F067179-BFB4-4C00-8BE4-50EAB2B6E437}.Release|x86.ActiveCfg = Release + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService.zip Binary file OslFileMonitorService/OslFileMonitorService.zip has changed diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/App.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/App.config Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/DataAccess.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/DataAccess.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,58 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using NLog; + +namespace OslFileMonitorService +{ + internal class DataAccessHelper + { + private static readonly Logger logger = LogManager.GetCurrentClassLogger(); + + public static int InsertFileEvent(string fileEvent) + { + logger.Trace(">>> Begin DataAccessHelper.InsertFileEvent"); + + string sqlConnectionString = Settings.DatabaseConnectionString; + string procName = "[dbo].[FileEvents_insert]"; + int insertId = -1; + + using (var connection = new SqlConnection(sqlConnectionString)) + { + using (var command = new SqlCommand(procName, connection) {CommandType = CommandType.StoredProcedure}) + { + // @fileEvent parameter + command.Parameters.Add(new SqlParameter("@fileEvent", SqlDbType.VarChar, 50)); + command.Parameters["@fileEvent"].Value = fileEvent; + + // @id output parameter for primary key of newly inserted record + command.Parameters.Add(new SqlParameter("@Id", SqlDbType.Int)); + command.Parameters["@Id"].Direction = ParameterDirection.Output; + + try + { + connection.Open(); + command.ExecuteNonQuery(); + insertId = (int) command.Parameters["@Id"].Value; + connection.Close(); + + logger.Debug(string.Format("Stored procedure {0} execution success: id value {1} inserted", + procName, insertId)); + } + catch (SqlException e) + { + logger.Error(string.Format("Stored procedure execution failed: {0}", e.Message)); + } + catch (Exception e) + { + logger.Error(string.Format("Stored procedure execution failed: {0}", e.Message)); + } + } + } + + logger.Trace("<<< End DataAccessHelper.InsertFileEvent"); + + return insertId; + } + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/FileMonitorService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/FileMonitorService.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,152 @@ +using System; +using System.ComponentModel; +using System.IO; +using System.ServiceProcess; +using NLog; + +namespace OslFileMonitorService +{ + public class FileMonitorService : ServiceBase + { + private static readonly Logger logger = LogManager.GetCurrentClassLogger(); + private FileSystemWatcher FileMonitor; + + public FileMonitorService() + { + Initialize(); + } + + private void Initialize() + { + try + { + Settings.ReadSettings(); + + // FileMonitor settings + FileMonitor = new FileSystemWatcher(); + + //beginInit ensures events do not fire until the intialisation is complete + ((ISupportInitialize) (FileMonitor)).BeginInit(); + + //hook up events to methods + FileMonitor.Deleted += FileMonitor_Changed; + FileMonitor.Renamed += FileMonitor_OnRenamed; + FileMonitor.Changed += FileMonitor_Changed; + FileMonitor.Created += FileMonitor_Changed; + + //Set the NotifyFilters for raising events. + FileMonitor.NotifyFilter = NotifyFilters.LastWrite + | NotifyFilters.FileName + | NotifyFilters.DirectoryName; + // Note: we have excluded NotifyFilters.LastAccess (e.g. fires an event on a text file being opened/read) + + FileMonitor.Path = Settings.MonitorPath; + FileMonitor.IncludeSubdirectories = Settings.MonitorIncludeSubs; + FileMonitor.Filter = Settings.MonitorFilter; + + + // Service settings + CanPauseAndContinue = true; + CanShutdown = true; + ServiceName = "OSL File Monitor"; + + ((ISupportInitialize) (FileMonitor)).EndInit(); + } + catch (Exception e) + { + logger.Error("Error during FileMonitorService.Initialize: {0}", e.Message); + } + } + + protected override void OnStart(string[] args) + { + try + { + //Begin monitoring. + FileMonitor.EnableRaisingEvents = true; + + string message = string.Format("SERVICE EVENT: {0} - {1}", Settings.ApplicationName, "Started"); + EventLog.WriteEntry(message); + logger.Info(message); + } + catch (Exception e) + { + logger.Error("Error during OnStart {0}", e.Message); + } + } + + /// + /// Stop this service. + /// + protected override void OnStop() + { + try + { + //When the service is stopped the FileSystemMonitor should stop raising events. + FileMonitor.EnableRaisingEvents = false; + + string message = string.Format("SERVICE EVENT: {0} - {1}", Settings.ApplicationName, "Stopped"); + + EventLog.WriteEntry(message); + logger.Info(message); + } + catch (Exception e) + { + logger.Error("Error during OnStop {0}", e.Message); + } + } + + protected override void OnPause() + { + try + { + //When the service is paused the FileSystemMonitor should stop raising events. + FileMonitor.EnableRaisingEvents = false; + + string message = string.Format("SERVICE EVENT: {0} - {1}", Settings.ApplicationName, "Paused"); + + EventLog.WriteEntry(message); + logger.Info(message); + } + catch (Exception e) + { + logger.Error("Error during OnPause {0}", e.Message); + } + } + + protected override void OnContinue() + { + try + { + Settings.ReadSettings(); + + FileMonitor.EnableRaisingEvents = true; + + string message = string.Format("SERVICE EVENT: {0} - {1}", Settings.ApplicationName, "Continued"); + + EventLog.WriteEntry(message); + logger.Info(message); + } + catch (Exception e) + { + logger.Error("Error during OnContinue {0}", e.Message); + } + } + + private void FileMonitor_OnRenamed(object source, RenamedEventArgs e) + { + string message = string.Format(@"File renamed: From {0} to {1}", e.OldName, e.Name); + logger.Trace(message); + + DataAccessHelper.InsertFileEvent(message); + } + + private void FileMonitor_Changed(object sender, FileSystemEventArgs e) + { + string message = string.Format(@"File changed: {0} {1} {2}", e.FullPath, e.Name, e.ChangeType); + logger.Trace(message); + + DataAccessHelper.InsertFileEvent(message); + } + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/Lib/NLog.dll Binary file OslFileMonitorService/OslFileMonitorService/Lib/NLog.dll has changed diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/NLog.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/NLog.config Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/OslFileMonitorService.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/OslFileMonitorService.csproj Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,116 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {F860BBC3-5715-47CD-BF90-FE92C4217727} + WinExe + Properties + OslFileMonitorService + OslFileMonitorService + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + OslFileMonitorService.Program + + + true + bin\Debug\ + DEBUG;TRACE + full + AnyCPU + bin\Debug\OslFileMonitorService.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + bin\Release\ + TRACE + true + pdbonly + AnyCPU + bin\Release\OslFileMonitorService.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + + + + False + Lib\NLog.dll + + + + + + + + + + + + + + + + + Component + + + + + Component + + + + + + + Always + Designer + + + + + + + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/OslServiceInstaller.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/OslServiceInstaller.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,42 @@ +using System; +using System.ComponentModel; +using System.Configuration.Install; +using System.ServiceProcess; + +namespace OslFileMonitorService +{ + /// + /// Summary description for ProjectInstaller. + /// + [RunInstaller(true)] + public class OslServiceInstaller : Installer + { + private ServiceInstaller serviceInstaller1; + private ServiceProcessInstaller serviceProcessInstaller1; + + public OslServiceInstaller() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + serviceProcessInstaller1 = new ServiceProcessInstaller(); + serviceInstaller1 = new ServiceInstaller(); + + serviceProcessInstaller1.Account = ServiceAccount.LocalSystem; + + serviceInstaller1.ServiceName = "OSL File Monitor"; + serviceInstaller1.DisplayName = "OSL File Monitor Service"; + serviceInstaller1.StartType = ServiceStartMode.Manual; + + Installers.Add(serviceProcessInstaller1); + Installers.Add(serviceInstaller1); + } + + public static void Main() + { + Console.WriteLine("Usage: InstallUtil.exe [.exe]"); + } + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/Program.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,15 @@ +using System.ServiceProcess; + +namespace OslFileMonitorService +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + private static void Main() + { + ServiceBase.Run(new FileMonitorService()); + } + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/Properties/AssemblyInfo.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,39 @@ +using System.Reflection; +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("OslFileMonitorService")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("OslFileMonitorService")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[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("910208e9-5ca2-4be1-9475-83a5db51d49c")] + +// 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")] \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService/Settings.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService/Settings.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,35 @@ +using System; +using System.Configuration; +using NLog; + +namespace OslFileMonitorService +{ + public class Settings + { + private static readonly Logger logger = LogManager.GetCurrentClassLogger(); + + public static string ApplicationName; + public static string DatabaseConnectionString; + public static string MonitorPath; + public static string MonitorFilter; + public static bool MonitorIncludeSubs; + + + public static void ReadSettings() + { + //retrieve the configuration properties from the app.config file. + try + { + ApplicationName = ConfigurationManager.AppSettings.Get("ApplicationName"); + DatabaseConnectionString = ConfigurationManager.ConnectionStrings["db1"].ConnectionString; + MonitorPath = ConfigurationManager.AppSettings.Get("MonitorPath"); + MonitorFilter = ConfigurationManager.AppSettings.Get("MonitorFilter"); + MonitorIncludeSubs = (Convert.ToBoolean(ConfigurationManager.AppSettings.Get("MonitorIncludeSubs"))); + } + catch (Exception e) + { + logger.Error("Error reading config file: {0}", e.Message); + } + } + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/OslFileMonitorService_Setup/OslFileMonitorService_Setup.vdproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/OslFileMonitorService_Setup/OslFileMonitorService_Setup.vdproj Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,864 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:OslFileMonitorService_Setup" +"LanguageId" = "3:1033" +"CodePage" = "3:1252" +"UILanguageId" = "3:1033" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_136F98FEA3B855FDD9F4ECB7E55F28FB" + "OwnerKey" = "8:_4A12FFF242EE4F6CADFB6E5FF58D594B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_3711A1FE07A84EBE838EAF288ED2FEC7" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4A12FFF242EE4F6CADFB6E5FF58D594B" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_4A12FFF242EE4F6CADFB6E5FF58D594B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_136F98FEA3B855FDD9F4ECB7E55F28FB" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\OslFileMonitorService_Setup.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0,Profile=Client" + { + "Name" = "8:Microsoft .NET Framework 4 Client Profile (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.0,Profile=Client" + } + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\OslFileMonitorService_Setup.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0,Profile=Client" + { + "Name" = "8:Microsoft .NET Framework 4 Client Profile (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.0,Profile=Client" + } + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + } + "Deployable" + { + "CustomAction" + { + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_3A9469AC01F24C18A8366190889158E1" + { + "Name" = "8:Primary output from OslFileMonitorService (Active)" + "Condition" = "8:" + "Object" = "8:_4A12FFF242EE4F6CADFB6E5FF58D594B" + "FileType" = "3:2" + "InstallAction" = "3:2" + "Arguments" = "8:" + "EntryPoint" = "8:" + "Sequence" = "3:1" + "Identifier" = "8:_2395E06F_4468_4458_9A5D_BD81F6E9C5B7" + "InstallerClass" = "11:TRUE" + "CustomActionData" = "8:" + } + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_CA0F1A1679904404A5326B84EE691B7A" + { + "Name" = "8:Primary output from OslFileMonitorService (Active)" + "Condition" = "8:" + "Object" = "8:_4A12FFF242EE4F6CADFB6E5FF58D594B" + "FileType" = "3:2" + "InstallAction" = "3:4" + "Arguments" = "8:" + "EntryPoint" = "8:" + "Sequence" = "3:1" + "Identifier" = "8:_2F2571CC_4588_4BDC_B761_267D5753E7DA" + "InstallerClass" = "11:TRUE" + "CustomActionData" = "8:" + } + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_DE20575916214878AE4BE54543ED8DDB" + { + "Name" = "8:Primary output from OslFileMonitorService (Active)" + "Condition" = "8:" + "Object" = "8:_4A12FFF242EE4F6CADFB6E5FF58D594B" + "FileType" = "3:2" + "InstallAction" = "3:1" + "Arguments" = "8:" + "EntryPoint" = "8:" + "Sequence" = "3:1" + "Identifier" = "8:_7FCEDC22_8CDC_4887_980E_4902BB2BE0E6" + "InstallerClass" = "11:TRUE" + "CustomActionData" = "8:" + } + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_EDC35D3764BA43CFA1DBF1C203D9BDF1" + { + "Name" = "8:Primary output from OslFileMonitorService (Active)" + "Condition" = "8:" + "Object" = "8:_4A12FFF242EE4F6CADFB6E5FF58D594B" + "FileType" = "3:2" + "InstallAction" = "3:3" + "Arguments" = "8:" + "EntryPoint" = "8:" + "Sequence" = "3:1" + "Identifier" = "8:_D27445AB_1CB7_4A52_A9A2_22BDCE766313" + "InstallerClass" = "11:TRUE" + "CustomActionData" = "8:" + } + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_8CA44FBD48AF4890A3A19F3A4C3BEDEE" + { + "Name" = "8:.NET Framework" + "Message" = "8:[VSDNETMSG]" + "FrameworkVersion" = "8:.NETFramework,Version=v4.0,Profile=Client" + "AllowLaterVersions" = "11:FALSE" + "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000" + } + } + } + "File" + { + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_136F98FEA3B855FDD9F4ECB7E55F28FB" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_136F98FEA3B855FDD9F4ECB7E55F28FB" + { + "Name" = "8:NLog.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:NLog.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_2D71902D92CB41E0B6C7044BE2CE16A6" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_3711A1FE07A84EBE838EAF288ED2FEC7" + { + "SourcePath" = "8:..\\OslFileMonitorService\\NLog.config" + "TargetName" = "8:NLog.config" + "Tag" = "8:" + "Folder" = "8:_2D71902D92CB41E0B6C7044BE2CE16A6" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_2D71902D92CB41E0B6C7044BE2CE16A6" + { + "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_307E45B2AFCC4FBF86393ADBBF69D2F3" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_D834547459F044E28BC9F3D6C99F4241" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:1033" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:OSL File Monitor Service" + "ProductCode" = "8:{4D98A22A-3229-4511-B38A-E1C68E32EA4D}" + "PackageCode" = "8:{5AEEFC35-62FE-4E62-ACD1-3B1B207E2E45}" + "UpgradeCode" = "8:{112A4582-70A5-4CD4-874D-02D06E8276D4}" + "AspNetVersion" = "8:4.0.30319.0" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:TRUE" + "DetectNewerInstalledVersion" = "11:TRUE" + "InstallAllUsers" = "11:TRUE" + "ProductVersion" = "8:1.0.0" + "Manufacturer" = "8:OSL" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:OSL File Monitor Service" + "Subject" = "8:" + "ARPCONTACT" = "8:OSL" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:" + "ARPURLINFOABOUT" = "8:" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:0" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_E89901932B2A400AA0DF0D0E6C1944B3" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_AFA0AE026DCC4E568444E9559B6964B1" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_2F4E824D6C4E402196ECA4D10726E0F4" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_BF6B57B59D69430D914B8CE5DE3E0F4C" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_2CEEBEA80F414377B386726145E47D60" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_0C98268E62DF42528B7F9026B54D39A2" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_3B596E42512C4E4299723AF7D3BDCB45" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_422D8A9ABCD341D2A290AC94092F7828" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_245702B33EE043DFB3F720099745583C" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_903BE00CE2D64CDEB90E0510975011F7" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "InstallAllUsersVisible" + { + "Name" = "8:InstallAllUsersVisible" + "DisplayName" = "8:#1059" + "Description" = "8:#1159" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_A6F29B24C0434583A7DECBB4281B4A56" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_C1FBF3144CF04F3BB93F8B3DC00FECA8" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_0A45F8C076064BF59BAD021B88AFD887" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_9CAA3BB9DAE045F880C8DA524DB13C1D" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_EFAFEB176B00434D8B9AC7FD6F96BAEB" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_D4DF2FAF729140EAB13259F2B3A67C7A" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_D16219B2C48C471183C5F5DDF447B52A" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_EEC9BAE6909C430993C173CDFB3ABE93" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_553CA17683BE477E84190F8CDFAB8786" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_F73C4957F1A345E388ED5E8170803D64" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_F7C9BB6ED19F4659A4A4F05D256AE006" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_981EA292F82B4A479132314F350CAADB" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + } + "MergeModule" + { + } + "ProjectOutput" + { + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_4A12FFF242EE4F6CADFB6E5FF58D594B" + { + "SourcePath" = "8:..\\OslFileMonitorService\\obj\\Debug\\OslFileMonitorService.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_2D71902D92CB41E0B6C7044BE2CE16A6" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{F860BBC3-5715-47CD-BF90-FE92C4217727}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + } +} diff -r 8bb84cc9ba3f -r e84dc4926a5a OslFileMonitorService/resources.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OslFileMonitorService/resources.txt Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,3 @@ +http://m.helloflight.com/flight.cfm?FLIGHT=JZA111&FDATE=&STATION=&mobile=true + +http://www.flytecomm.com/trackflight \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF.sln Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PreviewHandlerWPF", "PreviewHandlerWPF\PreviewHandlerWPF.csproj", "{8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}.Debug|x86.ActiveCfg = Debug|x86 + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}.Debug|x86.Build.0 = Debug|x86 + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}.Release|Any CPU.Build.0 = Release|Any CPU + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}.Release|x86.ActiveCfg = Release|x86 + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/App.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/App.xaml Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/App.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/App.xaml.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,11 @@ +using System.Windows; + +namespace PreviewHandlerWPF +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/ListManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/ListManager.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,89 @@ +using System; +using System.Globalization; +using System.IO; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Interop; + +namespace PreviewHandlerWPF +{ + internal class ListManager : ThreadSafeObservableCollection + { + private readonly string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + + public ListManager() + { + var fsw = new FileSystemWatcher(dir); + fsw.NotifyFilter = NotifyFilters.FileName | NotifyFilters.Size | NotifyFilters.LastWrite; + fsw.Created += fsw_Created; + fsw.Deleted += fsw_Deleted; + + fsw.EnableRaisingEvents = true; + + string[] files = Directory.GetFiles(dir); + for (int i = 0; i < files.Length; i++) + { + base.Add(files[i]); + } + } + + private void fsw_Deleted(object sender, FileSystemEventArgs e) + { + base.Remove(e.FullPath); + } + + private void fsw_Created(object sender, FileSystemEventArgs e) + { + base.Add(e.FullPath); + } + } + + internal class FileNameConverter : IValueConverter + { + #region IValueConverter Members + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + string[] v = value.ToString().Split('\\'); + return v[v.Length - 1]; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + #endregion + } + + internal class WPFPreviewHandler : ContentPresenter + { + private Rect actualRect; + private IntPtr mainWindowHandle = IntPtr.Zero; + + protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) + { + if (e.Property == ActualHeightProperty | e.Property == ActualWidthProperty) + { + if (mainWindowHandle == IntPtr.Zero) + { + var hwndSource = PresentationSource.FromVisual(Application.Current.MainWindow) as HwndSource; + mainWindowHandle = hwndSource.Handle; + } + else + { + Point p0 = TranslatePoint(new Point(), Application.Current.MainWindow); + Point p1 = TranslatePoint(new Point(ActualWidth, ActualHeight), Application.Current.MainWindow); + actualRect = new Rect(p0, p1); + mainWindowHandle.InvalidateAttachedPreview(actualRect); + } + } + if (e.Property == ContentControl.ContentProperty) + { + mainWindowHandle.AttachPreview(e.NewValue.ToString(), actualRect); + } + base.OnPropertyChanged(e); + } + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/PreviewHandlerWPF.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/PreviewHandlerWPF.csproj Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,170 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33} + WinExe + Properties + PreviewHandlerWPF + PreviewHandlerWPF + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + + 3.5 + Client + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + + + + + 3.5 + + + + + 3.5 + + + 3.5 + + + + + + + + + + MSBuild:Compile + Designer + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile + Designer + + + App.xaml + Code + + + Window1.xaml + Code + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/PreviewersManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/PreviewersManager.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,290 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Security; +using System.Windows; +using System.Windows.Interop; +using Microsoft.Win32; +using STATSTG = System.Runtime.InteropServices.ComTypes.STATSTG; + +namespace PreviewHandlerWPF +{ + internal static class PreviewersManager + { + public static List CurrentPreviewers; + + public static IPreviewHandler pHandler; + + public static void GetAllPreviewers() + { + using ( + RegistryKey rk = + Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers")) + { + CurrentPreviewers = new List(); + + string[] guids = rk.GetValueNames(); + + for (int i = 0; i < guids.Length; i++) + { + if (CurrentPreviewers.SingleOrDefault(prv => prv.CLSID.ToString() == guids[i]) == null) + { + var prv = new Previewer(); + prv.CLSID = new Guid(guids[i]); + prv.Title = rk.GetValue(guids[i]).ToString(); + + CurrentPreviewers.Add(prv); + } + } + } + } + + public static void InvalidateAttachedPreview(this IntPtr handler, Rect viewRect) + { + if (pHandler != null) + { + var r = new RECT(viewRect); + pHandler.SetRect(ref r); + } + } + + public static void AttachPreview(this IntPtr handler, string fileName, Rect viewRect) + { + if (pHandler != null) + { + pHandler.Unload(); + } + string CLSID = "8895b1c6-b41f-4c1c-a562-0d564250836f"; + var g = new Guid(CLSID); + string[] exts = fileName.Split('.'); + string ext = exts[exts.Length - 1]; + using (RegistryKey hk = Registry.ClassesRoot.OpenSubKey(string.Format(@".{0}\ShellEx\{1:B}", ext, g))) + { + if (hk != null) + { + g = new Guid(hk.GetValue("").ToString()); + + Type a = Type.GetTypeFromCLSID(g, true); + object o = Activator.CreateInstance(a); + + var fileInit = o as IInitializeWithFile; + var streamInit = o as IInitializeWithStream; + + bool isInitialized = false; + if (fileInit != null) + { + fileInit.Initialize(fileName, 0); + isInitialized = true; + } + else if (streamInit != null) + { + var stream = new COMStream(File.Open(fileName, FileMode.Open)); + streamInit.Initialize((IStream) streamInit, 0); + isInitialized = true; + } + + if (isInitialized) + { + pHandler = o as IPreviewHandler; + if (pHandler != null) + { + var r = new RECT(viewRect); + + + pHandler.SetWindow(handler, ref r); + pHandler.SetRect(ref r); + + pHandler.DoPreview(); + } + } + } + } + } + } + + public class Previewer + { + public Guid CLSID { get; set; } + public string Title { get; set; } + } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("8895b1c6-b41f-4c1c-a562-0d564250836f")] + internal interface IPreviewHandler + { + void SetWindow(IntPtr hwnd, ref RECT rect); + void SetRect(ref RECT rect); + void DoPreview(); + void Unload(); + void SetFocus(); + void QueryFocus(out IntPtr phwnd); + + [PreserveSig] + uint TranslateAccelerator(ref MSG pmsg); + } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("b7d14566-0509-4cce-a71f-0a554233bd9b")] + internal interface IInitializeWithFile + { + void Initialize([MarshalAs(UnmanagedType.LPWStr)] string pszFilePath, uint grfMode); + } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("b824b49d-22ac-4161-ac8a-9916e8fa3f7f")] + internal interface IInitializeWithStream + { + void Initialize(IStream pstream, uint grfMode); + } + + [StructLayout(LayoutKind.Sequential)] + public struct RECT + { + public int left; + public int top; + public int right; + public int bottom; + + public RECT(Rect rect) + { + top = (int) rect.Top; + bottom = (int) rect.Bottom; + left = (int) rect.Left; + right = (int) rect.Right; + } + } + + public sealed class COMStream : IStream, IDisposable + { + private Stream _stream; + + private COMStream() + { + } + + public COMStream(Stream sourceStream) + { + _stream = sourceStream; + } + + #region IDisposable Members + + public void Dispose() + { + if (_stream != null) + { + _stream.Close(); + _stream.Dispose(); + _stream = null; + } + } + + #endregion + + #region IStream Members + + public void Clone(out IStream ppstm) + { + throw new NotSupportedException(); + } + + public void Commit(int grfCommitFlags) + { + throw new NotSupportedException(); + } + + public void CopyTo(IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten) + { + throw new NotSupportedException(); + } + + public void LockRegion(long libOffset, long cb, int dwLockType) + { + throw new NotSupportedException(); + } + + [SecurityCritical] + public void Read(byte[] pv, int cb, IntPtr pcbRead) + { + int count = _stream.Read(pv, 0, cb); + if (pcbRead != IntPtr.Zero) + { + Marshal.WriteInt32(pcbRead, count); + } + } + + public void Revert() + { + throw new NotSupportedException(); + } + + [SecurityCritical] + public void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition) + { + var origin = (SeekOrigin) dwOrigin; + long pos = _stream.Seek(dlibMove, origin); + if (plibNewPosition != IntPtr.Zero) + { + Marshal.WriteInt64(plibNewPosition, pos); + } + } + + public void SetSize(long libNewSize) + { + _stream.SetLength(libNewSize); + } + + public void Stat(out STATSTG pstatstg, int grfStatFlag) + { + pstatstg = new STATSTG(); + pstatstg.type = 2; + pstatstg.cbSize = _stream.Length; + pstatstg.grfMode = 0; + if (_stream.CanRead && _stream.CanWrite) + { + pstatstg.grfMode |= 2; + } + else if (_stream.CanWrite && !_stream.CanRead) + { + pstatstg.grfMode |= 1; + } + else + { + throw new IOException(); + } + } + + public void UnlockRegion(long libOffset, long cb, int dwLockType) + { + throw new NotSupportedException(); + } + + [SecurityCritical] + public void Write(byte[] pv, int cb, IntPtr pcbWritten) + { + _stream.Write(pv, 0, cb); + if (pcbWritten != IntPtr.Zero) + { + Marshal.WriteInt32(pcbWritten, cb); + } + } + + #endregion + + ~COMStream() + { + if (_stream != null) + { + _stream.Close(); + _stream.Dispose(); + _stream = null; + } + } + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/Properties/AssemblyInfo.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,56 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("PreviewHandlerWPF")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PreviewHandlerWPF")] +[assembly: AssemblyCopyright("Copyright © 2008")] +[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)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) + )] + + +// 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")] \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/Properties/Resources.Designer.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PreviewHandlerWPF.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("PreviewHandlerWPF.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; + } + } + } +} diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/Properties/Resources.resx Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/Properties/Settings.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/Properties/Settings.Designer.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PreviewHandlerWPF.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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 -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/Properties/Settings.settings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/Properties/Settings.settings Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/ThreadSafeObservableCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/ThreadSafeObservableCollection.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,181 @@ +using System; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Threading; +using System.Windows; +using System.Windows.Threading; + +namespace PreviewHandlerWPF +{ + public class ThreadSafeObservableCollection : ObservableCollection + { + private readonly Dispatcher _dispatcher; + private readonly ReaderWriterLock _lock; + + public ThreadSafeObservableCollection() + { + _dispatcher = Dispatcher.CurrentDispatcher; + if (_dispatcher != Application.Current.Dispatcher) + _dispatcher = Application.Current.Dispatcher; + _lock = new ReaderWriterLock(); + } + + protected override void ClearItems() + { + if (_dispatcher.CheckAccess()) + { + LockCookie c = _lock.UpgradeToWriterLock(-1); + base.ClearItems(); + _lock.DowngradeFromWriterLock(ref c); + } + else + { + _dispatcher.Invoke(DispatcherPriority.Input, (SendOrPostCallback) delegate { Clear(); }, null); + } + } + + protected override void InsertItem(int index, T item) + { + if (_dispatcher.CheckAccess()) + { + if (index > Count) + return; + LockCookie c = _lock.UpgradeToWriterLock(-1); + base.InsertItem(index, item); + _lock.DowngradeFromWriterLock(ref c); + } + else + { + var e = new object[] {index, item}; + _dispatcher.Invoke(DispatcherPriority.Input, (SendOrPostCallback) delegate { InsertItemImpl(e); }, e); + } + } + + private void InsertItemImpl(object[] e) + { + if (_dispatcher.CheckAccess()) + { + InsertItem((int) e[0], (T) e[1]); + } + else + { + _dispatcher.Invoke(DispatcherPriority.Input, (SendOrPostCallback) delegate { InsertItemImpl(e); }); + } + } + + protected override void MoveItem(int oldIndex, int newIndex) + { + if (_dispatcher.CheckAccess()) + { + if (oldIndex >= Count | newIndex >= Count | oldIndex == newIndex) + return; + LockCookie c = _lock.UpgradeToWriterLock(-1); + base.MoveItem(oldIndex, newIndex); + _lock.DowngradeFromWriterLock(ref c); + } + else + { + var e = new object[] {oldIndex, newIndex}; + _dispatcher.Invoke(DispatcherPriority.Input, (SendOrPostCallback) delegate { MoveItemImpl(e); }, e); + } + } + + private void MoveItemImpl(object[] e) + { + if (_dispatcher.CheckAccess()) + { + MoveItem((int) e[0], (int) e[1]); + } + else + { + _dispatcher.Invoke(DispatcherPriority.Input, (SendOrPostCallback) delegate { MoveItemImpl(e); }); + } + } + + protected override void RemoveItem(int index) + { + if (_dispatcher.CheckAccess()) + { + if (index >= Count) + return; + LockCookie c = _lock.UpgradeToWriterLock(-1); + base.RemoveItem(index); + _lock.DowngradeFromWriterLock(ref c); + } + else + { + _dispatcher.Invoke(DispatcherPriority.Input, (SendOrPostCallback) delegate { RemoveItem(index); }, index); + } + } + + protected override void SetItem(int index, T item) + { + if (_dispatcher.CheckAccess()) + { + LockCookie c = _lock.UpgradeToWriterLock(-1); + base.SetItem(index, item); + _lock.DowngradeFromWriterLock(ref c); + } + else + { + var e = new object[] {index, item}; + _dispatcher.Invoke(DispatcherPriority.Input, (SendOrPostCallback) delegate { SetItemImpl(e); }, e); + } + } + + private void SetItemImpl(object[] e) + { + if (_dispatcher.CheckAccess()) + { + SetItem((int) e[0], (T) e[1]); + } + else + { + _dispatcher.Invoke(DispatcherPriority.Input, (SendOrPostCallback) delegate { SetItemImpl(e); }); + } + } + + public override event NotifyCollectionChangedEventHandler CollectionChanged; + + protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) + { + if (CollectionChanged != null) + { + using (IDisposable locker = BlockReentrancy()) + { + foreach (Delegate invoker in CollectionChanged.GetInvocationList()) + { + var handler = (NotifyCollectionChangedEventHandler) invoker; + var dispatcherInvoker = invoker.Target as DispatcherObject; + var syncInvoker = invoker.Target as ISynchronizeInvoke; + if (dispatcherInvoker != null) + { + dispatcherInvoker.Dispatcher.Invoke(DispatcherPriority.DataBind, + (NotifyCollectionChangedEventHandler) + delegate(object s, NotifyCollectionChangedEventArgs ex) { handler(s, ex); }, this, e); + } + else if (syncInvoker != null) + { + syncInvoker.Invoke(invoker, new object[] {this, e}); + } + else + { + handler(this, e); + } + } + } + } + } + + + public T[] ToSyncArray() + { + _lock.AcquireReaderLock(-1); + var _sync = new T[Count]; + CopyTo(_sync, 0); + _lock.ReleaseReaderLock(); + return _sync; + } + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/Window1.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/Window1.xaml Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/Window1.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/Window1.xaml.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,22 @@ +using System.Windows; + +namespace PreviewHandlerWPF +{ + /// + /// Interaction logic for Window1.xaml + /// + public partial class Window1 : Window + { + public Window1() + { + InitializeComponent(); + PreviewersManager.GetAllPreviewers(); + } + + //private void BrowseButton_Click(object sender, RoutedEventArgs e) + //{ + // FolderBrowserDialog dialog = new FolderBrowserDialog(); + // DialogResult dialogResult = dialog.ShowDialog(); + //} + } +} \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/WordPreviewHandler.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/WordPreviewHandler.cs Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Windows.Interop; + +namespace PreviewHandlerWPF +{ + public abstract class PreviewHandler : IPreviewHandler, IPreviewHandlerVisuals, IOleWindow, IObjectWithSite + { + + } + + public abstract class StreamBasedPreviewHandler : PreviewHandler, IInitializeWithStream + { + + } + + public abstract class FileBasedPreviewHandler : PreviewHandler, IInitializeWithFile + { + + } + +#region interop + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("8895b1c6-b41f-4c1c-a562-0d564250836f")] + interface IPreviewHandler + { + void SetWindow(IntPtr hwnd, ref RECT rect); + void SetRect(ref RECT rect); + void DoPreview(); + void Unload(); + void SetFocus(); + void QueryFocus(out IntPtr phwnd); + [PreserveSig] + uint TranslateAccelerator(ref MSG pmsg); + } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("8327b13c-b63f-4b24-9b8a-d010dcc3f599")] + interface IPreviewHandlerVisuals + { + void SetBackgroundColor(COLORREF color); + void SetFont(ref LOGFONT plf); + void SetTextColor(COLORREF color); + } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("b7d14566-0509-4cce-a71f-0a554233bd9b")] + interface IInitializeWithFile + { + void Initialize([MarshalAs(UnmanagedType.LPWStr)] string pszFilePath, uint grfMode); + } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("b824b49d-22ac-4161-ac8a-9916e8fa3f7f")] + interface IInitializeWithStream + { + void Initialize(IStream pstream, uint grfMode); + } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("fc4801a3-2ba9-11cf-a229-00aa003d7352")] + public interface IObjectWithSite + { + void SetSite([In, MarshalAs(UnmanagedType.IUnknown)] object pUnkSite); + void GetSite(ref Guid riid, + [MarshalAs(UnmanagedType.IUnknown)] out object ppvSite); + } + + [ComImport] + [Guid("00000114-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IOleWindow + { + void GetWindow(out IntPtr phwnd); + void ContextSensitiveHelp( + [MarshalAs(UnmanagedType.Bool)] bool fEnterMode); + } + + [StructLayout(LayoutKind.Sequential)] + public struct RECT + { + public int left; + public int top; + public int right; + public int bottom; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + public class LOGFONT + { + public int lfHeight; + public int lfWidth; + public int lfEscapement; + public int lfOrientation; + public int lfWeight; + public byte lfItalic; + public byte lfUnderline; + public byte lfStrikeOut; + public byte lfCharSet; + public byte lfOutPrecision; + public byte lfClipPrecision; + public byte lfQuality; + public byte lfPitchAndFamily; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)] + public string lfFaceName; + } + + [StructLayout(LayoutKind.Sequential)] + struct COLORREF + { + public byte R; + public byte G; + public byte B; + } +#endregion +} diff -r 8bb84cc9ba3f -r e84dc4926a5a PreviewHandlerWPF/PreviewHandlerWPF/app.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PreviewHandlerWPF/PreviewHandlerWPF/app.config Fri Apr 27 08:44:37 2012 +0100 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 8bb84cc9ba3f -r e84dc4926a5a SilverlightValidation.sln --- a/SilverlightValidation.sln Thu Apr 26 13:23:35 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightValidation", "SilverlightValidation\SilverlightValidation.csproj", "{0C1CC1FC-915A-4428-8952-CDC79EABC3F4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightValidation.Web", "SilverlightValidation.Web\SilverlightValidation.Web.csproj", "{E65C6757-932B-4D01-9A8A-6D02F8FAA25A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightGlimpse", "SilverlightGlimpse\SilverlightGlimpse.csproj", "{BB51026B-2864-4389-AACA-0BBDF1926E46}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0C1CC1FC-915A-4428-8952-CDC79EABC3F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C1CC1FC-915A-4428-8952-CDC79EABC3F4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C1CC1FC-915A-4428-8952-CDC79EABC3F4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C1CC1FC-915A-4428-8952-CDC79EABC3F4}.Release|Any CPU.Build.0 = Release|Any CPU - {E65C6757-932B-4D01-9A8A-6D02F8FAA25A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E65C6757-932B-4D01-9A8A-6D02F8FAA25A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E65C6757-932B-4D01-9A8A-6D02F8FAA25A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E65C6757-932B-4D01-9A8A-6D02F8FAA25A}.Release|Any CPU.Build.0 = Release|Any CPU - {BB51026B-2864-4389-AACA-0BBDF1926E46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB51026B-2864-4389-AACA-0BBDF1926E46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB51026B-2864-4389-AACA-0BBDF1926E46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB51026B-2864-4389-AACA-0BBDF1926E46}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal