changeset 88:e84dc4926a5a

OSL work from 2011
author stevenhollidge <stevenhollidge@hotmail.com>
date Fri, 27 Apr 2012 08:44:37 +0100
parents 8bb84cc9ba3f
children 3c67e54e3a17
files .hgignore OslFileMonitorService/DatabaseScript.sql OslFileMonitorService/OslFileMonitorService.sln OslFileMonitorService/OslFileMonitorService.zip OslFileMonitorService/OslFileMonitorService/App.config OslFileMonitorService/OslFileMonitorService/DataAccess.cs OslFileMonitorService/OslFileMonitorService/FileMonitorService.cs OslFileMonitorService/OslFileMonitorService/Lib/NLog.dll OslFileMonitorService/OslFileMonitorService/NLog.config OslFileMonitorService/OslFileMonitorService/OslFileMonitorService.csproj OslFileMonitorService/OslFileMonitorService/OslServiceInstaller.cs OslFileMonitorService/OslFileMonitorService/Program.cs OslFileMonitorService/OslFileMonitorService/Properties/AssemblyInfo.cs OslFileMonitorService/OslFileMonitorService/Settings.cs OslFileMonitorService/OslFileMonitorService_Setup/OslFileMonitorService_Setup.vdproj OslFileMonitorService/resources.txt PreviewHandlerWPF/PreviewHandlerWPF.sln PreviewHandlerWPF/PreviewHandlerWPF/App.xaml PreviewHandlerWPF/PreviewHandlerWPF/App.xaml.cs PreviewHandlerWPF/PreviewHandlerWPF/ListManager.cs PreviewHandlerWPF/PreviewHandlerWPF/PreviewHandlerWPF.csproj PreviewHandlerWPF/PreviewHandlerWPF/PreviewersManager.cs PreviewHandlerWPF/PreviewHandlerWPF/Properties/AssemblyInfo.cs PreviewHandlerWPF/PreviewHandlerWPF/Properties/Resources.Designer.cs PreviewHandlerWPF/PreviewHandlerWPF/Properties/Resources.resx PreviewHandlerWPF/PreviewHandlerWPF/Properties/Settings.Designer.cs PreviewHandlerWPF/PreviewHandlerWPF/Properties/Settings.settings PreviewHandlerWPF/PreviewHandlerWPF/ThreadSafeObservableCollection.cs PreviewHandlerWPF/PreviewHandlerWPF/Window1.xaml PreviewHandlerWPF/PreviewHandlerWPF/Window1.xaml.cs PreviewHandlerWPF/PreviewHandlerWPF/WordPreviewHandler.cs PreviewHandlerWPF/PreviewHandlerWPF/app.config SilverlightValidation.sln
diffstat 33 files changed, 2655 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- 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
--- /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
--- /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
Binary file OslFileMonitorService/OslFileMonitorService.zip has changed
--- /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 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+  <appSettings>
+    <add key="ApplicationName" value="Osl File Monitor Service" />
+    <add key="MonitorPath" value="D:\xml" />
+    <add key="MonitorFilter" value="*.*" />
+    <add key="MonitorIncludeSubs" value="false" />
+  </appSettings>
+  <connectionStrings>
+    <add name="db1" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=FileMonitoring;User Id=sa;Password=password;" />
+  </connectionStrings>
+</configuration>
\ No newline at end of file
--- /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
--- /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);
+            }
+        }
+
+        /// <summary>
+        /// Stop this service.
+        /// </summary>
+        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
Binary file OslFileMonitorService/OslFileMonitorService/Lib/NLog.dll has changed
--- /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 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" 
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+  <targets>
+    <target name="file" xsi:type="File" fileName="${basedir}/log.txt" layout="${date:format=dd-MM-yyyy HH\:mm\:ss} | ${level:uppercase=true} | ${message}" />
+  </targets>
+
+  <rules>
+    <logger name="*" minlevel="Trace" writeTo="file" />
+  </rules>
+</nlog>
\ No newline at end of file
--- /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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{F860BBC3-5715-47CD-BF90-FE92C4217727}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>OslFileMonitorService</RootNamespace>
+    <AssemblyName>OslFileMonitorService</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject>OslFileMonitorService.Program</StartupObject>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Debug\OslFileMonitorService.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\OslFileMonitorService.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>Lib\NLog.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Configuration.Install" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Management" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.ServiceProcess" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DataAccess.cs" />
+    <Compile Include="FileMonitorService.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="OslServiceInstaller.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="Settings.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="NLog.config">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+      <SubType>Designer</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Lib\NLog.dll" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file
--- /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>
+    /// Summary description for ProjectInstaller.
+    /// </summary>
+    [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 [<service>.exe]");
+        }
+    }
+}
\ No newline at end of file
--- /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
+    {
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        private static void Main()
+        {
+            ServiceBase.Run(new FileMonitorService());
+        }
+    }
+}
\ No newline at end of file
--- /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
--- /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
--- /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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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:<VsdDialogDir>\\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"
+                {
+                }
+            }
+        }
+    }
+}
--- /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
--- /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
--- /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 @@
+<Application x:Class="PreviewHandlerWPF.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="Window1.xaml">
+	<Application.Resources></Application.Resources>
+</Application>
\ No newline at end of file
--- /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
+{
+    /// <summary>
+    /// Interaction logic for App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}
\ No newline at end of file
--- /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<string>
+    {
+        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
--- /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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.21022</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{8CAEAD2F-BE5B-4A8A-97CE-958AFACEAE33}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>PreviewHandlerWPF</RootNamespace>
+    <AssemblyName>PreviewHandlerWPF</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xaml" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="WindowsBase" />
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Page Include="Window1.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Window1.xaml.cs">
+      <DependentUpon>Window1.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ListManager.cs" />
+    <Compile Include="PreviewersManager.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <Compile Include="ThreadSafeObservableCollection.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <None Include="app.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <AppDesigner Include="Properties\" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file
--- /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<Previewer> CurrentPreviewers;
+
+        public static IPreviewHandler pHandler;
+
+        public static void GetAllPreviewers()
+        {
+            using (
+                RegistryKey rk =
+                    Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers"))
+            {
+                CurrentPreviewers = new List<Previewer>();
+
+                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
--- /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 
+//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
+//inside a <PropertyGroup>.  For example, if you are using US english
+//in your source files, set the <UICulture> 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
--- /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 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     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.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PreviewHandlerWPF.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // 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() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [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;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}
--- /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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file
--- /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 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     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.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+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;
+            }
+        }
+    }
+}
--- /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 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>
\ No newline at end of file
--- /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<T> : ObservableCollection<T>
+    {
+        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
--- /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 @@
+<Window x:Class="PreviewHandlerWPF.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:l="clr-namespace:PreviewHandlerWPF" Title="Window1">
+	<Window.Resources>
+		<l:ListManager x:Key="mng" />
+		<l:FileNameConverter x:Key="conv" />
+		<DataTemplate x:Key="fileTpl">
+			<TextBlock Text="{Binding Converter={StaticResource conv}}" />
+		</DataTemplate>
+	</Window.Resources>
+	<Grid DataContext="{StaticResource mng}">
+		<Grid.ColumnDefinitions>
+			<ColumnDefinition Width=".2*" />
+			<ColumnDefinition Width=".8*" />
+		</Grid.ColumnDefinitions>
+		<ListBox ItemsSource="{Binding}" ItemTemplate="{StaticResource fileTpl}" IsSynchronizedWithCurrentItem="True" />
+		<l:WPFPreviewHandler Grid.Column="1" Content="{Binding Path=/}" />
+		<GridSplitter Width="5" />
+	</Grid>
+</Window>
\ No newline at end of file
--- /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
+{
+    /// <summary>
+    /// Interaction logic for Window1.xaml
+    /// </summary>
+    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
--- /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
+}
--- /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 @@
+<?xml version="1.0"?>
+
+<configuration>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
+  </startup>
+</configuration>
\ No newline at end of file
--- 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