Remove depreciated projects/libraries

This commit is contained in:
Gary Sharp
2014-06-19 13:59:31 +10:00
parent 8b74dbabf5
commit 304ffd7ee1
60 changed files with 0 additions and 4032 deletions
@@ -1,116 +0,0 @@
<?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>
</ProductVersion>
<SchemaVersion>
</SchemaVersion>
<ProjectGuid>{CD7BB28C-B74D-4880-8B7E-4487AB5E6AFC}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Disco.Configuration</RootNamespace>
<AssemblyName>Disco.Configuration</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>Disco.Configuration.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>Disco.Configuration.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Disco.Models\Disco.Models.vbproj">
<Project>{40F222A9-CC05-4035-AFF4-15A78250EF2B}</Project>
<Name>Disco.Models</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.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>
-13
View File
@@ -1,13 +0,0 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>
@@ -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
<Assembly: AssemblyTitle("Disco - Configuration")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Disco")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("535f903b-6111-4adb-b200-9df78e49d13b")>
' 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")>
-62
View File
@@ -1,62 +0,0 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
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.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
'''<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)> _
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
@@ -1,117 +0,0 @@
<?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>
-73
View File
@@ -1,73 +0,0 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
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
@@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
-14
View File
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
-125
View File
@@ -1,125 +0,0 @@
<?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>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BD16C575-70C2-4DDE-A572-FC79EF028CB2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Disco.Logging</RootNamespace>
<AssemblyName>Disco.Logging</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<ItemGroup>
<Reference Include="EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.4.3.1\lib\net40\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="fastJSON, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\Resources\Libraries\fastJSON\fastJSON.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.4.5.1\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Quartz">
<HintPath>..\..\Resources\Libraries\Quartz\Quartz.dll</HintPath>
</Reference>
<Reference Include="SignalR, Version=0.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SignalR.Server.0.4.0.0\lib\net40\SignalR.dll</HintPath>
</Reference>
<Reference Include="SignalR.Hosting.AspNet">
<HintPath>..\packages\SignalR.Hosting.AspNet.0.4.0.0\lib\net40\SignalR.Hosting.AspNet.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Entity" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\SqlServerCompact.4.0.8482.1\lib\System.Data.SqlServerCe.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="LogReInitalizeJob.cs" />
<Compile Include="ReadLogContext.cs" />
<Compile Include="Utilities.cs" />
<Compile Include="LogContext.cs" />
<Compile Include="Models\LogLiveEvent.cs" />
<Compile Include="Targets\LogLiveContext.cs" />
<Compile Include="LogBase.cs" />
<Compile Include="Models\LogEvent.cs" />
<Compile Include="Models\LogEventType.cs" />
<Compile Include="Targets\LogPersistContext.cs" />
<Compile Include="Models\LogModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SystemLog.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Disco.Data\Disco.Data.csproj">
<Project>{85A6BD19-2C64-4746-8F2C-A68A86E8C2D7}</Project>
<Name>Disco.Data</Name>
</ProjectReference>
<ProjectReference Include="..\Disco.Models\Disco.Models.csproj">
<Project>{FBC05512-FCCA-4B16-9E76-8C413C5DE6C9}</Project>
<Name>Disco.Models</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties BuildVersion_UseGlobalSettings="True" />
</VisualStudio>
</ProjectExtensions>
<PropertyGroup>
<PostBuildEvent>
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"</PostBuildEvent>
</PropertyGroup>
<!-- 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>
-43
View File
@@ -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<int, Models.LogEventType> _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<Models.LogEventType> LoadEventTypes();
public Dictionary<int, Models.LogEventType> 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;
}
}
}
}
-311
View File
@@ -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<int, LogBase> 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<int, LogBase>();
// 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<int, Models.LogEventType> existingEventTypes = (dbModule.EventTypes == null) ? new Dictionary<int, Models.LogEventType>() : 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));
}
}
}
-20
View File
@@ -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);
}
}
}
}
-22
View File
@@ -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; }
}
}
-66
View File
@@ -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;
}
}
}
-57
View File
@@ -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
};
}
}
}
-21
View File
@@ -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<LogEventType> EventTypes { get; set; }
}
}
-36
View File
@@ -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")]
-179
View File
@@ -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<int> 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<Models.LogLiveEvent> Query(DiscoDataContext DiscoContext)
{
List<Models.LogLiveEvent> results = new List<LogLiveEvent>();
// 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<LogEvent> 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<Tuple<string, DateTime>> RelevantLogFiles(DiscoDataContext DiscoContext)
{
List<Tuple<string, DateTime>> relevantFiles = new List<Tuple<string, DateTime>>();
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<string, DateTime>(fileName, LogFileDate(fileName).Value));
queryDate = queryDate.AddDays(1);
}
return relevantFiles;
}
}
List<string> logYears = new List<string>();
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<string> logFiles = Directory.EnumerateFiles(Path.Combine(logDirectoryBase, logYear), "DiscoLog_*.sdf").ToList();
logFiles.Sort();
if (logYear != endDateYear)
{
foreach (var logFile in logFiles)
{
relevantFiles.Add(new Tuple<string, DateTime>(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<string, DateTime>(logFile, fileNameDate.Value));
}
else
{
break; // Files are sorted, must be no more...
}
}
}
break; // Years are sorted, must be no more...
}
}
return relevantFiles;
}
private IQueryable<LogEvent> BuildQuery(LogPersistContext LogContext, DateTime LogDate, int Taken)
{
IQueryable<LogEvent> 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;
}
}
}
-126
View File
@@ -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<LogEventType> LoadEventTypes()
{
List<LogEventType> eventTypes = new List<LogEventType>() {
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;
}
}
}
-55
View File
@@ -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<IConnectionManager>();
var connection = connectionManager.GetConnection<LogLiveContext>();
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;
}
}
}
}
@@ -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<Models.LogModule> Modules { get; set; }
public DbSet<Models.LogEventType> EventTypes { get; set; }
public DbSet<Models.LogEvent> Events { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
//modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
}
}
}
-263
View File
@@ -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<Models.LogLiveEvent> 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<SelectListItem> ToSelectListItems(this List<Models.LogEventType> items)
{
return items.Select(et => new SelectListItem() { Value = et.Id.ToString(), Text = et.Name }).ToList();
}
#region Win32 APIs
/// <summary>
/// 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.
/// </summary>
/// <param name="lpFileName"></param>
/// <param name="dwDesiredAccess"> access to the object, which can be read, write, or both</param>
/// <param name="dwShareMode">The sharing mode of an object, which can be read, write, both, or none</param>
/// <param name="SecurityAttributes">A pointer to a SECURITY_ATTRIBUTES structure that determines whether or not the returned handle can
/// be inherited by child processes. Can be null</param>
/// <param name="dwCreationDisposition">An action to take on files that exist and do not exist</param>
/// <param name="dwFlagsAndAttributes">The file attributes and flags. </param>
/// <param name="hTemplateFile">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</param>
/// <returns>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.
/// </returns>
[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
{
/// <summary>
///
/// </summary>
None = 0x00000000,
/// <summary>
/// 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.
/// </summary>
Read = 0x00000001,
/// <summary>
/// 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.
/// </summary>
Write = 0x00000002,
/// <summary>
/// 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.
/// </summary>
Delete = 0x00000004
}
private enum ECreationDisposition : uint
{
/// <summary>
/// Creates a new file. The function fails if a specified file exists.
/// </summary>
New = 1,
/// <summary>
/// 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.
/// </summary>
CreateAlways = 2,
/// <summary>
/// Opens a file. The function fails if the file does not exist.
/// </summary>
OpenExisting = 3,
/// <summary>
/// Opens a file, always.
/// If a file does not exist, the function creates a file as if dwCreationDisposition is CREATE_NEW.
/// </summary>
OpenAlways = 4,
/// <summary>
/// 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.
/// </summary>
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());
}
}
}
}
-9
View File
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="4.3.1" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
<package id="Newtonsoft.Json" version="4.5.1" />
<package id="SignalR.Hosting.AspNet" version="0.4.0.0" />
<package id="SignalR.Server" version="0.4.0.0" />
<package id="SqlServerCompact" version="4.0.8482.1" />
</packages>
@@ -1,14 +0,0 @@
<Application
x:Class="Disco.Silverlight.AttachmentUpload.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Assets/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
@@ -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
@@ -1,350 +0,0 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation">
<!-- ******MAIN PAGE STYLES****** -->
<!-- **************************** -->
<!-- Primary Color Brushes -->
<SolidColorBrush x:Key="NavigationBackgroundColorBrush" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="NavigationForegroundColorBrush" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="HighLightColorBrush" Color="#FF0097FC"/>
<SolidColorBrush x:Key="HoverHyperlinkForegroundColorBrush" Color="#FFEBF7FF"/>
<SolidColorBrush x:Key="HoverHyperLinkBackgroundColorBrush" Color="#FF747474"/>
<SolidColorBrush x:Key="BodyTextColorBrush" Color="#FF313131"/>
<Style TargetType="Button">
<Setter Property="Background" Value="#FFDB761D"/>
<Setter Property="Foreground" Value="#FFFFFFFF"/>
<Setter Property="Padding" Value="14, 8"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="FontSize" Value="12" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="BorderBrush">
<Setter.Value>
<SolidColorBrush Color="#FF875A33" />
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="#FF9e9e9e"/>
<ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="#FF696969"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="#FF9e9e9e"/>
<ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="#FF696969"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To=".55"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused" />
<VisualState x:Name="Unfocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="Background" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
</Border>
<ContentPresenter
x:Name="contentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"/>
<Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" Opacity="0" IsHitTestVisible="false" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- LayoutRoot Grid Style -->
<Style x:Key="LayoutRootGridStyle" TargetType="Grid">
<Setter Property="Background" Value="#FFFFFFFF"/>
</Style>
<!-- Content Border Style -->
<Style x:Key="ContentBorderStyle" TargetType="Border">
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
<Setter Property="BorderThickness" Value="0,3,0,0"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
<!-- Content Frame Style -->
<Style x:Key="ContentFrameStyle" TargetType="navigation:Frame">
<Setter Property="Background" Value="#FFFFFFFF"/>
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
<Setter Property="Padding" Value="58,15,58,15"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
<!-- Navigation Grid Style -->
<Style x:Key="NavigationGridStyle" TargetType="Grid">
<Setter Property="Background" Value="{StaticResource NavigationBackgroundColorBrush}"/>
<Setter Property="Height" Value="22"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
<!-- Branding Border Style -->
<Style x:Key="BrandingBorderStyle" TargetType="Border">
<Setter Property="Height" Value="22"/>
<Setter Property="Margin" Value="25,0,25,0"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
</Style>
<!-- Branding StackPanel Style -->
<Style x:Key="BrandingStackPanelStyle" TargetType="StackPanel">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Orientation" Value="Horizontal"/>
</Style>
<!-- Links Border Style -->
<Style x:Key="LinksBorderStyle" TargetType="Border">
<Setter Property="Height" Value="42"/>
<Setter Property="Margin" Value="25,0,25,0"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
</Style>
<!-- Links StackPanel Style -->
<Style x:Key="LinksStackPanelStyle" TargetType="StackPanel">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Orientation" Value="Horizontal"/>
</Style>
<!-- Link Style -->
<Style x:Key="LinkStyle" TargetType="HyperlinkButton">
<Setter Property="Background" Value="{StaticResource HighLightColorBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#FF9D9492"/>
<Setter Property="Foreground" Value="{StaticResource NavigationForegroundColorBrush}"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="MinHeight" Value="28"/>
<Setter Property="MinWidth" Value="78"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="8,4,8,4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="HyperlinkButton">
<Grid x:Name="ButtonGrid" Cursor="{TemplateBinding Cursor}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InteractiveElementBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InteractiveElementBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.95"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.BlurRadius)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="10"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InteractiveBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InteractiveElementBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InteractiveElementBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.8"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.BlurRadius)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="5"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InteractiveBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledOverlay" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(FrameworkElement.HorizontalAlignment)">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<HorizontalAlignment>Center</HorizontalAlignment>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(FrameworkElement.VerticalAlignment)">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<VerticalAlignment>Center</VerticalAlignment>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisabledOverlay" Storyboard.TargetProperty="(FrameworkElement.HorizontalAlignment)">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<HorizontalAlignment>Center</HorizontalAlignment>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisabledOverlay" Storyboard.TargetProperty="(FrameworkElement.VerticalAlignment)">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<VerticalAlignment>Center</VerticalAlignment>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisabledOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="LinkStates">
<VisualState x:Name="ActiveLink">
<Storyboard>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ActiveBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="InactiveLink"/>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
<SplineDoubleKeyFrame KeyTime="0" Value="0.35"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(Rectangle.RadiusX)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(Rectangle.RadiusY)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="FocusVisualElement" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="2" Opacity="0" Margin="-1" RadiusX="1" RadiusY="1"/>
<Border x:Name="ActiveBorder" MinWidth="{TemplateBinding MinWidth}" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1" Opacity="0"/>
<Border x:Name="ContentBorder" MinWidth="{TemplateBinding MinWidth}" MinHeight="{TemplateBinding MinHeight}" Opacity="1">
<ContentPresenter x:Name="ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Opacity="1">
<ContentPresenter.Effect>
<DropShadowEffect ShadowDepth="0" Color="#FF484848" Opacity="0.65" BlurRadius="0"/>
</ContentPresenter.Effect>
</ContentPresenter>
</Border>
<Border x:Name="InteractiveBorder" MinWidth="{TemplateBinding MinWidth}" MinHeight="{TemplateBinding MinHeight}" Background="{StaticResource HoverHyperLinkBackgroundColorBrush}" BorderThickness="1,1,1,1" Opacity="0" BorderBrush="{StaticResource HoverHyperLinkBackgroundColorBrush}" CornerRadius="1,1,1,1"/>
<Border x:Name="InteractiveElementBorder" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed">
<TextBlock x:Name="InteractiveElement" Foreground="{StaticResource HoverHyperlinkForegroundColorBrush}" FontSize="{TemplateBinding FontSize}" FontWeight="{TemplateBinding FontWeight}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Text="{TemplateBinding Content}"/>
</Border>
<TextBlock x:Name="DisabledOverlay" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Text="{TemplateBinding Content}" Foreground="#FFAAAAAA" Visibility="Collapsed"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Divider Style -->
<Style x:Key="DividerStyle" TargetType="Rectangle">
<Setter Property="Fill" Value="#1FFFFFFF"/>
<Setter Property="Stroke" Value="Transparent"/>
<Setter Property="Width" Value="1"/>
<Setter Property="Margin" Value="2,4,2,4"/>
</Style>
<!-- ******CONTENT PAGE STYLES****** -->
<!-- ******************************* -->
<!-- Page Style -->
<Style x:Key="PageStyle" TargetType="navigation:Page">
<Setter Property="FontFamily" Value="Segoe UI,Arial" />
</Style>
<!-- Page ScrollViewer Style -->
<Style x:Key="PageScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0,1,0,1"/>
<Setter Property="Margin" Value="-58,-15,-58,-15"/>
<Setter Property="Padding" Value="58,0,58,0"/>
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
</Style>
<!-- Content Panel Style -->
<Style x:Key="ContentPanelStyle" TargetType="StackPanel"/>
<!-- Header Text Style -->
<Style x:Key="HeaderTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource BodyTextColorBrush}"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Margin" Value="0,15,0,4"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<!-- Content Text Style -->
<Style x:Key="ContentTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource BodyTextColorBrush}"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Margin" Value="0,2,0,2"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<!-- Page HyperlinkButton Style -->
<Style x:Key="PageHyperlinkButtonStyle" TargetType="HyperlinkButton">
<Setter Property="TargetName" Value="_new"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</ResourceDictionary>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

@@ -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
@@ -1,194 +0,0 @@
<?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.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{85747DDC-1389-4A40-9AFC-F57E0992294E}</ProjectGuid>
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Disco.Silverlight.AttachmentUpload</RootNamespace>
<AssemblyName>Disco.Silverlight.AttachmentUpload</AssemblyName>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<SilverlightApplication>true</SilverlightApplication>
<SupportedCultures>
</SupportedCultures>
<XapOutputs>true</XapOutputs>
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
<XapFilename>Disco.Silverlight.AttachmentUpload.xap</XapFilename>
<SilverlightManifestTemplate>My Project\AppManifest.xml</SilverlightManifestTemplate>
<SilverlightAppEntry>Disco.Silverlight.AttachmentUpload.App</SilverlightAppEntry>
<TestPageFileName>Disco.Silverlight.AttachmentUploadTestPage.html</TestPageFileName>
<CreateTestPage>true</CreateTestPage>
<ValidateXaml>true</ValidateXaml>
<EnableOutOfBrowser>false</EnableOutOfBrowser>
<OutOfBrowserSettingsFile>My Project\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
<UsePlatformExtensions>false</UsePlatformExtensions>
<LinkedServerProject>
</LinkedServerProject>
</PropertyGroup>
<!-- This property group is only here to support building this project using the
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
to set the TargetFrameworkVersion to v3.5 -->
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<MyType>Empty</MyType>
<OutputPath>Bin\Debug</OutputPath>
<DocumentationFile>Disco.Silverlight.AttachmentUpload.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<DefineConstants>SILVERLIGHT=1</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<Optimize>true</Optimize>
<OutputPath>Bin\Release</OutputPath>
<DocumentationFile>Disco.Silverlight.AttachmentUpload.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<DefineConstants>SILVERLIGHT=1</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="fastJSON-SL">
<HintPath>..\..\Resources\Libraries\fastJSON\fastJSON-SL.dll</HintPath>
</Reference>
<Reference Include="FJ.Core">
<HintPath>..\..\Resources\Libraries\FJ.Core\FJ.Core.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="System.Windows" />
<Reference Include="system" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Xml" />
<Reference Include="System.Windows.Browser" />
<Reference Include="System.Windows.Controls" />
<Reference Include="System.Windows.Controls.Navigation" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Linq" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Xml" />
<Import Include="System.Net" />
<Import Include="System.Windows" />
<Import Include="System.Windows.Controls" />
<Import Include="System.Windows.Documents" />
<Import Include="System.Windows.Ink" />
<Import Include="System.Windows.Input" />
<Import Include="System.Windows.Media" />
<Import Include="System.Windows.Media.Animation" />
<Import Include="System.Windows.Shapes" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.vb">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="FileUploader.vb" />
<Compile Include="JavascriptNavigator.vb" />
<Compile Include="MainPage.xaml.vb">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="Utilities.vb" />
<Compile Include="Views\FileWindow.xaml.vb">
<DependentUpon>FileWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ErrorWindow.xaml.vb">
<DependentUpon>ErrorWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\File.xaml.vb">
<DependentUpon>File.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Hidden.xaml.vb">
<DependentUpon>Hidden.xaml</DependentUpon>
</Compile>
<Compile Include="Views\WebCam.xaml.vb">
<DependentUpon>WebCam.xaml</DependentUpon>
</Compile>
<Compile Include="WriteableBitmapExtensions.vb" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Resource Include="Assets\Styles.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Resource>
<Page Include="Views\FileWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\ErrorWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\File.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Hidden.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\WebCam.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<None Include="My Project\AppManifest.xml" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\dropTarget.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.VisualBasic.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>
-->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
<SilverlightProjectProperties />
</FlavorProperties>
<UserProperties BuildVersion_UseGlobalSettings="True" />
</VisualStudio>
</ProjectExtensions>
</Project>
@@ -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
@@ -1,24 +0,0 @@
Imports System.Windows.Browser
<ScriptableType()>
Public Class JavascriptNavigator
Private _contentFrame As Controls.Frame
Public Sub New(contentFrame As Controls.Frame)
_contentFrame = contentFrame
End Sub
<ScriptableMember()>
Public Sub Navigate(uri As String)
_contentFrame.Navigate(New Uri(uri, UriKind.Relative))
End Sub
<ScriptableMember()>
Public ReadOnly Property Location As String
Get
Return _contentFrame.Source.ToString
End Get
End Property
End Class
@@ -1,37 +0,0 @@
<UserControl
x:Class="Disco.Silverlight.AttachmentUpload.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}" Grid.Row="0">
<navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
Source="/Hidden" NavigationFailed="ContentFrame_NavigationFailed">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/Views/Hidden.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
</Border>
<Grid x:Name="NavigationGrid" Visibility="Collapsed" Style="{StaticResource NavigationGridStyle}" Grid.Row="1">
<Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}">
<StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}">
<TextBlock Text="Uploading..." VerticalAlignment="Center" Margin="0,0,10,0" />
<ProgressBar Width="150" Height="18" IsIndeterminate="True" />
</StackPanel>
</Border>
</Grid>
</Grid>
</UserControl>
@@ -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
@@ -1,7 +0,0 @@
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Deployment.Parts>
</Deployment.Parts>
</Deployment>
@@ -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
<Assembly: AssemblyTitle("Disco.Silverlight.AttachmentUpload")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Disco.Silverlight.AttachmentUpload")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("c4face53-84f9-4c43-af73-5492c628dbe0")>
' 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.0423.1327")>
<Assembly: AssemblyFileVersion("1.2012.0423.1327")>
@@ -1,151 +0,0 @@
Imports System.Runtime.CompilerServices
#If Not SILVERLIGHT = 1 Then
Imports System.Web.Mvc
#End If
Namespace BI
<Extension()>
Public Module Utilities
<Extension()>
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
<Extension()>
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
<Extension()>
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
<Extension()>
Public Function ToFullDateTime(d As DateTime) As String
Return d.ToString("ddd, d MMM yyyy @ h:mm:sstt")
End Function
<Extension()>
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
<Extension()>
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
<Extension()>
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
<Extension()>
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
@@ -1,34 +0,0 @@
<controls:ChildWindow
x:Class="Disco.Silverlight.AttachmentUpload.ErrorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Title="Error">
<Grid x:Name="LayoutRoot" Width="540">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock x:Name="IntroductoryText" Grid.Row="0" Margin="0"
Text="An unknown error was encountered. Please contact your administrator for more information."/>
<StackPanel x:Name="ContentStackPanel" Grid.Row="2" Margin="0,6,0,0">
<TextBlock x:Name="LabelText" TextWrapping="Wrap" Margin="0,0,0,2"
Text="Error details"/>
<TextBox x:Name="ErrorTextBox" Height="90" TextWrapping="Wrap" IsReadOnly="True"
VerticalScrollBarVisibility="Auto"/>
</StackPanel>
<Button x:Name="OKButton" Grid.Row="3" Click="OKButton_Click"
HorizontalAlignment="Right" Margin="0,10,0,0"
TabIndex="0" Content="OK"/>
</Grid>
</controls:ChildWindow>
@@ -1,27 +0,0 @@
Partial Public Class ErrorWindow
Inherits ChildWindow
Public Sub New(ByVal e As Exception)
InitializeComponent()
If e IsNot Nothing Then
ErrorTextBox.Text = e.Message + Environment.NewLine + Environment.NewLine + e.StackTrace
End If
End Sub
Public Sub New(ByVal uri As Uri)
InitializeComponent()
If uri IsNot Nothing Then
ErrorTextBox.Text = "Page not found: """ + uri.ToString() + """"""
End If
End Sub
Public Sub New(ByVal message As String, ByVal details As String)
InitializeComponent()
ErrorTextBox.Text = message + Environment.NewLine + Environment.NewLine + details
End Sub
Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
Me.DialogResult = True
End Sub
End Class
@@ -1,24 +0,0 @@
<navigation:Page x:Class="Disco.Silverlight.AttachmentUpload.File"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
Title="File Upload"
Style="{StaticResource PageStyle}">
<Grid x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button x:Name="ButtonBrowseForFile" Content="BROWSE FOR FILES" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel x:Name="DropTarget" Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" AllowDrop="True">
<Image Source="../Assets/dropTarget.png" Stretch="None" Width="128" Height="128" />
<TextBlock HorizontalAlignment="Center">Drop Files Here</TextBlock>
</StackPanel>
</Grid>
</navigation:Page>
@@ -1,62 +0,0 @@
Partial Public Class File
Inherits Page
Public Sub New()
InitializeComponent()
End Sub
Private _FileWindow As FileWindow
Private _ProcessFile As IO.FileInfo
Private _ProcessFiles As Queue(Of IO.FileInfo)
'Executes when the user navigates to this page.
Protected Overrides Sub OnNavigatedTo(ByVal e As System.Windows.Navigation.NavigationEventArgs)
_ProcessFiles = New Queue(Of IO.FileInfo)
End Sub
Private Sub ButtonBrowseForFile_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles ButtonBrowseForFile.Click
Dim ofd As New OpenFileDialog() With {.Multiselect = True}
If ofd.ShowDialog() Then
For Each f In ofd.Files
_ProcessFiles.Enqueue(f)
Next
StartProcessing()
End If
End Sub
Private Sub StartProcessing()
If _ProcessFiles.Count > 0 Then
_ProcessFile = _ProcessFiles.Dequeue
_FileWindow = New FileWindow(_ProcessFile)
AddHandler _FileWindow.Closed, AddressOf FileWindow_Closed
_FileWindow.Show()
End If
End Sub
Private Sub FileWindow_Closed(sender As Object, e As EventArgs)
If _FileWindow.DialogResult Then
Me.IsEnabled = False
Dim fs = _FileWindow.File.OpenRead
App.MainPage.UploadAttachment(fs, _FileWindow.Filename, "unknown/unknown", _FileWindow.Comments)
Me.IsEnabled = True
End If
StartProcessing()
End Sub
Private Sub DropTarget_Drop(sender As Object, e As System.Windows.DragEventArgs) Handles DropTarget.Drop
For Each f As IO.FileInfo In e.Data.GetData(DataFormats.FileDrop)
_ProcessFiles.Enqueue(f)
Next
StartProcessing()
End Sub
End Class
@@ -1,50 +0,0 @@
<controls:ChildWindow
x:Class="Disco.Silverlight.AttachmentUpload.FileWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Title="Upload File">
<Grid x:Name="LayoutRoot" Width="540">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock x:Name="IntroductoryText" Grid.Row="0" Margin="0"
Text="Please provide details for the file."/>
<StackPanel x:Name="ContentStackPanel" Grid.Row="2" Margin="0,6,0,0">
<TextBlock x:Name="LabelText" TextWrapping="Wrap" Margin="0,0,0,2"
Text="Details"/>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 10 0">Filename:</TextBlock>
<TextBlock Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 10 0">Comments:</TextBlock>
<TextBlock x:Name="textBlockName" Grid.Row="0" Grid.Column="1" Margin="4" Text="{Binding Filename}" />
<TextBox x:Name="textBlockComments" Grid.Row="1" Grid.Column="1" Height="24" Margin="4" Text="{Binding Comments}" />
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="3" HorizontalAlignment="Right" Margin="0,10,0,0">
<Button x:Name="ButtonCancel" Click="ButtonCancel_Click" Padding="14 6" VerticalAlignment="Bottom"
Margin="0,0,10,0"
TabIndex="0" Content="CANCEL"/>
<Button x:Name="ButtonOK" Click="ButtonOK_Click" Padding="14 6" VerticalAlignment="Bottom"
TabIndex="0" Content="OK" />
</StackPanel>
</Grid>
</controls:ChildWindow>
@@ -1,55 +0,0 @@
Partial Public Class FileWindow
Inherits ChildWindow
Public Property File As IO.FileInfo
Public Property Filename As String
Public Property Comments As String
Private _InitialFocus As Boolean = False
Public Sub New(File As IO.FileInfo)
InitializeComponent()
Me.File = File
Me.Filename = File.Name
Me.Comments = String.Empty
Me.DataContext = Me
End Sub
Private Sub ButtonOK_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
If String.IsNullOrEmpty(Me.textBlockComments.Text) Then
MessageBox.Show("Please provide a Comment")
Me.textBlockComments.Focus()
Else
Me.Comments = textBlockComments.Text
Me.DialogResult = True
End If
End Sub
Private Sub ButtonCancel_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
Me.DialogResult = False
End Sub
Private Sub textBlockComments_KeyDown(sender As Object, e As System.Windows.Input.KeyEventArgs) Handles textBlockComments.KeyDown
If e.Key = Key.Enter Then
ButtonOK_Click(Nothing, Nothing)
Return
End If
If e.Key = Key.Escape Then
ButtonCancel_Click(Nothing, Nothing)
Return
End If
End Sub
Private Sub FileWindow_GotFocus(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.GotFocus
If Not _InitialFocus Then
Me.textBlockComments.Focus()
_InitialFocus = True
End If
End Sub
End Class
@@ -1,14 +0,0 @@
<navigation:Page x:Class="Disco.Silverlight.AttachmentUpload.Hidden"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
d:DesignWidth="640" d:DesignHeight="480"
Title="Hidden Page">
<Grid x:Name="LayoutRoot">
</Grid>
</navigation:Page>
@@ -1,13 +0,0 @@
Partial Public Class Hidden
Inherits Page
Public Sub New()
InitializeComponent()
End Sub
'Executes when the user navigates to this page.
Protected Overrides Sub OnNavigatedTo(ByVal e As System.Windows.Navigation.NavigationEventArgs)
End Sub
End Class
@@ -1,48 +0,0 @@
<navigation:Page x:Class="Disco.Silverlight.AttachmentUpload.WebCam"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
Title="WebCam Capture"
Style="{StaticResource PageStyle}">
<Grid x:Name="LayoutRoot">
<Grid x:Name="WebCamAccessHost" Visibility="Collapsed">
<Button x:Name="ButtonStartWebCam" Content="START WEBCAM" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="14, 8" />
</Grid>
<Grid x:Name="WebCamShow" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border Background="Black">
<Rectangle x:Name="WebCamHost" OpacityMask="White" />
</Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom" Grid.Row="1" Margin="0, 10, 0, 0">
<Button x:Name="ButtonCapture" Content="CAPTURE IMAGE" HorizontalAlignment="Center" Padding="14, 8" />
<TextBlock x:Name="TextBlockWebCamFormat" HorizontalAlignment="Center" Margin="0, 6, 0, 0"></TextBlock>
</StackPanel>
</Grid>
<Border x:Name="WebCamCaptured" Visibility="Collapsed" Width="600" Height="450" Background="#BBffe3cb" BorderBrush="#FFDB761D" BorderThickness="4" CornerRadius="4">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border Background="Black" Grid.ColumnSpan="4" Margin="14">
<Rectangle x:Name="WebCamCapturedImage" />
</Border>
<Button x:Name="ButtonCancel" Grid.Row="1" Grid.Column="0" Content="CANCEL" HorizontalAlignment="Center" VerticalAlignment="Bottom" Padding="14, 8" Margin="6" />
<TextBlock Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="10 0">Comments:</TextBlock>
<TextBox Grid.Row="1" Grid.Column="2" x:Name="TextBoxComments" Height="24" />
<Button x:Name="ButtonPost" Grid.Row="1" Grid.Column="3" Content="UPLOAD IMAGE" HorizontalAlignment="Center" VerticalAlignment="Bottom" Padding="14, 8" Margin="6" />
</Grid>
</Border>
</Grid>
</navigation:Page>
@@ -1,149 +0,0 @@
Imports System.Windows.Media.Effects
Partial Public Class WebCam
Inherits Page
Public Sub New()
InitializeComponent()
End Sub
Private _CaptureSource As CaptureSource
Private _VideoBrush As VideoBrush
Private _CapturedImage As Imaging.WriteableBitmap
'Executes when the user navigates to this page.
Protected Overrides Sub OnNavigatedTo(ByVal e As System.Windows.Navigation.NavigationEventArgs)
If _CaptureSource Is Nothing Then
'' Init WebCam
_CaptureSource = New CaptureSource
_CaptureSource.VideoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice()
'' Get Best Quality Image
Dim format = (From f In _CaptureSource.VideoCaptureDevice.SupportedFormats Where f.PixelHeight <= 720 And f.Stride = 0
Order By (f.PixelHeight * f.PixelWidth) Descending Order By f.FramesPerSecond).FirstOrDefault()
TextBlockWebCamFormat.Text = String.Format("{0} - {1}x{2} at {3}fps", _CaptureSource.VideoCaptureDevice.FriendlyName, format.PixelWidth, format.PixelHeight, format.FramesPerSecond)
_CaptureSource.VideoCaptureDevice.DesiredFormat = format
AddHandler _CaptureSource.CaptureImageCompleted, AddressOf CaptureSource_CaptureImageCompleted
_VideoBrush = New VideoBrush()
_VideoBrush.Stretch = Stretch.Uniform
_VideoBrush.SetSource(_CaptureSource)
WebCamHost.Fill = _VideoBrush
ButtonCapture.Focus()
End If
If (CaptureDeviceConfiguration.AllowedDeviceAccess) Then
ButtonStartWebCam_Click(Nothing, Nothing)
Else
WebCamAccessHost.Visibility = Windows.Visibility.Visible
WebCamCaptured.Visibility = Windows.Visibility.Collapsed
WebCamShow.Visibility = Windows.Visibility.Collapsed
End If
End Sub
Protected Overrides Sub OnNavigatedFrom(e As System.Windows.Navigation.NavigationEventArgs)
If _CaptureSource IsNot Nothing Then
If _CaptureSource.State = CaptureState.Started Then
_CaptureSource.Stop()
End If
End If
MyBase.OnNavigatedFrom(e)
End Sub
Private Sub ButtonStartWebCam_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles ButtonStartWebCam.Click
If (CaptureDeviceConfiguration.AllowedDeviceAccess OrElse CaptureDeviceConfiguration.RequestDeviceAccess()) Then
_CapturedImage = Nothing
Me.WebCamShow.Effect = Nothing
WebCamAccessHost.Visibility = Windows.Visibility.Collapsed
WebCamShow.Visibility = Windows.Visibility.Visible
WebCamCaptured.Visibility = Windows.Visibility.Collapsed
_CaptureSource.Start()
Me.ButtonCapture.Focus()
Else
WebCamAccessHost.Visibility = Windows.Visibility.Visible
WebCamCaptured.Visibility = Windows.Visibility.Collapsed
WebCamShow.Visibility = Windows.Visibility.Collapsed
End If
Me.IsEnabled = True
End Sub
Private Sub ButtonCapture_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles ButtonCapture.Click
_CaptureSource.CaptureImageAsync()
End Sub
Private Sub CaptureSource_CaptureImageCompleted(sender As Object, e As CaptureImageCompletedEventArgs)
Me.Dispatcher.BeginInvoke(Function()
ImageCaptured(e.Result)
Return Nothing
End Function)
End Sub
Private Sub ImageCaptured(image As Imaging.WriteableBitmap)
_CapturedImage = image
_CaptureSource.Stop()
Dim effect As New BlurEffect() With {.Radius = 15}
Me.WebCamShow.Effect = effect
Dim capturedImageBrush = New ImageBrush() With {.ImageSource = _CapturedImage, .Stretch = Stretch.Uniform}
Me.WebCamCapturedImage.Fill = capturedImageBrush
Me.TextBoxComments.Text = String.Empty
Me.WebCamCaptured.Visibility = Windows.Visibility.Visible
Me.TextBoxComments.Focus()
End Sub
Private Sub ButtonCancel_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles ButtonCancel.Click
ButtonStartWebCam_Click(Nothing, Nothing)
End Sub
Private Sub ButtonPost_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles ButtonPost.Click
Dim comments As String = Me.TextBoxComments.Text
If String.IsNullOrEmpty(comments) Then
MessageBox.Show("Please provide a Comment")
Me.TextBoxComments.Focus()
Else
Me.IsEnabled = False
System.Threading.ThreadPool.QueueUserWorkItem(Function()
App.MainPage.UploadAttachment(_CapturedImage.ToJpgStream, String.Format("CapturedImage-{0}.jpg", Now.ToString("yyyyMMdd-HHmmss")), "image/jpeg", comments)
Me.Dispatcher.BeginInvoke(Function()
ButtonStartWebCam_Click(Nothing, Nothing)
Return Nothing
End Function)
Return Nothing
End Function)
End If
End Sub
Private Sub TextBoxComments_KeyDown(sender As Object, e As System.Windows.Input.KeyEventArgs) Handles TextBoxComments.KeyDown
If e.Key = Key.Enter Then
ButtonPost_Click(Nothing, Nothing)
Return
End If
If e.Key = Key.Escape Then
ButtonCancel_Click(Nothing, Nothing)
Return
End If
End Sub
End Class
@@ -1,40 +0,0 @@
Imports FluxJpeg.Core
Imports System.Windows.Media.Imaging
Imports System.Runtime.CompilerServices
Imports FluxJpeg.Core.Encoder
Module WriteableBitmapExtensions
<Extension()>
Public Function ToJpgStream(ByVal bitmap As WriteableBitmap) As IO.Stream
Dim width As Integer = bitmap.PixelWidth
Dim height As Integer = bitmap.PixelHeight
Dim bands As Integer = 3
Dim raster(bands - 1)(,) As Byte
Dim i As Integer
For i = 0 To bands - 1
raster(i) = New Byte(width - 1, height - 1) {}
Next i
Dim row As Integer
For row = 0 To height - 1
Dim column As Integer
For column = 0 To width - 1
Dim pixel As Integer = bitmap.Pixels(((width * row) + column))
raster(0)(column, row) = BitConverter.GetBytes(pixel >> 16)(0)
raster(1)(column, row) = BitConverter.GetBytes(pixel >> 8)(0)
raster(2)(column, row) = BitConverter.GetBytes(pixel)(0)
Next column
Next row
Dim model As New ColorModel With {.colorspace = ColorSpace.RGB}
Dim img As New Image(model, raster)
Dim stream As New IO.MemoryStream
Dim encoder = New JpegEncoder(img, 85, stream)
encoder.Encode()
stream.Seek(0, IO.SeekOrigin.Begin)
Return stream
End Function
End Module
-175
View File
@@ -1,175 +0,0 @@
<?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>
</ProductVersion>
<SchemaVersion>
</SchemaVersion>
<ProjectGuid>{3097842F-591F-49C1-80F3-CEA66ADFAF86}</ProjectGuid>
<OutputType>Exe</OutputType>
<StartupObject>Disco.Utilities.ModuleMain</StartupObject>
<RootNamespace>Disco.Utilities</RootNamespace>
<AssemblyName>Disco.Utilities</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Console</MyType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>Disco.Utilities.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>Disco.Utilities.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>Disco.Utilities.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>Disco.Utilities.xml</DocumentationFile>
<Optimize>true</Optimize>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>My Project\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.4.3.1\lib\net40\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Entity" />
<Reference Include="System.Deployment" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="ModuleMain.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="My Project\app.manifest" />
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Disco.BI\Disco.BI.csproj">
<Project>{095E6F94-3C34-47AE-BB83-46203535E0F6}</Project>
<Name>Disco.BI</Name>
</ProjectReference>
<ProjectReference Include="..\Disco.Data\Disco.Data.csproj">
<Project>{85A6BD19-2C64-4746-8F2C-A68A86E8C2D7}</Project>
<Name>Disco.Data</Name>
</ProjectReference>
<ProjectReference Include="..\Disco.Logging\Disco.Logging.csproj">
<Project>{BD16C575-70C2-4DDE-A572-FC79EF028CB2}</Project>
<Name>Disco.Logging</Name>
</ProjectReference>
<ProjectReference Include="..\Disco.Models\Disco.Models.vbproj">
<Project>{40F222A9-CC05-4035-AFF4-15A78250EF2B}</Project>
<Name>Disco.Models</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties BuildVersion_UseGlobalSettings="True" />
</VisualStudio>
</ProjectExtensions>
<!-- 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>
-131
View File
@@ -1,131 +0,0 @@
Imports System.Data.Entity
Imports Disco.Data.Repository
Imports Disco.BI
Imports Disco.BI.Interop.ActiveDirectory
Module ModuleMain
<STAThread()> _
Public Sub Main()
'Console.WriteLine("Are you sure you want to Delete & Rebuild the Disco Database? (Y/N)")
'Dim result = Console.ReadKey(True)
'If result.Key = ConsoleKey.Y Then
' Database.SetInitializer(Of DiscoDataContext)(New DiscoDataContextInitializer)
' Using db As DiscoDataContext = New DiscoDataContext
' Console.WriteLine("Deleting Existing Database...")
' db.Database.Delete()
' Console.WriteLine("Building Database...")
' db.Database.Initialize(True)
' Console.WriteLine("Database Built")
' End Using
'Else
' Console.WriteLine()
' Console.WriteLine("Cancelled")
'End If
'Console.WriteLine()
'Console.WriteLine("press any key to exit")
'Console.ReadKey(True)
'' Move all Attachments
'Using db As New DiscoDataContext
' Dim dataStoreLocation = db.DiscoConfiguration.DataStoreLocation
' Dim dataStoreJobAttachmentsLocation = IO.Path.Combine(dataStoreLocation, "JobAttachments")
' For Each ja In db.JobAttachments
' Dim correctFilename = ja.RepositoryFilename(db)
' Dim correctThumbnailFilename = ja.ThumbnailRepositoryFilename(db)
' Dim oldFilename = IO.Path.Combine(dataStoreJobAttachmentsLocation, String.Format("{0}_{1}_{2}", ja.JobId, ja.Id, ja.Filename))
' Dim oldThumbnailFilename = IO.Path.Combine(dataStoreJobAttachmentsLocation, String.Format("{0}_{1}_{2}_thumb.jpg", ja.JobId, ja.Id, ja.Filename))
' If Not IO.File.Exists(correctFilename) AndAlso IO.File.Exists(oldFilename) Then
' IO.File.Move(oldFilename, correctFilename)
' End If
' If Not IO.File.Exists(correctThumbnailFilename) AndAlso IO.File.Exists(oldThumbnailFilename) Then
' IO.File.Move(oldThumbnailFilename, correctThumbnailFilename)
' End If
' Next
' Dim dataStoreUserAttachmentsLocation = IO.Path.Combine(dataStoreLocation, "UserAttachments")
' For Each u In db.UserAttachments
' Dim correctFilename = u.RepositoryFilename(db)
' Dim correctThumbnailFilename = u.ThumbnailRepositoryFilename(db)
' Dim oldFilename = IO.Path.Combine(dataStoreUserAttachmentsLocation, String.Format("{0}_{1}_{2}", u.UserId, u.Id, u.Filename))
' Dim oldThumbnailFilename = IO.Path.Combine(dataStoreUserAttachmentsLocation, String.Format("{0}_{1}_{2}_thumb.jpg", u.UserId, u.Id, u.Filename))
' If Not IO.File.Exists(correctFilename) AndAlso IO.File.Exists(oldFilename) Then
' Console.WriteLine("Moving {0}_{1}_{2}", u.UserId, u.Id, u.Filename)
' IO.File.Move(oldFilename, correctFilename)
' End If
' If Not IO.File.Exists(correctThumbnailFilename) AndAlso IO.File.Exists(oldThumbnailFilename) Then
' Console.WriteLine("Moving {0}_{1}_{2}_thumb.jpg", u.UserId, u.Id, u.Filename)
' IO.File.Move(oldThumbnailFilename, correctThumbnailFilename)
' End If
' Next
' Dim dataStoreDeviceAttachmentsLocation = IO.Path.Combine(dataStoreLocation, "DeviceAttachments")
' For Each da In db.DeviceAttachments
' Dim correctFilename = da.RepositoryFilename(db)
' Dim correctThumbnailFilename = da.ThumbnailRepositoryFilename(db)
' Dim oldFilename = IO.Path.Combine(dataStoreDeviceAttachmentsLocation, String.Format("{0}_{1}_{2}", da.DeviceSerialNumber, da.Id, da.Filename))
' Dim oldThumbnailFilename = IO.Path.Combine(dataStoreDeviceAttachmentsLocation, String.Format("{0}_{1}_{2}_thumb.jpg", da.DeviceSerialNumber, da.Id, da.Filename))
' If Not IO.File.Exists(correctFilename) AndAlso IO.File.Exists(oldFilename) Then
' Console.WriteLine("Moving {0}_{1}_{2}", da.DeviceSerialNumber, da.Id, da.Filename)
' IO.File.Move(oldFilename, correctFilename)
' End If
' If Not IO.File.Exists(correctThumbnailFilename) AndAlso IO.File.Exists(oldThumbnailFilename) Then
' Console.WriteLine("Moving {0}_{1}_{2}_thumb.jpg", da.DeviceSerialNumber, da.Id, da.Filename)
' IO.File.Move(oldThumbnailFilename, correctThumbnailFilename)
' End If
' Next
' Dim devices = db.Devices.Include("AssignedUser").Include("DeviceModel").Include("DeviceProfile")
' For Each d In devices
' If Not String.IsNullOrEmpty(d.ComputerName) AndAlso d.ComputerName.Length <= 24 Then
' Dim adMachineAccount = Interop.ActiveDirectory.ActiveDirectory.GetMachineAccount(d.ComputerName)
' If adMachineAccount IsNot Nothing Then
' Console.WriteLine("Updating: {0}", d.SerialNumber)
' adMachineAccount.SetDescription(d)
' End If
' End If
' Next
' FixAttachmentFilenames(IO.Path.Combine(dataStoreLocation, "UserAttachments"))
' FixAttachmentFilenames(IO.Path.Combine(dataStoreLocation, "JobAttachments"))
' FixAttachmentFilenames(IO.Path.Combine(dataStoreLocation, "DeviceAttachments"))
' Console.WriteLine("Finished")
'End Using
End Sub
Sub FixAttachmentFilenames(Path As String)
For Each f In IO.Directory.EnumerateFiles(Path)
Dim fS = f.Split("_")
If fS.Length >= 2 AndAlso Not f.EndsWith("file") Then
Dim newFilename As String
If f.EndsWith("_thumb.jpg") Then
newFilename = String.Format("{0}_{1}_thumb.jpg", fS(0), fS(1))
Else
newFilename = String.Format("{0}_{1}_file", fS(0), fS(1))
End If
Console.WriteLine(newFilename)
IO.File.Move(f, IO.Path.Combine(IO.Path.GetDirectoryName(f), newFilename))
End If
Next
For Each d In IO.Directory.EnumerateDirectories(Path)
FixAttachmentFilenames(d)
Next
End Sub
End Module
-13
View File
@@ -1,13 +0,0 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>2</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>
@@ -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
<Assembly: AssemblyTitle("Disco.Utilities")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Disco.Utilities")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("5369dde4-6cbf-4eca-99ca-956f4da92b67")>
' 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.0423.1349")>
<Assembly: AssemblyFileVersion("1.2012.0423.1349")>
-63
View File
@@ -1,63 +0,0 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
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.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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.Utilities.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<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)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace
-117
View File
@@ -1,117 +0,0 @@
<?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>
-73
View File
@@ -1,73 +0,0 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.Disco.Utilities.My.MySettings
Get
Return Global.Disco.Utilities.My.MySettings.Default
End Get
End Property
End Module
End Namespace
@@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
</application>
</compatibility>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!-- <dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>-->
</asmv1:assembly>
-32
View File
@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<connectionStrings>
<add name="DiscoDataContext" connectionString="data source=HADES3;Initial Catalog=Disco;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.8.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="4.3.1" />
</packages>