Skip to content

Commit

Permalink
Revert changes to fix #41
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashuber-lawo committed Apr 11, 2017
1 parent 6f8bcb3 commit 0cee985
Show file tree
Hide file tree
Showing 24 changed files with 193 additions and 92 deletions.
4 changes: 0 additions & 4 deletions Build.bat

This file was deleted.

2 changes: 1 addition & 1 deletion Lawo.EmberPlusSharp.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lawo.EmberPlusSharp", "Lawo.EmberPlusSharp\Lawo.EmberPlusSharp.csproj", "{CD75460D-43D8-4602-8E78-4C6EA6DE9C87}"
EndProject
Expand Down
14 changes: 9 additions & 5 deletions Lawo.EmberPlusSharp/Lawo.EmberPlusSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CD75460D-43D8-4602-8E78-4C6EA6DE9C87}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lawo.EmberPlusSharp</RootNamespace>
<AssemblyName>Lawo.EmberPlusSharp</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
Expand Down Expand Up @@ -252,12 +251,17 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\..\stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
6 changes: 3 additions & 3 deletions Lawo.EmberPlusSharp/S101/S101Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public S101Client(
};
}

this.threadId = Thread.CurrentThread.ManagedThreadId;
this.threadId = NativeMethods.GetCurrentThreadId();
this.writer = new S101Writer(writeAsyncWithLog, bufferSize);
this.logger = logger;
this.timeout = timeout;
Expand Down Expand Up @@ -287,7 +287,7 @@ private static async Task<byte[]> GetPayload(S101Reader reader, byte[] buffer, C
private readonly WorkQueue logQueue = new WorkQueue();
private readonly TaskQueue sendQueue = new TaskQueue();
private readonly CancellationTokenSource source = new CancellationTokenSource();
private readonly int threadId;
private readonly uint threadId;
private readonly S101Writer writer;
private readonly IS101Logger logger;
private readonly int timeout;
Expand All @@ -300,7 +300,7 @@ private void AssertPreconditions()
throw new ObjectDisposedException(this.GetType().Name);
}

if (this.threadId != Thread.CurrentThread.ManagedThreadId)
if (this.threadId != NativeMethods.GetCurrentThreadId())
{
throw new InvalidOperationException(
"Accessed a S101Client object from a thread other than the one that executed the constructor.");
Expand Down
4 changes: 4 additions & 0 deletions Lawo.EmberPlusSharp/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="portable45-net45+win8" developmentDependency="true" />
</packages>
12 changes: 0 additions & 12 deletions Lawo.EmberPlusSharp/project.json

This file was deleted.

13 changes: 3 additions & 10 deletions Lawo.EmberPlusSharpTest/Lawo.EmberPlusSharpTest.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>
Expand All @@ -8,15 +8,14 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lawo.EmberPlusSharp</RootNamespace>
<AssemblyName>Lawo.EmberPlusSharpTest</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -68,10 +67,6 @@
<HintPath>.\EmberLib.Glow.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Threading.Thread, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Thread.4.0.0\lib\net46\System.Threading.Thread.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.XML" />
</ItemGroup>
<Choose>
Expand Down Expand Up @@ -607,9 +602,7 @@
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\..\stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
Expand Down
1 change: 0 additions & 1 deletion Lawo.EmberPlusSharpTest/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
<package id="System.Threading.Thread" version="4.0.0" targetFramework="net462" />
</packages>
3 changes: 1 addition & 2 deletions Lawo.EmberPlusSharpTestVB/Lawo.EmberPlusSharpTestVB.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
<AssemblyName>Lawo.EmberPlusSharpTestVB</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
12 changes: 6 additions & 6 deletions Lawo.GlowAnalyzerProxy.Main/App.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Lawo.GlowAnalyzerProxy.Main.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Lawo.GlowAnalyzerProxy.Main.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<Lawo.GlowAnalyzerProxy.Main.Properties.Settings>
Expand All @@ -20,11 +20,11 @@
<value>8999</value>
</setting>
<setting name="LogFolder" serializeAs="String">
<value/>
<value />
</setting>
<setting name="AutoScrollToMostRecentEvent" serializeAs="String">
<value>True</value>
</setting>
</Lawo.GlowAnalyzerProxy.Main.Properties.Settings>
</userSettings>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lawo.GlowAnalyzerProxy.Main</RootNamespace>
<AssemblyName>GlowAnalyzerProxy</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Lawo.GlowLogConverter.Main/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
</configuration>
7 changes: 2 additions & 5 deletions Lawo.GlowLogConverter.Main/Lawo.GlowLogConverter.Main.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lawo.GlowLogConverter.Main</RootNamespace>
<AssemblyName>ConvertGlowLog</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -63,9 +62,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lawo.EmberPlusSharp\Lawo.EmberPlusSharp.csproj">
Expand Down
12 changes: 7 additions & 5 deletions Lawo.UnitTesting/Lawo.UnitTesting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{018D45FD-BC81-433E-9B90-788D4AE2D31C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lawo.UnitTesting</RootNamespace>
<AssemblyName>Lawo.UnitTesting</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
Expand Down Expand Up @@ -71,9 +70,12 @@
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\..\stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
4 changes: 4 additions & 0 deletions Lawo.UnitTesting/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="portable45-net45+win8" developmentDependency="true" />
</packages>
11 changes: 0 additions & 11 deletions Lawo.UnitTesting/project.json

This file was deleted.

48 changes: 48 additions & 0 deletions Lawo/IO/JsonSerializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2012-2017 Lawo AG (http://www.lawo.com).</copyright>
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Lawo.IO
{
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;

/// <summary>Serializes objects to the JavaScript Object Notation (JSON) and deserializes JSON data to objects.
/// </summary>
/// <threadsafety static="true" instance="false"/>
public static class JsonSerializer
{
/// <summary>Serializes objects to the JavaScript Object Notation (JSON).</summary>
/// <typeparam name="T">The type to be serialized (data contract).</typeparam>
/// <param name="data">The data contract object.</param>
/// <returns>The serialized JSON string.</returns>
public static string Serialize<T>(T data)
{
using (var stream = new MemoryStream())
{
new DataContractJsonSerializer(typeof(T)).WriteObject(stream, data);
stream.Position = 0;

using (var reader = new StreamReader(stream))
{
return reader.ReadToEnd();
}
}
}

/// <summary>Deserializes JSON data to objects.</summary>
/// <typeparam name="T">The type to be deserialized (data contract).</typeparam>
/// <param name="jsonData">The JSON string.</param>
/// <returns>The data contract object.</returns>
public static T Deserialize<T>(string jsonData)
{
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(jsonData)))
{
return (T)new DataContractJsonSerializer(typeof(T)).ReadObject(stream);
}
}
}
}
Loading

0 comments on commit 0cee985

Please sign in to comment.