Skip to content

Commit

Permalink
switching to C# 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nayato committed May 5, 2016
1 parent 401d48f commit 47163fd
Show file tree
Hide file tree
Showing 150 changed files with 2,397 additions and 3,135 deletions.
3 changes: 1 addition & 2 deletions DotNetty.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,4 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp50</s:String></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
22 changes: 7 additions & 15 deletions examples/Echo.Client/ClientSettings.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using System.Configuration;
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Echo.Client
{
using System.Configuration;
using System.Net;

public static class EchoClientSettings
Expand All @@ -16,19 +17,10 @@ public static bool IsSsl
}
}

public static IPAddress Host
{
get { return IPAddress.Parse(ConfigurationManager.AppSettings["host"]); }
}
public static IPAddress Host => IPAddress.Parse(ConfigurationManager.AppSettings["host"]);

public static int Port
{
get { return int.Parse(ConfigurationManager.AppSettings["port"]); }
}
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);

public static int Size
{
get { return int.Parse(ConfigurationManager.AppSettings["size"]); }
}
public static int Size => int.Parse(ConfigurationManager.AppSettings["size"]);
}
}
}
11 changes: 5 additions & 6 deletions examples/Echo.Client/EchoClientHandler.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using DotNetty.Buffers;
using DotNetty.Transport.Channels;

namespace Echo.Client
{
using System;
using System.Text;

using DotNetty.Buffers;
using DotNetty.Transport.Channels;

public class EchoClientHandler : ChannelHandlerAdapter
{
readonly IByteBuffer initialMessage;
Expand All @@ -31,7 +30,7 @@ public override void ChannelRead(IChannelHandlerContext context, object message)
{
var byteBuffer = message as IByteBuffer;
if (byteBuffer != null)
{
{
Console.WriteLine("Received from server: " + byteBuffer.ToString(Encoding.UTF8));
}
context.WriteAsync(message);
Expand All @@ -47,4 +46,4 @@ public override void ExceptionCaught(IChannelHandlerContext context, Exception e
context.CloseAsync();
}
}
}
}
12 changes: 9 additions & 3 deletions examples/Echo.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Echo.Client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +20,11 @@
// 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("c24ab93f-41e9-4291-ba8f-e9d3cf6c2ebc")]

// Version information for an assembly consists of the following four values:
Expand All @@ -32,5 +37,6 @@
// 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")]
[assembly: AssemblyFileVersion("1.0.0.0")]
7 changes: 4 additions & 3 deletions examples/Echo.Server/EchoServerHandler.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Echo.Server
{
using System;
Expand All @@ -11,11 +12,11 @@ public class EchoServerHandler : ChannelHandlerAdapter
{
public override void ChannelRead(IChannelHandlerContext context, object message)
{
IByteBuffer buffer = message as IByteBuffer;
var buffer = message as IByteBuffer;
if (buffer != null)
{
Console.WriteLine("Received from client: " + buffer.ToString(Encoding.UTF8));
}
}
context.WriteAsync(message);
}

Expand All @@ -30,4 +31,4 @@ public override void ExceptionCaught(IChannelHandlerContext context, Exception e
context.CloseAsync();
}
}
}
}
6 changes: 2 additions & 4 deletions examples/Echo.Server/EchoServerSettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Echo.Server
{
using System.Configuration;
Expand All @@ -15,9 +16,6 @@ public static bool IsSsl
}
}

public static int Port
{
get { return int.Parse(ConfigurationManager.AppSettings["port"]); }
}
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
}
}
12 changes: 9 additions & 3 deletions examples/Echo.Server/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Echo.Server")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +20,11 @@
// 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("ba163586-f875-4488-9188-53a4a14dfd34")]

// Version information for an assembly consists of the following four values:
Expand All @@ -32,5 +37,6 @@
// 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")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit 47163fd

Please sign in to comment.