From 304ffd7ee1258dd66875344d919949009f05d415 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Thu, 19 Jun 2014 13:59:31 +1000 Subject: [PATCH] Remove depreciated projects/libraries --- .../Disco.Configuration.vbproj | 116 ------ .../My Project/Application.Designer.vb | 13 - .../My Project/Application.myapp | 10 - .../My Project/AssemblyInfo.vb | 35 -- .../My Project/Resources.Designer.vb | 62 ---- Disco.Configuration/My Project/Resources.resx | 117 ------ .../My Project/Settings.Designer.vb | 73 ---- .../My Project/Settings.settings | 7 - Disco.Logging/App.config | 14 - Disco.Logging/Disco.Logging.csproj | 125 ------- Disco.Logging/LogBase.cs | 43 --- Disco.Logging/LogContext.cs | 311 ---------------- Disco.Logging/LogReInitalizeJob.cs | 20 - Disco.Logging/Models/LogEvent.cs | 22 -- Disco.Logging/Models/LogEventType.cs | 66 ---- Disco.Logging/Models/LogLiveEvent.cs | 57 --- Disco.Logging/Models/LogModule.cs | 21 -- Disco.Logging/Properties/AssemblyInfo.cs | 36 -- Disco.Logging/ReadLogContext.cs | 179 --------- Disco.Logging/SystemLog.cs | 126 ------- Disco.Logging/Targets/LogLiveContext.cs | 55 --- Disco.Logging/Targets/LogPersistContext.cs | 23 -- Disco.Logging/Utilities.cs | 263 ------------- Disco.Logging/packages.config | 9 - Disco.Silverlight.AttachmentUpload/App.xaml | 14 - .../App.xaml.vb | 37 -- .../Assets/Styles.xaml | 350 ------------------ .../Assets/dropTarget.png | Bin 13871 -> 0 bytes .../Disco.Silverlight.AttachmentUpload.sln | 20 - .../Disco.Silverlight.AttachmentUpload.vbproj | 194 ---------- .../FileUploader.vb | 77 ---- .../JavascriptNavigator.vb | 24 -- .../MainPage.xaml | 37 -- .../MainPage.xaml.vb | 60 --- .../My Project/AppManifest.xml | 7 - .../My Project/AssemblyInfo.vb | 34 -- .../Utilities.vb | 151 -------- .../Views/ErrorWindow.xaml | 34 -- .../Views/ErrorWindow.xaml.vb | 27 -- .../Views/File.xaml | 24 -- .../Views/File.xaml.vb | 62 ---- .../Views/FileWindow.xaml | 50 --- .../Views/FileWindow.xaml.vb | 55 --- .../Views/Hidden.xaml | 14 - .../Views/Hidden.xaml.vb | 13 - .../Views/WebCam.xaml | 48 --- .../Views/WebCam.xaml.vb | 149 -------- .../WriteableBitmapExtensions.vb | 40 -- Disco.Utilities/Disco.Utilities.vbproj | 175 --------- Disco.Utilities/ModuleMain.vb | 131 ------- .../My Project/Application.Designer.vb | 13 - Disco.Utilities/My Project/Application.myapp | 10 - Disco.Utilities/My Project/AssemblyInfo.vb | 35 -- .../My Project/Resources.Designer.vb | 63 ---- Disco.Utilities/My Project/Resources.resx | 117 ------ .../My Project/Settings.Designer.vb | 73 ---- Disco.Utilities/My Project/Settings.settings | 7 - Disco.Utilities/My Project/app.manifest | 48 --- Disco.Utilities/app.config | 32 -- Disco.Utilities/packages.config | 4 - 60 files changed, 4032 deletions(-) delete mode 100644 Disco.Configuration/Disco.Configuration.vbproj delete mode 100644 Disco.Configuration/My Project/Application.Designer.vb delete mode 100644 Disco.Configuration/My Project/Application.myapp delete mode 100644 Disco.Configuration/My Project/AssemblyInfo.vb delete mode 100644 Disco.Configuration/My Project/Resources.Designer.vb delete mode 100644 Disco.Configuration/My Project/Resources.resx delete mode 100644 Disco.Configuration/My Project/Settings.Designer.vb delete mode 100644 Disco.Configuration/My Project/Settings.settings delete mode 100644 Disco.Logging/App.config delete mode 100644 Disco.Logging/Disco.Logging.csproj delete mode 100644 Disco.Logging/LogBase.cs delete mode 100644 Disco.Logging/LogContext.cs delete mode 100644 Disco.Logging/LogReInitalizeJob.cs delete mode 100644 Disco.Logging/Models/LogEvent.cs delete mode 100644 Disco.Logging/Models/LogEventType.cs delete mode 100644 Disco.Logging/Models/LogLiveEvent.cs delete mode 100644 Disco.Logging/Models/LogModule.cs delete mode 100644 Disco.Logging/Properties/AssemblyInfo.cs delete mode 100644 Disco.Logging/ReadLogContext.cs delete mode 100644 Disco.Logging/SystemLog.cs delete mode 100644 Disco.Logging/Targets/LogLiveContext.cs delete mode 100644 Disco.Logging/Targets/LogPersistContext.cs delete mode 100644 Disco.Logging/Utilities.cs delete mode 100644 Disco.Logging/packages.config delete mode 100644 Disco.Silverlight.AttachmentUpload/App.xaml delete mode 100644 Disco.Silverlight.AttachmentUpload/App.xaml.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/Assets/Styles.xaml delete mode 100644 Disco.Silverlight.AttachmentUpload/Assets/dropTarget.png delete mode 100644 Disco.Silverlight.AttachmentUpload/Disco.Silverlight.AttachmentUpload.sln delete mode 100644 Disco.Silverlight.AttachmentUpload/Disco.Silverlight.AttachmentUpload.vbproj delete mode 100644 Disco.Silverlight.AttachmentUpload/FileUploader.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/JavascriptNavigator.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/MainPage.xaml delete mode 100644 Disco.Silverlight.AttachmentUpload/MainPage.xaml.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/My Project/AppManifest.xml delete mode 100644 Disco.Silverlight.AttachmentUpload/My Project/AssemblyInfo.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/Utilities.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/ErrorWindow.xaml delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/ErrorWindow.xaml.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/File.xaml delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/File.xaml.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/FileWindow.xaml delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/FileWindow.xaml.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/Hidden.xaml delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/Hidden.xaml.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/WebCam.xaml delete mode 100644 Disco.Silverlight.AttachmentUpload/Views/WebCam.xaml.vb delete mode 100644 Disco.Silverlight.AttachmentUpload/WriteableBitmapExtensions.vb delete mode 100644 Disco.Utilities/Disco.Utilities.vbproj delete mode 100644 Disco.Utilities/ModuleMain.vb delete mode 100644 Disco.Utilities/My Project/Application.Designer.vb delete mode 100644 Disco.Utilities/My Project/Application.myapp delete mode 100644 Disco.Utilities/My Project/AssemblyInfo.vb delete mode 100644 Disco.Utilities/My Project/Resources.Designer.vb delete mode 100644 Disco.Utilities/My Project/Resources.resx delete mode 100644 Disco.Utilities/My Project/Settings.Designer.vb delete mode 100644 Disco.Utilities/My Project/Settings.settings delete mode 100644 Disco.Utilities/My Project/app.manifest delete mode 100644 Disco.Utilities/app.config delete mode 100644 Disco.Utilities/packages.config diff --git a/Disco.Configuration/Disco.Configuration.vbproj b/Disco.Configuration/Disco.Configuration.vbproj deleted file mode 100644 index c0e685e6..00000000 --- a/Disco.Configuration/Disco.Configuration.vbproj +++ /dev/null @@ -1,116 +0,0 @@ - - - - Debug - AnyCPU - - - - - {CD7BB28C-B74D-4880-8B7E-4487AB5E6AFC} - Library - Disco.Configuration - Disco.Configuration - 512 - Windows - v4.0 - - - true - full - true - true - bin\Debug\ - Disco.Configuration.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - Disco.Configuration.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - {40F222A9-CC05-4035-AFF4-15A78250EF2B} - Disco.Models - - - - - \ No newline at end of file diff --git a/Disco.Configuration/My Project/Application.Designer.vb b/Disco.Configuration/My Project/Application.Designer.vb deleted file mode 100644 index 6b885653..00000000 --- a/Disco.Configuration/My Project/Application.Designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.235 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/Disco.Configuration/My Project/Application.myapp b/Disco.Configuration/My Project/Application.myapp deleted file mode 100644 index 758895de..00000000 --- a/Disco.Configuration/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 1 - true - diff --git a/Disco.Configuration/My Project/AssemblyInfo.vb b/Disco.Configuration/My Project/AssemblyInfo.vb deleted file mode 100644 index 2b667b73..00000000 --- a/Disco.Configuration/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports 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. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' 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: -' - - - diff --git a/Disco.Configuration/My Project/Resources.Designer.vb b/Disco.Configuration/My Project/Resources.Designer.vb deleted file mode 100644 index d6f10bb4..00000000 --- a/Disco.Configuration/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.235 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My.Resources - - '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. - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Disco.Configuration.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/Disco.Configuration/My Project/Resources.resx b/Disco.Configuration/My Project/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/Disco.Configuration/My Project/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Disco.Configuration/My Project/Settings.Designer.vb b/Disco.Configuration/My Project/Settings.Designer.vb deleted file mode 100644 index 7cf5ba83..00000000 --- a/Disco.Configuration/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.235 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.Disco.Configuration.My.MySettings - Get - Return Global.Disco.Configuration.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/Disco.Configuration/My Project/Settings.settings b/Disco.Configuration/My Project/Settings.settings deleted file mode 100644 index 85b890b3..00000000 --- a/Disco.Configuration/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Disco.Logging/App.config b/Disco.Logging/App.config deleted file mode 100644 index c4747432..00000000 --- a/Disco.Logging/App.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - -
- - - - - - - - - \ No newline at end of file diff --git a/Disco.Logging/Disco.Logging.csproj b/Disco.Logging/Disco.Logging.csproj deleted file mode 100644 index 8ac908b5..00000000 --- a/Disco.Logging/Disco.Logging.csproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {BD16C575-70C2-4DDE-A572-FC79EF028CB2} - Library - Properties - Disco.Logging - Disco.Logging - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\packages\EntityFramework.4.3.1\lib\net40\EntityFramework.dll - - - ..\..\Resources\Libraries\fastJSON\fastJSON.dll - - - True - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - False - ..\packages\Newtonsoft.Json.4.5.1\lib\net40\Newtonsoft.Json.dll - - - ..\..\Resources\Libraries\Quartz\Quartz.dll - - - False - ..\packages\SignalR.Server.0.4.0.0\lib\net40\SignalR.dll - - - ..\packages\SignalR.Hosting.AspNet.0.4.0.0\lib\net40\SignalR.Hosting.AspNet.dll - - - - - - - True - ..\packages\SqlServerCompact.4.0.8482.1\lib\System.Data.SqlServerCe.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - {85A6BD19-2C64-4746-8F2C-A68A86E8C2D7} - Disco.Data - - - {FBC05512-FCCA-4B16-9E76-8C413C5DE6C9} - Disco.Models - - - - - - - - - - - - - - -REM if not exist "$(TargetDir)x86" md "$(TargetDir)x86" -REM xcopy /s /y "$(SolutionDir)packages\SqlServerCompact.4.0.8482.1\NativeBinaries\x86\*.*" "$(TargetDir)x86" -REM if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64" -REM xcopy /s /y "$(SolutionDir)packages\SqlServerCompact.4.0.8482.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64" - - - \ No newline at end of file diff --git a/Disco.Logging/LogBase.cs b/Disco.Logging/LogBase.cs deleted file mode 100644 index fa382519..00000000 --- a/Disco.Logging/LogBase.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Disco.Logging -{ - public abstract class LogBase - { - private Dictionary _EventTypes; - - public LogBase() - { - // Cache Event Types - _EventTypes = this.LoadEventTypes().ToDictionary(et => et.Id); - } - - public abstract int ModuleId { get; } - public abstract string ModuleName { get; } - public abstract string ModuleDescription { get; } - protected abstract List LoadEventTypes(); - - public Dictionary EventTypes - { - get - { - return _EventTypes; - } - } - protected void Log(int EventTypeId, params object[] Args) - { - LogContext.Current.Log(this.ModuleId, EventTypeId, Args); - } - public string LiveLogGroupName - { - get - { - return this.ModuleName; - } - } - - } -} diff --git a/Disco.Logging/LogContext.cs b/Disco.Logging/LogContext.cs deleted file mode 100644 index b0eb82aa..00000000 --- a/Disco.Logging/LogContext.cs +++ /dev/null @@ -1,311 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Disco.Data.Repository; -using System.IO; -using System.Management; -using System.Diagnostics; -using System.Data.SqlServerCe; -using System.Data.EntityClient; -using System.Data.Entity; -using Quartz; -using Quartz.Impl; -using Quartz.Impl.Triggers; - -namespace Disco.Logging -{ - public class LogContext - { - public static Dictionary LogModules { get; private set; } - private static object _LogModulesLock = new object(); - - private static LogContext _Current; - private static object _CurrentLock = new Object(); - public static LogContext Current - { - get - { - lock (_CurrentLock) - { - if (_Current == null) - throw new InvalidOperationException("Logging Context has not been Initialized"); - return _Current; - } - } - private set - { - lock (_CurrentLock) - { - _Current = value; - } - } - } - - private static void InitalizeModules() - { - if (LogModules == null) - { - lock (_LogModulesLock) - { - if (LogModules == null) - { - LogModules = new Dictionary(); - // Load all LogModules (Only from Disco Assemblies) - var appDomain = AppDomain.CurrentDomain; - - var logModuleTypes = (from a in appDomain.GetAssemblies() - where !a.GlobalAssemblyCache && !a.IsDynamic && a.FullName.StartsWith("Disco.", StringComparison.InvariantCultureIgnoreCase) - from type in a.GetTypes() - where typeof(LogBase).IsAssignableFrom(type) && !type.IsAbstract - select type); - foreach (var logModuleType in logModuleTypes) - { - var instance = (LogBase)Activator.CreateInstance(logModuleType); - LogModules[instance.ModuleId] = instance; - } - } - } - } - } - - private static void InitalizeDatabase(Targets.LogPersistContext logDbContext) - { - // Add Modules - var existingModules = logDbContext.Modules.Include("EventTypes").ToDictionary(m => m.Id); - foreach (var module in LogModules) - { - // Update/Insert Module - Models.LogModule dbModule; - if (existingModules.TryGetValue(module.Key, out dbModule)) - { - // Update - if (dbModule.Name != module.Value.ModuleName) - dbModule.Name = module.Value.ModuleName; - if (dbModule.Description != module.Value.ModuleDescription) - dbModule.Description = module.Value.ModuleDescription; - } - else - { - // Insert - dbModule = new Models.LogModule() - { - Id = module.Key, - Name = module.Value.ModuleName, - Description = module.Value.ModuleDescription - }; - logDbContext.Modules.Add(dbModule); - } - // Update/Insert Event Types - Dictionary existingEventTypes = (dbModule.EventTypes == null) ? new Dictionary() : dbModule.EventTypes.ToDictionary(et => et.Id); - foreach (var eventType in module.Value.EventTypes) - { - Models.LogEventType dbEventType; - if (existingEventTypes.TryGetValue(eventType.Key, out dbEventType)) - { - // Update - if (dbEventType.Name != eventType.Value.Name) - dbEventType.Name = eventType.Value.Name; - if (dbEventType.Severity != eventType.Value.Severity) - dbEventType.Severity = eventType.Value.Severity; - if (dbEventType.Format != eventType.Value.Format) - dbEventType.Format = eventType.Value.Format; - } - else - { - // Insert - dbEventType = new Models.LogEventType() - { - Id = eventType.Key, - ModuleId = module.Key, - Name = eventType.Value.Name, - Severity = eventType.Value.Severity, - Format = eventType.Value.Format - }; - logDbContext.EventTypes.Add(dbEventType); - } - } - } - - logDbContext.SaveChanges(); - } - - public static string LogFileBasePath(DiscoDataContext DiscoContext) - { - var logDirectoryBase = Path.Combine(DiscoContext.DiscoConfiguration.DataStoreLocation, "Logs"); - // Create Directory Structure - if (!Directory.Exists(logDirectoryBase)) - { - Directory.CreateDirectory(logDirectoryBase); - } - // Ensure Logs are NTFS Compressed - TODO... - //Utilities.CompressDirectory(logDirectory); - // WMI - Doesn't Work for Network Folders... - //var logDirectoryBaseInfo = new DirectoryInfo(logDirectoryBase); - //if ((logDirectoryBaseInfo.Attributes & FileAttributes.Compressed) != FileAttributes.Compressed) - //{ - // var logDirectoryWmiPath = string.Format("Win32_Directory.Name=\"{0}\"", logDirectoryBase); - // using (ManagementObject logDirectoryBaseMO = new ManagementObject(logDirectoryWmiPath)) - // { - // ManagementBaseObject outParams = logDirectoryBaseMO.InvokeMethod("Compress", null, null); - // Debug.WriteLine("LoggingContext.InitalizeCurrent: Compressing Log Folder; Result: " + outParams.Properties["ReturnValue"].Value.ToString()); - // } - //} - return logDirectoryBase; - } - - public static string LogFilePath(DiscoDataContext DiscoContext, DateTime Date, bool CreateDirectory = true) - { - var logDirectoryBase = LogFileBasePath(DiscoContext); - var logDirectory = Path.Combine(logDirectoryBase, Date.Year.ToString()); - if (CreateDirectory && !Directory.Exists(logDirectory)) - { - Directory.CreateDirectory(logDirectory); - } - var logFileName = string.Format("DiscoLog_{0:yyy-MM-dd}.sdf", Date); - return Path.Combine(logDirectory, logFileName); - } - - internal static void ReInitalize(DiscoDataContext DiscoContext) - { - lock (_CurrentLock) - { - var logPath = LogFilePath(DiscoContext, DateTime.Today); - - //var connectionString = string.Format("Data Source=\"{0}\"", logPath); - - SqlCeConnectionStringBuilder sqlCeCSB = new SqlCeConnectionStringBuilder(); - sqlCeCSB.DataSource = logPath; - var connectionString = sqlCeCSB.ToString(); - - // Ensure Database Exists - if (!File.Exists(logPath)) - { - // Create Database - using (var context = new Targets.LogPersistContext(connectionString)) - { - context.Database.CreateIfNotExists(); - } - } - - // Add Modules/Event Types - InitalizeModules(); - using (var context = new Targets.LogPersistContext(connectionString)) - { - InitalizeDatabase(context); - } - - // Create Current LogContext - var currentLogContext = new LogContext(logPath, connectionString); - _Current = currentLogContext; - } - SystemLog.LogLogInitialized(_Current.PersistantStorePath); - try - { - // Get Yesterdays Log - var yesterdaysLogPath = LogFilePath(DiscoContext, DateTime.Today.AddDays(-1), false); - if (File.Exists(yesterdaysLogPath)) - { - SqlCeConnectionStringBuilder sqlCeCSB = new SqlCeConnectionStringBuilder(); - sqlCeCSB.DataSource = yesterdaysLogPath; - var connectionString = sqlCeCSB.ToString(); - int logCount; - using (var context = new Targets.LogPersistContext(connectionString)) - { - logCount = context.Events.Where(e => !(e.ModuleId == 0 && e.EventTypeId == 100)).Count(); - if (logCount == 0) - { - // Delete (empty) Database - context.Database.Delete(); - } - } - } - } - catch (Exception ex) - { - SystemLog.LogError("Error occurred while investigating yesterdays log for deletion", ex.GetType().Name, ex.Message, ex.StackTrace); - } - } - - private static IScheduler _ReInitializeScheduler; - public static void Initalize(DiscoDataContext DiscoContext, ISchedulerFactory SchedulerFactory) - { - ReInitalize(DiscoContext); - - _ReInitializeScheduler = SchedulerFactory.GetScheduler(); - - var reInitalizeJobDetail = new JobDetailImpl("DiscoLogContextReinialize", typeof(LogReInitalizeJob)); - - // Simple Trigger - Issue with Day light savings - //var reInitalizeTrigger = TriggerBuilder.Create() - // .WithIdentity("DiscoLogContextReinializeTrigger") - // .StartAt(DateBuilder.TomorrowAt(0,0,0)) - // .WithSchedule(SimpleScheduleBuilder.Create().WithIntervalInHours(24).RepeatForever()) - // .Build(); - // Use Cron Schedule instead - var reInitalizeTrigger = TriggerBuilder.Create() - .WithIdentity("DiscoLogContextReinializeTrigger") - .StartNow() - .WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(0, 0)) // Midnight - .Build(); - - _ReInitializeScheduler.ScheduleJob(reInitalizeJobDetail, reInitalizeTrigger); - } - public static string LiveLogAllEventsGroupName - { - get - { - return Targets.LogLiveContext.LiveLogNameAll; - } - } - - private LogContext(string PersistantStorePath, string PersistantStoreConnectionString) - { - this.PersistantStorePath = PersistantStorePath; - this.PersistantStoreConnectionString = PersistantStoreConnectionString; - } - - public string PersistantStorePath { get; private set; } - public string PersistantStoreConnectionString { get; private set; } - - public void Log(int ModuleId, int EventTypeId, params object[] Args) - { - LogBase logModule; - if (LogModules.TryGetValue(ModuleId, out logModule)) - { - Models.LogEventType eventType; - if (logModule.EventTypes.TryGetValue(EventTypeId, out eventType)) - { - var eventTimestamp = DateTime.Now; - if (eventType.UseLive) - { - Targets.LogLiveContext.Broadcast(logModule, eventType, eventTimestamp, Args); - } - if (eventType.UsePersist) - { - string args = null; - if (Args != null && Args.Length > 0) - args = fastJSON.JSON.Instance.ToJSON(Args, false); - using (var context = new Targets.LogPersistContext(PersistantStoreConnectionString)) - { - var e = new Models.LogEvent() - { - Timestamp = eventTimestamp, - ModuleId = logModule.ModuleId, - EventTypeId = eventType.Id, - Arguments = args - }; - context.Events.Add(e); - context.SaveChanges(); - } - } - } - else - throw new InvalidOperationException(string.Format("Unknown Log Event Type Called: {0} (for Module: {1})", EventTypeId, ModuleId)); - } - else - throw new InvalidOperationException(string.Format("Unknown Log Module Called: {0}", ModuleId)); - } - - } -} diff --git a/Disco.Logging/LogReInitalizeJob.cs b/Disco.Logging/LogReInitalizeJob.cs deleted file mode 100644 index 04767a95..00000000 --- a/Disco.Logging/LogReInitalizeJob.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Quartz; -using Disco.Data.Repository; - -namespace Disco.Logging -{ - class LogReInitalizeJob : IJob - { - public void Execute(IJobExecutionContext context) - { - using (DiscoDataContext DiscoContext = new DiscoDataContext()) - { - LogContext.ReInitalize(DiscoContext); - } - } - } -} diff --git a/Disco.Logging/Models/LogEvent.cs b/Disco.Logging/Models/LogEvent.cs deleted file mode 100644 index bad62688..00000000 --- a/Disco.Logging/Models/LogEvent.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ComponentModel.DataAnnotations; - -namespace Disco.Logging.Models -{ - [Table("Events")] - public class LogEvent - { - [Required, Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public int Id { get; set; } - [Required] - public int ModuleId { get; set; } - [Required] - public int EventTypeId { get; set; } - [Required] - public DateTime Timestamp { get; set; } - public string Arguments { get; set; } - } -} diff --git a/Disco.Logging/Models/LogEventType.cs b/Disco.Logging/Models/LogEventType.cs deleted file mode 100644 index 89ac5bdf..00000000 --- a/Disco.Logging/Models/LogEventType.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ComponentModel.DataAnnotations; - -namespace Disco.Logging.Models -{ - [Table("EventTypes")] - public class LogEventType - { - [Required, Key, Column(Order=0), DatabaseGenerated(DatabaseGeneratedOption.None)] - public int ModuleId { get; set; } - [Required, Key, Column(Order = 1), DatabaseGenerated(DatabaseGeneratedOption.None)] - public int Id { get; set; } - [Required, MaxLength(200)] - public string Name { get; set; } - [Required] - public int Severity { get; set; } - [MaxLength(1024)] - public string Format { get; set; } - - [NotMapped] - public bool UsePersist { get; set; } - [NotMapped] - public bool UseLive { get; set; } - [NotMapped] - public bool UseDisplay { get; set; } - - [ForeignKey("ModuleId")] - public LogModule Module { get; set; } - - public enum Severities - { - Information = 0, - Warning = 1, - Error = 2 - } - - public string FormatMessage(object[] Arguments) - { - - if (Arguments != null && Arguments.Length > 0) - { - if (!string.IsNullOrEmpty(Format)) - { - return string.Format(Format, Arguments); - } - else - { - return Arguments - .Select(v => v == null ? string.Empty : v.ToString()) - .Aggregate((a, b) => a + ", " + (b == null ? string.Empty : b)); - } - } - else - { - if (!string.IsNullOrEmpty(Format)) - { - return Format; - } - } - return string.Empty; - } - } -} diff --git a/Disco.Logging/Models/LogLiveEvent.cs b/Disco.Logging/Models/LogLiveEvent.cs deleted file mode 100644 index 22bdcbf0..00000000 --- a/Disco.Logging/Models/LogLiveEvent.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Collections; - -namespace Disco.Logging.Models -{ - public class LogLiveEvent - { - public int ModuleId { get; set; } - public string ModuleName { get; set; } - public string ModuleDescription { get; set; } - public int EventTypeId { get; set; } - public string EventTypeName { get; set; } - public int EventTypeSeverity { get; set; } - - public DateTime Timestamp { get; set; } - public object[] Arguments { get; set; } - public string FormattedMessage { get; set; } - public string FormattedTimestamp { get; set; } - public bool UseDisplay { get; set; } - - public static LogLiveEvent Create(LogBase logModule, Models.LogEventType eventType, DateTime Timestamp, string jsonArguments) - { - object[] Arguments = null; - if (jsonArguments != null) - { - var alArguments = fastJSON.JSON.Instance.Parse(jsonArguments) as ArrayList; - if (alArguments != null) - { - Arguments = alArguments.ToArray(); - } - } - return Create(logModule, eventType, Timestamp, Arguments); - } - - public static LogLiveEvent Create(LogBase logModule, Models.LogEventType eventType, DateTime Timestamp, params object[] Arguments) - { - return new Models.LogLiveEvent() - { - ModuleId = logModule.ModuleId, - ModuleName = logModule.ModuleName, - ModuleDescription = logModule.ModuleDescription, - EventTypeId = eventType.Id, - EventTypeName = eventType.Name, - EventTypeSeverity = eventType.Severity, - Timestamp = Timestamp, - Arguments = Arguments, - FormattedMessage = eventType.FormatMessage(Arguments), - FormattedTimestamp = Timestamp.ToString("dd/MM/yyy hh:mm:ss tt"), - UseDisplay = eventType.UseDisplay - }; - } - - } -} diff --git a/Disco.Logging/Models/LogModule.cs b/Disco.Logging/Models/LogModule.cs deleted file mode 100644 index ffc8dd41..00000000 --- a/Disco.Logging/Models/LogModule.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ComponentModel.DataAnnotations; - -namespace Disco.Logging.Models -{ - [Table("Modules")] - public class LogModule - { - [Required, Key, DatabaseGenerated(DatabaseGeneratedOption.None)] - public int Id { get; set; } - [Required, MaxLength(200)] - public string Name { get; set; } - [Required, MaxLength(500)] - public string Description { get; set; } - - public virtual IList EventTypes { get; set; } - } -} diff --git a/Disco.Logging/Properties/AssemblyInfo.cs b/Disco.Logging/Properties/AssemblyInfo.cs deleted file mode 100644 index 21404bbc..00000000 --- a/Disco.Logging/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Disco - Logging")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Disco")] -[assembly: AssemblyCopyright("")] -[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("03a4a5bf-60c6-4dff-b623-387043b8be86")] - -// 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.2012.0627.1427")] -[assembly: AssemblyFileVersion("1.2012.0627.1427")] diff --git a/Disco.Logging/ReadLogContext.cs b/Disco.Logging/ReadLogContext.cs deleted file mode 100644 index 81f0a306..00000000 --- a/Disco.Logging/ReadLogContext.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Disco.Logging.Targets; -using Disco.Data.Repository; -using System.IO; -using System.Text.RegularExpressions; -using System.Data.SqlServerCe; -using Disco.Logging.Models; - -namespace Disco.Logging -{ - public class ReadLogContext - { - public DateTime? Start { get; set; } - public DateTime? End { get; set; } - public int? Take { get; set; } - public int? Module { get; set; } - public List EventTypes { get; set; } - - public bool Validate() - { - if (this.Start.HasValue && this.End.HasValue && this.End.Value < this.Start.Value) - throw new ArgumentOutOfRangeException("End", "End must be greater than Start"); - if (this.Start.HasValue && !this.End.HasValue && this.Start > DateTime.Now) - throw new ArgumentOutOfRangeException("Start", "Start must be less than current time"); - - return true; - } - - public List Query(DiscoDataContext DiscoContext) - { - List results = new List(); - - // Validate Options - this.Validate(); - - var relevantLogFiles = RelevantLogFiles(DiscoContext); - relevantLogFiles.Reverse(); - foreach (var logFile in relevantLogFiles) - { - SqlCeConnectionStringBuilder sqlCeCSB = new SqlCeConnectionStringBuilder(); - sqlCeCSB.DataSource = logFile.Item1; - - var logModules = LogContext.LogModules; - - using (var context = new Targets.LogPersistContext(sqlCeCSB.ToString())) - { - var query = this.BuildQuery(context, logFile.Item2, results.Count); - IEnumerable queryResults = query; // Run the Query - results.AddRange(queryResults.Select(le => Models.LogLiveEvent.Create(logModules[le.ModuleId], logModules[le.ModuleId].EventTypes[le.EventTypeId], le.Timestamp, le.Arguments))); - } - if (this.Take.HasValue && this.Take.Value < results.Count) - break; - } - return results; - } - - private static Regex LogFileDateRegex = new Regex("DiscoLog_([0-9]{4})-([0-9]{2})-([0-9]{2}).sdf", RegexOptions.IgnoreCase); - private static DateTime? LogFileDate(string LogFilePath) - { - var fileNameMatch = LogFileDateRegex.Match(LogFilePath); - if (fileNameMatch.Success) - { - return new DateTime(int.Parse(fileNameMatch.Groups[1].Value), - int.Parse(fileNameMatch.Groups[2].Value), - int.Parse(fileNameMatch.Groups[3].Value)); - } - else - { - return null; - } - } - - private List> RelevantLogFiles(DiscoDataContext DiscoContext) - { - List> relevantFiles = new List>(); - var logDirectoryBase = LogContext.LogFileBasePath(DiscoContext); - var logDirectoryBaseInfo = new DirectoryInfo(logDirectoryBase); - var endDate = this.End.HasValue ? this.End.Value : DateTime.Now; - var endDateYear = endDate.Year.ToString(); - - // Try Shortcut ( < 31 Days in Query) - if (this.Start.HasValue) - { - if ((this.End.HasValue && this.End.Value.Subtract(this.Start.Value).Days < 31) || - (!this.End.HasValue && DateTime.Now.Subtract(this.Start.Value).Days < 31)) - { - // Less than 31 Days in Query - Just evaluate each Path - var queryDate = this.Start.Value.Date; - while (queryDate <= endDate) - { - var fileName = LogContext.LogFilePath(DiscoContext, queryDate, false); - if (File.Exists(fileName)) - relevantFiles.Add(new Tuple(fileName, LogFileDate(fileName).Value)); - - queryDate = queryDate.AddDays(1); - } - return relevantFiles; - } - } - - List logYears = new List(); - foreach (var directoryName in logDirectoryBaseInfo.GetDirectories()) - { - int directoryYear; - if (int.TryParse(directoryName.Name, out directoryYear)) - { - logYears.Add(directoryName.Name); - } - } - logYears.Sort(); - - foreach (var logYear in logYears) - { - List logFiles = Directory.EnumerateFiles(Path.Combine(logDirectoryBase, logYear), "DiscoLog_*.sdf").ToList(); - logFiles.Sort(); - if (logYear != endDateYear) - { - foreach (var logFile in logFiles) - { - relevantFiles.Add(new Tuple(logFile, LogFileDate(logFile).Value)); - } - } - else - { - foreach (var logFile in logFiles) - { - var fileNameDate = LogFileDate(logFile); - if (fileNameDate != null) - { - if (fileNameDate.Value < endDate) - { - relevantFiles.Add(new Tuple(logFile, fileNameDate.Value)); - } - else - { - break; // Files are sorted, must be no more... - } - } - } - break; // Years are sorted, must be no more... - } - } - return relevantFiles; - } - - private IQueryable BuildQuery(LogPersistContext LogContext, DateTime LogDate, int Taken) - { - IQueryable query = LogContext.Events.OrderByDescending(le => le.Timestamp); - if (this.Module.HasValue) - { - query = query.Where(le => le.ModuleId == this.Module.Value); - } - if (this.EventTypes != null && this.EventTypes.Count > 0) - { - query = query.Where(le => this.EventTypes.Contains(le.EventTypeId)); - } - if (this.Start.HasValue && this.Start.Value > LogDate) - { - var startValue = DateTime.SpecifyKind(this.Start.Value, DateTimeKind.Local); - query = query.Where(le => le.Timestamp > startValue); - } - if (this.End.HasValue && this.End.Value <= LogDate.AddDays(1)) - { - var endValue = DateTime.SpecifyKind(this.End.Value, DateTimeKind.Local); - query = query.Where(le => le.Timestamp < endValue); - } - if (this.Take.HasValue && this.Take.Value > 0) - { - var take = this.Take.Value - Taken; - query = query.Take(take); - } - return query; - } - - } -} diff --git a/Disco.Logging/SystemLog.cs b/Disco.Logging/SystemLog.cs deleted file mode 100644 index 5b8ddff8..00000000 --- a/Disco.Logging/SystemLog.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Disco.Logging.Models; - -namespace Disco.Logging -{ - public class SystemLog : LogBase - { - private const int _ModuleId = 0; - public enum EventTypeIds : int - { - Information = 0, - Warning = 1, - Error = 2, - Exception = 10, - ExceptionWithInner = 11, - LogInitialized = 100 - } - public static SystemLog Current - { - get - { - return (SystemLog)LogContext.LogModules[_ModuleId]; - } - } - private static void Log(EventTypeIds EventTypeId, params object[] Args) - { - Current.Log((int)EventTypeId, Args); - } - public static void LogInformation(params object[] Messages) - { - Log(EventTypeIds.Information, Messages); - } - public static void LogWarning(params object[] Messages) - { - Log(EventTypeIds.Warning, Messages); - } - public static void LogError(params object[] Messages) - { - Log(EventTypeIds.Error, Messages); - } - public static void LogException(string Component, Exception ex) - { - if (ex.InnerException != null) - { - Log(EventTypeIds.ExceptionWithInner, Component, ex.GetType().Name, ex.Message, ex.StackTrace, ex.InnerException.GetType().Name, ex.InnerException.Message, ex.InnerException.StackTrace); - } - else - { - Log(EventTypeIds.Exception, Component, ex.GetType().Name, ex.Message, ex.StackTrace); - } - } - - public static void LogLogInitialized(string PersistantStorePath) - { - Log(EventTypeIds.LogInitialized, PersistantStorePath); - } - - public override int ModuleId - { - get { return _ModuleId; } - } - - public override string ModuleName - { - get { return "System"; } - } - - public override string ModuleDescription - { - get { return "Core System Log"; } - } - - protected override List LoadEventTypes() - { - List eventTypes = new List() { - new LogEventType() { - Id = (int)EventTypeIds.Information, - ModuleId = _ModuleId, - Name = "Information", - Format = null, - Severity = (int)LogEventType.Severities.Information, - UseLive = true, UsePersist = true, UseDisplay = true }, - new LogEventType() { - Id = (int)EventTypeIds.Warning, - ModuleId = _ModuleId, - Name = "Warning", - Format = null, - Severity = (int)LogEventType.Severities.Warning, - UseLive = true, UsePersist = true, UseDisplay = true }, - new LogEventType() { - Id = (int)EventTypeIds.Error, - ModuleId = _ModuleId, - Name = "Error", - Format = null, - Severity = (int)LogEventType.Severities.Error, - UseLive = true, UsePersist = true, UseDisplay = true }, - new LogEventType() { - Id = (int)EventTypeIds.Exception, - ModuleId = _ModuleId, - Name = "Exception", - Format = "{0}; {1}: {2}; {3}", - Severity = (int)LogEventType.Severities.Error, - UseLive = true, UsePersist = true, UseDisplay = true }, - new LogEventType() { - Id = (int)EventTypeIds.ExceptionWithInner, - ModuleId = _ModuleId, - Name = "Exception with Inner Exception", - Format = "{0}; {1}: {2}; {3}; {4}: {5}; {6}", - Severity = (int)LogEventType.Severities.Error, - UseLive = true, UsePersist = true, UseDisplay = true }, - new LogEventType() { - Id = (int)EventTypeIds.LogInitialized, - ModuleId = _ModuleId, - Name = "Log Initialized", - Format = "Log Initialized to '{0}'", - Severity = (int)LogEventType.Severities.Information, - UseLive = false, UsePersist = true, UseDisplay = true } - }; - - return eventTypes; - } - } -} diff --git a/Disco.Logging/Targets/LogLiveContext.cs b/Disco.Logging/Targets/LogLiveContext.cs deleted file mode 100644 index 3e04983c..00000000 --- a/Disco.Logging/Targets/LogLiveContext.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using SignalR; -using SignalR.Hosting.AspNet; -using SignalR.Infrastructure; - -namespace Disco.Logging.Targets -{ - public class LogLiveContext : PersistentConnection - { - protected override System.Threading.Tasks.Task OnReceivedAsync(string connectionId, string data) - { - // Add to Group - if (!string.IsNullOrWhiteSpace(data) && data.StartsWith("/addToGroups:") && data.Length > 13) - { - var groups = data.Substring(13).Split(','); - foreach (var g in groups) - { - this.AddToGroup(connectionId, g); - } - } - - return base.OnReceivedAsync(connectionId, data); - } - - internal static void Broadcast(LogBase logModule, Models.LogEventType eventType, DateTime Timestamp, params object[] Arguments) - { - var message = Models.LogLiveEvent.Create(logModule, eventType, Timestamp, Arguments); - - var connectionManager = AspNetHost.DependencyResolver.Resolve(); - var connection = connectionManager.GetConnection(); - connection.Broadcast(_QualifiedTypeNameAll, message); - connection.Broadcast(LiveLogNameGroup(logModule.ModuleName), message); - } - - private const string _GroupNameAll = "__All"; - private static string _QualifiedTypeName = typeof(LogLiveContext).FullName + "."; - private static string _QualifiedTypeNameAll = _QualifiedTypeName + "__All"; - private static string LiveLogNameGroup(string LogName) - { - return string.Concat(_QualifiedTypeName, LogName); - } - public static string LiveLogNameAll - { - get - { - //return _QualifiedTypeNameAll; - return _GroupNameAll; - } - } - - } -} diff --git a/Disco.Logging/Targets/LogPersistContext.cs b/Disco.Logging/Targets/LogPersistContext.cs deleted file mode 100644 index f2a31f8a..00000000 --- a/Disco.Logging/Targets/LogPersistContext.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; - -namespace Disco.Logging.Targets -{ - public class LogPersistContext : DbContext - { - public LogPersistContext(string ConnectionString) : base(ConnectionString) { } - - public DbSet Modules { get; set; } - public DbSet EventTypes { get; set; } - public DbSet Events { get; set; } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - //modelBuilder.Conventions.Remove(); - } - } -} diff --git a/Disco.Logging/Utilities.cs b/Disco.Logging/Utilities.cs deleted file mode 100644 index 9600ecec..00000000 --- a/Disco.Logging/Utilities.cs +++ /dev/null @@ -1,263 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; -using System.IO; -using System.Web.Mvc; - -namespace Disco.Logging -{ - public static class Utilities - { - - public const string LogEventCSVHeader = "Timestamp,ModuleId,ModuleName,ModuleDescription,EventTypeId,EventTypeName,Severity,Message"; - public static void ToCsvLine(this Models.LogLiveEvent e, TextWriter writer) - { - writer.Write(e.Timestamp.ToString("yyy-MM-dd HH:mm:ss")); - writer.Write(","); - writer.Write(e.ModuleId); - writer.Write(",\""); - writer.Write(e.ModuleName); - writer.Write("\",\""); - writer.Write(e.ModuleDescription); - writer.Write("\","); - writer.Write(e.EventTypeId); - writer.Write(",\""); - writer.Write(e.EventTypeName); - writer.Write("\","); - writer.Write(e.EventTypeSeverity); - writer.Write(",\""); - writer.Write(e.FormattedMessage.Replace("\"", "'")); - writer.Write("\""); - if (e.Arguments != null) - { - foreach (var arg in e.Arguments) - { - writer.Write(",\""); - writer.Write(arg.ToString().Replace("\"", "'")); - writer.Write("\""); - } - } - writer.WriteLine(); - } - public static MemoryStream ToCsv(this List e) - { - var ms = new MemoryStream(); - StreamWriter sw = new StreamWriter(ms); - sw.WriteLine(LogEventCSVHeader); - if (e != null) - { - foreach (var le in e) - { - le.ToCsvLine(sw); - } - } - sw.Flush(); - ms.Position = 0; - return ms; - } - - public static List ToSelectListItems(this List items) - { - return items.Select(et => new SelectListItem() { Value = et.Id.ToString(), Text = et.Name }).ToList(); - } - - #region Win32 APIs - /// - /// The CreateFile function creates or opens a file, file stream, directory, physical disk, volume, console buffer, tape drive, - /// communications resource, mailslot, or named pipe. The function returns a handle that can be used to access an object. - /// - /// - /// access to the object, which can be read, write, or both - /// The sharing mode of an object, which can be read, write, both, or none - /// A pointer to a SECURITY_ATTRIBUTES structure that determines whether or not the returned handle can - /// be inherited by child processes. Can be null - /// An action to take on files that exist and do not exist - /// The file attributes and flags. - /// A handle to a template file with the GENERIC_READ access right. The template file supplies file attributes - /// and extended attributes for the file that is being created. This parameter can be null - /// If the function succeeds, the return value is an open handle to a specified file. If a specified file exists before the function - /// all and dwCreationDisposition is CREATE_ALWAYS or OPEN_ALWAYS, a call to GetLastError returns ERROR_ALREADY_EXISTS, even when the function - /// succeeds. If a file does not exist before the call, GetLastError returns 0 (zero). - /// If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError. - /// - [DllImport("kernel32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, SetLastError = true)] - private static extern SafeFileHandle CreateFile( - string lpFileName, - EFileAccess dwDesiredAccess, - EFileShare dwShareMode, - IntPtr SecurityAttributes, - ECreationDisposition dwCreationDisposition, - EFileAttributes dwFlagsAndAttributes, - IntPtr hTemplateFile - ); - [Flags] - private enum EFileAccess : uint - { - Delete = 0x10000, - ReadControl = 0x20000, - WriteDAC = 0x40000, - WriteOwner = 0x80000, - Synchronize = 0x100000, - - StandardRightsRequired = 0xF0000, - StandardRightsRead = ReadControl, - StandardRightsWrite = ReadControl, - StandardRightsExecute = ReadControl, - StandardRightsAll = 0x1F0000, - SpecificRightsAll = 0xFFFF, - - AccessSystemSecurity = 0x1000000, // AccessSystemAcl access type - - MaximumAllowed = 0x2000000, // MaximumAllowed access type - - GenericRead = 0x80000000, - GenericWrite = 0x40000000, - GenericExecute = 0x20000000, - GenericAll = 0x10000000 - } - [Flags] - private enum EFileShare : uint - { - /// - /// - /// - None = 0x00000000, - /// - /// Enables subsequent open operations on an object to request read access. - /// Otherwise, other processes cannot open the object if they request read access. - /// If this flag is not specified, but the object has been opened for read access, the function fails. - /// - Read = 0x00000001, - /// - /// Enables subsequent open operations on an object to request write access. - /// Otherwise, other processes cannot open the object if they request write access. - /// If this flag is not specified, but the object has been opened for write access, the function fails. - /// - Write = 0x00000002, - /// - /// Enables subsequent open operations on an object to request delete access. - /// Otherwise, other processes cannot open the object if they request delete access. - /// If this flag is not specified, but the object has been opened for delete access, the function fails. - /// - Delete = 0x00000004 - } - private enum ECreationDisposition : uint - { - /// - /// Creates a new file. The function fails if a specified file exists. - /// - New = 1, - /// - /// Creates a new file, always. - /// If a file exists, the function overwrites the file, clears the existing attributes, combines the specified file attributes, - /// and flags with FILE_ATTRIBUTE_ARCHIVE, but does not set the security descriptor that the SECURITY_ATTRIBUTES structure specifies. - /// - CreateAlways = 2, - /// - /// Opens a file. The function fails if the file does not exist. - /// - OpenExisting = 3, - /// - /// Opens a file, always. - /// If a file does not exist, the function creates a file as if dwCreationDisposition is CREATE_NEW. - /// - OpenAlways = 4, - /// - /// Opens a file and truncates it so that its size is 0 (zero) bytes. The function fails if the file does not exist. - /// The calling process must open the file with the GENERIC_WRITE access right. - /// - TruncateExisting = 5 - } - [Flags] - private enum EFileAttributes : uint - { - None = 0x0000000, - Readonly = 0x00000001, - Hidden = 0x00000002, - System = 0x00000004, - Directory = 0x00000010, - Archive = 0x00000020, - Device = 0x00000040, - Normal = 0x00000080, - Temporary = 0x00000100, - SparseFile = 0x00000200, - ReparsePoint = 0x00000400, - Compressed = 0x00000800, - Offline = 0x00001000, - NotContentIndexed = 0x00002000, - Encrypted = 0x00004000, - Write_Through = 0x80000000, - Overlapped = 0x40000000, - NoBuffering = 0x20000000, - RandomAccess = 0x10000000, - SequentialScan = 0x08000000, - DeleteOnClose = 0x04000000, - BackupSemantics = 0x02000000, - PosixSemantics = 0x01000000, - OpenReparsePoint = 0x00200000, - OpenNoRecall = 0x00100000, - FirstPipeInstance = 0x00080000 - } - - private const int FSCTL_SET_COMPRESSION = 0x9C040; - private const short COMPRESSION_FORMAT_DEFAULT = 1; - [DllImport("kernel32.dll", SetLastError = true)] - private static extern int DeviceIoControl( - SafeFileHandle hDevice, - int dwIoControlCode, - ref short lpInBuffer, - int nInBufferSize, - IntPtr lpOutBuffer, - int nOutBufferSize, - ref int lpBytesReturned, - IntPtr lpOverlapped); - #endregion - - public static void CompressDirectory(string DirectoryPath) - { - if (DirectoryPath.Length > 250) - throw new InvalidOperationException(string.Format("Directory Path to Long (>250) to Compress: {0}", DirectoryPath)); - - DirectoryInfo dirInfo = new DirectoryInfo(DirectoryPath); - if (dirInfo.Exists) - { - if ((dirInfo.Attributes & FileAttributes.Compressed) != FileAttributes.Compressed) - { - var dirHandle = CreateFile(DirectoryPath, EFileAccess.GenericWrite, EFileShare.Read, IntPtr.Zero, ECreationDisposition.OpenExisting, EFileAttributes.None, IntPtr.Zero); - if (dirHandle.IsInvalid) - { - Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); - } - else - { - EnableCompression(dirHandle); - dirHandle.Close(); - } - } - } - else - { - throw new InvalidOperationException(string.Format("Directory doesn't exist: {0}", DirectoryPath)); - } - } - - private static void EnableCompression(SafeFileHandle handle) - { - int lpBytesReturned = 0; - short lpInBuffer = COMPRESSION_FORMAT_DEFAULT; - - int result = DeviceIoControl(handle, FSCTL_SET_COMPRESSION, - ref lpInBuffer, sizeof(short), IntPtr.Zero, 0, - ref lpBytesReturned, IntPtr.Zero); - - if (result != 0) - { - Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); - } - } - - } -} diff --git a/Disco.Logging/packages.config b/Disco.Logging/packages.config deleted file mode 100644 index 065b8424..00000000 --- a/Disco.Logging/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Disco.Silverlight.AttachmentUpload/App.xaml b/Disco.Silverlight.AttachmentUpload/App.xaml deleted file mode 100644 index 9ba4bcda..00000000 --- a/Disco.Silverlight.AttachmentUpload/App.xaml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Disco.Silverlight.AttachmentUpload/App.xaml.vb b/Disco.Silverlight.AttachmentUpload/App.xaml.vb deleted file mode 100644 index 40bc5adb..00000000 --- a/Disco.Silverlight.AttachmentUpload/App.xaml.vb +++ /dev/null @@ -1,37 +0,0 @@ -Partial Public Class App - Inherits Application - - Public Shared Property UploadUrl As Uri - Public Shared Property MainPage As MainPage - - Public Sub New() - InitializeComponent() - End Sub - - Private Sub Application_Startup(ByVal o As Object, ByVal e As StartupEventArgs) Handles Me.Startup - MainPage = New MainPage - - Me.RootVisual = MainPage - - UploadUrl = New Uri(Application.Current.Host.Source.AbsoluteUri.Substring(0, Application.Current.Host.Source.AbsoluteUri.IndexOf("/", 8)) & e.InitParams.Item("UploadUrl")) - - End Sub - - Private Sub Application_UnhandledException(ByVal sender As Object, ByVal e As ApplicationUnhandledExceptionEventArgs) Handles Me.UnhandledException - - ' If the app is running outside of the debugger then report the exception using - ' the browser's exception mechanism. On IE this will display it a yellow alert - ' icon in the status bar and Firefox will display a script error. - If Not System.Diagnostics.Debugger.IsAttached Then - - ' NOTE: This will allow the application to continue running after an exception has been thrown - ' but not handled. - ' For production applications this error handling should be replaced with something that will - ' report the error to the website and stop the application. - e.Handled = True - Dim errorWindow As ChildWindow = New ErrorWindow(e.ExceptionObject) - errorWindow.Show() - End If - End Sub - -End Class diff --git a/Disco.Silverlight.AttachmentUpload/Assets/Styles.xaml b/Disco.Silverlight.AttachmentUpload/Assets/Styles.xaml deleted file mode 100644 index c2b803fe..00000000 --- a/Disco.Silverlight.AttachmentUpload/Assets/Styles.xaml +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Disco.Silverlight.AttachmentUpload/Assets/dropTarget.png b/Disco.Silverlight.AttachmentUpload/Assets/dropTarget.png deleted file mode 100644 index 5f1eaf57ecc1477a75b79ff238db0d0c66bd9bc7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13871 zcmX9_Ra9He8Vyzg6nA$h#fr7KyB2qcV#PJMwYWP)TPW@x+^rBi6n6_!+~MY5_hFK= z@-Ue>-+Z?Bo~X~Na+v63=l}o!Q$b!@1O6TS-vGXWfA))-j{^WS00n6YEuWl|PQO^j zzo5lip_1~`&gZS~D8r`6HIt_9X#iBZabRAGO z7%(WFD*wHan}91xoF-L8y?{OJr!7wb0{zDkJvxdceeTUMC5}*f49Nq{_e8_RW0OeeJ&o0Bk~wZKn7bXR zegtMZXlsY#{MId#d->|Ct?dpY$BLK*iK5SWPWTA#b)E&Bd0<`8&rcz6*Kz+{dpy*p z3IA~7Vhpv?|Hxheo4)rHF%C=HXOT=7{oANzcsV9dB{DgepPJDDRxWoo-kx^<>)A<} z2tql1ix7@eUtaz)Va2V_IqnAaqeijIPWc9`XQLmAbdM+5))JJ@cIlK!FS3i8Y3{C3 zOMiFWx$B_-HTqrLXI>MLhWxQ6jW>O9&Y9TK2>FFK{Ga!?sCaZxSHz7FBf{Eab4%xm zBeQBwEB^edD-L2kK5Jz2t%0?k1t59kgpNeQS3jNSXIFW7S!ssfJ?nTf3B9(q$|F6< zGWN>1^Yvh+Sg9NEwkcKQkMICVo7V|hdwct^CW5y1#8WjaTNu)P7GwHE=iuOwBMeH8 zi^E)4SokvFWenvRsU4XHRkf;NYFr#Ve9czQbYiu}ICvzuXiv;Zrbq{Z6RSNt8H2Sz zxeKssm&s0^@p`r2dk$2Q9uxJIy{m;vlOZNGw?4*Dqc*p1N*NqU`vT8_`6;94mcwhW9FcY9_sPTVlk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Nu7)ab-3KuhJCI2Kh*HQ zOyq?}AG1HKsKeRiT4XbwoiSvg8z!j>BJ@=1rL4QvB>iralx`y2Wg+jOn~x57E|GcZ zCByl*}@wp8Pm~L=}0nE~Y(s))qna?YBxC__9o{${g=eH?N zk7YrIWi+=eh7$W_c!%lj)*QU*wz3M>hs_(DF#t0!@xJp9F{uQhmED1QMN5r6FPXt! zrW$p-)ov`#5+yL7;CLAiT!N_mb;7%G2Ebwsmd8?1@EM)|E~}})8UpSs!pkdW(93>M gyt|Wc{LCvVv3TtWv$rAx{2~}YK}J=&TGA}^f7?m0SpWb4 diff --git a/Disco.Silverlight.AttachmentUpload/Disco.Silverlight.AttachmentUpload.sln b/Disco.Silverlight.AttachmentUpload/Disco.Silverlight.AttachmentUpload.sln deleted file mode 100644 index a9e03ef8..00000000 --- a/Disco.Silverlight.AttachmentUpload/Disco.Silverlight.AttachmentUpload.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Disco.Silverlight.AttachmentUpload", "Disco.Silverlight.AttachmentUpload.vbproj", "{85747DDC-1389-4A40-9AFC-F57E0992294E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {85747DDC-1389-4A40-9AFC-F57E0992294E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85747DDC-1389-4A40-9AFC-F57E0992294E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85747DDC-1389-4A40-9AFC-F57E0992294E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85747DDC-1389-4A40-9AFC-F57E0992294E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Disco.Silverlight.AttachmentUpload/Disco.Silverlight.AttachmentUpload.vbproj b/Disco.Silverlight.AttachmentUpload/Disco.Silverlight.AttachmentUpload.vbproj deleted file mode 100644 index b89a6544..00000000 --- a/Disco.Silverlight.AttachmentUpload/Disco.Silverlight.AttachmentUpload.vbproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {85747DDC-1389-4A40-9AFC-F57E0992294E} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - Library - Disco.Silverlight.AttachmentUpload - Disco.Silverlight.AttachmentUpload - Silverlight - v4.0 - $(TargetFrameworkVersion) - true - - - true - true - Disco.Silverlight.AttachmentUpload.xap - My Project\AppManifest.xml - Disco.Silverlight.AttachmentUpload.App - Disco.Silverlight.AttachmentUploadTestPage.html - true - true - false - My Project\OutOfBrowserSettings.xml - true - false - - - - - - v3.5 - - - true - full - true - true - true - true - Empty - Bin\Debug - Disco.Silverlight.AttachmentUpload.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - SILVERLIGHT=1 - - - pdbonly - false - true - true - true - true - Bin\Release - Disco.Silverlight.AttachmentUpload.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - SILVERLIGHT=1 - - - On - - - Binary - - - Off - - - On - - - - ..\..\Resources\Libraries\fastJSON\fastJSON-SL.dll - - - ..\..\Resources\Libraries\FJ.Core\FJ.Core.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MainPage.xaml - - - - - FileWindow.xaml - - - ErrorWindow.xaml - - - File.xaml - - - Hidden.xaml - - - WebCam.xaml - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Disco.Silverlight.AttachmentUpload/FileUploader.vb b/Disco.Silverlight.AttachmentUpload/FileUploader.vb deleted file mode 100644 index 3693e52f..00000000 --- a/Disco.Silverlight.AttachmentUpload/FileUploader.vb +++ /dev/null @@ -1,77 +0,0 @@ -Imports System.Text -Imports Disco.Silverlight.AttachmentUpload.BI - -Public Class FileUploader - - Public Property Url As Uri - Public Property Stream As IO.Stream - Public Property StreamFilename As String - Public Property StreamMimeType As String - Public Property Form As Dictionary(Of String, String) - - Private _HttpSend As HttpWebRequest - Private _UploadBoundaryValue As String - - Private _Complete As UploadComplete - - Public Delegate Sub UploadComplete(Sender As FileUploader, Success As Boolean, Id As Integer) - - Public Sub New(Url As Uri, Stream As IO.Stream, StreamFilename As String, StreamMimeType As String, Form As Dictionary(Of String, String), Optional Complete As UploadComplete = Nothing) - Me.Url = Url - Me.Stream = Stream - Me.StreamFilename = StreamFilename - Me.StreamMimeType = StreamMimeType - Me.Form = Form - Me._Complete = Complete - - Start() - End Sub - - Public Sub Start() - Stream.Position = 0 - Me._HttpSend = WebRequest.Create(App.UploadUrl) - Me._UploadBoundaryValue = ("----------------------------" & DateTime.Now.Ticks.ToString("x")) - Me._HttpSend.ContentType = "multipart/form-data; boundary=" & Me._UploadBoundaryValue - Me._HttpSend.Method = "POST" - Me._HttpSend.BeginGetRequestStream(New AsyncCallback(AddressOf Me.BeginSendRequest), Nothing) - End Sub - - Private Sub BeginSendRequest(ByVal result As IAsyncResult) - Using requestStream As IO.Stream = _HttpSend.EndGetRequestStream(result) - Dim format As String = ("{0}--" & _UploadBoundaryValue & "{0}Content-Disposition: form-data; name=""{1}"";{0}{0}{2}") - Dim pair As KeyValuePair(Of String, String) - For Each pair In Form - Dim str4 As String = String.Format(format, Environment.NewLine, pair.Key, pair.Value) - Dim buffer3 As Byte() = Encoding.UTF8.GetBytes(str4) - requestStream.Write(buffer3, 0, buffer3.Length) - Next - Dim s As String = String.Format(("{0}--" & _UploadBoundaryValue & "{0}Content-Disposition: form-data; name=""{1}""; filename=""{2}""{0}Content-Type: {3}{0}{0}"), Environment.NewLine, "File", Me.StreamFilename, Me.StreamMimeType) - Dim bytes As Byte() = Encoding.UTF8.GetBytes(s) - requestStream.Write(bytes, 0, bytes.Length) - Me.Stream.CopyTo(requestStream) - Me.Stream.Close() - Me.Stream.Dispose() - Dim buffer As Byte() = Encoding.UTF8.GetBytes(String.Format("{0}--{1}{0}", Environment.NewLine, Me._UploadBoundaryValue)) - requestStream.Write(buffer, 0, buffer.Length) - requestStream.Flush() - requestStream.Close() - End Using - _HttpSend.BeginGetResponse(New AsyncCallback(AddressOf Me.BeginGetResponse), Nothing) - End Sub - - Private Sub BeginGetResponse(ByVal result As IAsyncResult) - Dim response As HttpWebResponse = _HttpSend.EndGetResponse(result) - - Dim responseId As Integer = -1 - - If response.StatusCode = 200 Then - Dim responseString = response.GetResponseStream.StreamToString() - Integer.TryParse(responseString, responseId) - End If - - If _Complete IsNot Nothing Then - _Complete.Invoke(Me, (response.StatusCode = 200), responseId) - End If - End Sub - -End Class diff --git a/Disco.Silverlight.AttachmentUpload/JavascriptNavigator.vb b/Disco.Silverlight.AttachmentUpload/JavascriptNavigator.vb deleted file mode 100644 index 82767946..00000000 --- a/Disco.Silverlight.AttachmentUpload/JavascriptNavigator.vb +++ /dev/null @@ -1,24 +0,0 @@ -Imports System.Windows.Browser - - -Public Class JavascriptNavigator - - Private _contentFrame As Controls.Frame - - Public Sub New(contentFrame As Controls.Frame) - _contentFrame = contentFrame - End Sub - - - Public Sub Navigate(uri As String) - _contentFrame.Navigate(New Uri(uri, UriKind.Relative)) - End Sub - - - Public ReadOnly Property Location As String - Get - Return _contentFrame.Source.ToString - End Get - End Property - -End Class diff --git a/Disco.Silverlight.AttachmentUpload/MainPage.xaml b/Disco.Silverlight.AttachmentUpload/MainPage.xaml deleted file mode 100644 index 416b0e84..00000000 --- a/Disco.Silverlight.AttachmentUpload/MainPage.xaml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Disco.Silverlight.AttachmentUpload/MainPage.xaml.vb b/Disco.Silverlight.AttachmentUpload/MainPage.xaml.vb deleted file mode 100644 index a54a03a3..00000000 --- a/Disco.Silverlight.AttachmentUpload/MainPage.xaml.vb +++ /dev/null @@ -1,60 +0,0 @@ -Imports System.Windows.Navigation -Imports System.Windows.Browser - -Partial Public Class MainPage - Inherits UserControl - - Private _Navigator As JavascriptNavigator - - Private _UploadingAttachments As New List(Of FileUploader) - - Public Sub New() - InitializeComponent() - - _Navigator = New JavascriptNavigator(Me.ContentFrame) - HtmlPage.RegisterScriptableObject("Navigator", _Navigator) - End Sub - - Private Sub ContentFrame_NavigationFailed(ByVal sender As Object, ByVal e As NavigationFailedEventArgs) Handles ContentFrame.NavigationFailed - e.Handled = True - Dim errorWindow As ChildWindow = New ErrorWindow(e.Uri) - errorWindow.Show() - End Sub - - Public Sub UploadAttachment(stream As IO.Stream, fileName As String, mimeType As String, comments As String) - - Dim form As New Dictionary(Of String, String) - form.Add("comments", comments) - - Dim ua As New FileUploader(App.UploadUrl, stream, fileName, mimeType, form, New FileUploader.UploadComplete(AddressOf UploadComplete)) - - _UploadingAttachments.Add(ua) - - 'Me.NavigationGrid.Visibility = Windows.Visibility.Visible - - End Sub - - Private Sub UploadComplete(Sender As FileUploader, Success As Boolean, Id As Integer) - If _UploadingAttachments.Contains(Sender) Then - _UploadingAttachments.Remove(Sender) - End If - - 'If _UploadingAttachments.Count = 0 Then - ' Me.Dispatcher.BeginInvoke(Function() - ' Me.NavigationGrid.Visibility = Windows.Visibility.Collapsed - ' Return Nothing - ' End Function) - 'End If - - If Id >= 0 Then - Me.Dispatcher.BeginInvoke(Function() - Dim discoFunctions = System.Windows.Browser.HtmlPage.Document.GetProperty("DiscoFunctions") - If discoFunctions IsNot Nothing Then - discoFunctions.addAttachment(Id) - End If - Return (Nothing) - End Function) - End If - End Sub - -End Class \ No newline at end of file diff --git a/Disco.Silverlight.AttachmentUpload/My Project/AppManifest.xml b/Disco.Silverlight.AttachmentUpload/My Project/AppManifest.xml deleted file mode 100644 index 1370dcae..00000000 --- a/Disco.Silverlight.AttachmentUpload/My Project/AppManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Disco.Silverlight.AttachmentUpload/My Project/AssemblyInfo.vb b/Disco.Silverlight.AttachmentUpload/My Project/AssemblyInfo.vb deleted file mode 100644 index 70e2dc4e..00000000 --- a/Disco.Silverlight.AttachmentUpload/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,34 +0,0 @@ -Imports System -Imports System.Reflection -Imports 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. - -' Review the values of the assembly attributes - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' 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: -' - - - diff --git a/Disco.Silverlight.AttachmentUpload/Utilities.vb b/Disco.Silverlight.AttachmentUpload/Utilities.vb deleted file mode 100644 index 3ce830a0..00000000 --- a/Disco.Silverlight.AttachmentUpload/Utilities.vb +++ /dev/null @@ -1,151 +0,0 @@ -Imports System.Runtime.CompilerServices -#If Not SILVERLIGHT = 1 Then -Imports System.Web.Mvc -#End If - -Namespace BI - - Public Module Utilities - - - Public Function StreamToString(stream As IO.Stream) As String - If (stream.Position <> 0) Then - stream.Position = 0 - End If - Using sr As IO.StreamReader = New IO.StreamReader(stream) - Return sr.ReadToEnd - End Using - End Function - - - Public Function ToFuzzy(d As DateTime) As String - - Dim n = DateTime.Now - '' Today - If d.Date = n.Date Then - '' Earlier - If d < n Then - '' Earlier - If d > n.AddMinutes(-1) Then - Return String.Format("A moment ago") - End If - - If d > n.AddMinutes(-10) Then - Return String.Format("A few minutes ago") - End If - Else - '' Later - If d < n.AddMinutes(1) Then - Return String.Format("In a moment") - End If - - If d < n.AddMinutes(10) Then - Return String.Format("In a few minutes") - End If - End If - - Return String.Format("Today at {0:h:mm tt}", d) - End If - - '' Past - If d.Date < n.Date Then - '' Yesterday - If d.Date = n.Date.AddDays(-1) Then - Return String.Format("Yesterday at {0:h:mm tt}", d) - End If - - '' Last Week - Dim weekStart = n.Date.AddDays(-7) - If d > weekStart Then - Return String.Format("Last {0:dddd} at {0:h:mm tt}", d) - End If - - '' This Year - Dim yearStart = New Date(n.Year, 1, 1) - If d > yearStart Then - '' Weeks - Dim weekNumber As Integer = ((n.DayOfYear - d.DayOfYear) / 7) - Return String.Format("{0} Weeks ago, {1:ddd, d MMM}", weekNumber, d) - End If - End If - - '' Future - If d.Date > n.Date Then - '' Tomorrow - If d.Date = n.Date.AddDays(1) Then - Return String.Format("Tomorrow at {0:h:mm tt}", d) - End If - - '' Next Week - Dim weekEnd = n.Date.AddDays(7) - If d < weekEnd Then - Return String.Format("Next {0:dddd} at {0:h:mm tt}", d) - End If - - '' This Year - Dim nextYearStart = New Date(n.Year + 1, 1, 1) - If d < nextYearStart Then - '' Weeks - Dim weekNumber As Integer = ((d.DayOfYear - n.DayOfYear) / 7) - Return String.Format("In {0} Weeks, {1:ddd, d MMM}", weekNumber, d) - End If - End If - - Return d.ToString("ddd, d MMM yyyy") - - End Function - - Public Function ToFuzzy(d As DateTime?, Optional NullValue As String = "N/A") As String - If d.HasValue Then - Return ToFuzzy(d.Value) - Else - Return NullValue - End If - End Function - - - Public Function ToFullDateTime(d As DateTime) As String - Return d.ToString("ddd, d MMM yyyy @ h:mm:sstt") - End Function - - Public Function ToFullDateTime(d As DateTime?, Optional NullValue As String = "N/A") As String - If d.HasValue Then - Return ToFullDateTime(d.Value) - Else - Return NullValue - End If - End Function - - - Public Function ToJavascriptDate(d As DateTime?, Optional DefaultDate As DateTime? = Nothing) As String - If d.HasValue Then - Return ToJavascriptDate(d.Value) - Else - If DefaultDate.HasValue Then - Return ToJavascriptDate(DefaultDate.Value) - Else - Return "null" - End If - End If - End Function - - Public Function ToJavascriptDate(d As DateTime) As String - Return String.Format("new Date({0}, {1}, {2}, {3}, {4}, {5})", d.Year, d.Month - 1, d.Day, d.Hour, d.Minute, d.Second) - End Function - -#If Not SILVERLIGHT = 1 Then - - Public Function ToSelectListItems(Items As List(Of String), Optional SelectedItem As String = Nothing) As List(Of SelectListItem) - If SelectedItem Is Nothing Then - Return Items.Select(Function(item) New SelectListItem() With {.Value = item, - .Text = item}).ToList() - Else - Return Items.Select(Function(item) New SelectListItem() With {.Value = item, - .Text = item, - .Selected = (item = SelectedItem)}).ToList() - End If - End Function -#End If - - End Module -End Namespace \ No newline at end of file diff --git a/Disco.Silverlight.AttachmentUpload/Views/ErrorWindow.xaml b/Disco.Silverlight.AttachmentUpload/Views/ErrorWindow.xaml deleted file mode 100644 index 96f06c46..00000000 --- a/Disco.Silverlight.AttachmentUpload/Views/ErrorWindow.xaml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - -