Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Commit

Permalink
1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
xljiulang committed Feb 3, 2018
1 parent 9980ddd commit 2d1ca92
Show file tree
Hide file tree
Showing 153 changed files with 381 additions and 928 deletions.
2 changes: 0 additions & 2 deletions NetworkSocket/ByteBits.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace NetworkSocket
{
Expand Down
4 changes: 1 addition & 3 deletions NetworkSocket/Core/ApiAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

Expand Down Expand Up @@ -76,8 +75,7 @@ public ApiAction(MethodInfo method)
/// <returns></returns>
private string GetApiName(MethodInfo method)
{
var api = Attribute.GetCustomAttribute(method, typeof(ApiAttribute)) as ApiAttribute;
if (api != null && string.IsNullOrWhiteSpace(api.Name) == false)
if (Attribute.GetCustomAttribute(method, typeof(ApiAttribute)) is ApiAttribute api && string.IsNullOrWhiteSpace(api.Name) == false)
{
return api.Name;
}
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Core/ApiAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
Expand Down
5 changes: 0 additions & 5 deletions NetworkSocket/Core/ApiParameter.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace NetworkSocket.Core
{
Expand Down
9 changes: 1 addition & 8 deletions NetworkSocket/Core/ApiResult.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using NetworkSocket.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace NetworkSocket.Core
Expand All @@ -26,11 +23,7 @@ public class ApiResult<TResult> : IApiResult, IApiResult<TResult>
/// <exception cref="ArgumentNullException"></exception>
public ApiResult(ITaskSetter<TResult> taskSetter)
{
if (taskSetter == null)
{
throw new ArgumentNullException();
}
this.taskSetter = taskSetter;
this.taskSetter = taskSetter ?? throw new ArgumentNullException();
}

/// <summary>
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Core/FilterAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using NetworkSocket.Tasks;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace NetworkSocket.Core
{
Expand Down
7 changes: 1 addition & 6 deletions NetworkSocket/Core/IActionContext.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
namespace NetworkSocket.Core
{
/// <summary>
/// 定义Api执行上下文
Expand Down
7 changes: 1 addition & 6 deletions NetworkSocket/Core/IApiResult.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Threading.Tasks;

namespace NetworkSocket.Core
{
Expand Down
8 changes: 1 addition & 7 deletions NetworkSocket/Core/ICloneable.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetworkSocket.Core
namespace NetworkSocket.Core
{
/// <summary>
/// 定义克隆相关的接口
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Core/IDependencyResolver.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
Expand Down
7 changes: 1 addition & 6 deletions NetworkSocket/Core/IDependencyResolverSupportable.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
namespace NetworkSocket.Core
{
/// <summary>
/// 定义支持依赖注入功能的接口
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Core/IDynamicJsonSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using NetworkSocket.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Core/IExceptionContext.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
Expand Down
7 changes: 1 addition & 6 deletions NetworkSocket/Core/IFilter.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
namespace NetworkSocket.Core
{
/// <summary>
/// 定义滤过器的接口
Expand Down
5 changes: 1 addition & 4 deletions NetworkSocket/Core/IFilterAttributeProvider.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;

namespace NetworkSocket.Core
{
Expand Down
7 changes: 1 addition & 6 deletions NetworkSocket/Core/IFilterSupportable.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
namespace NetworkSocket.Core
{
/// <summary>
/// 定义支持过滤器功能的接口
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Core/IGlobalFilters.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Core/ISerializer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using NetworkSocket.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
Expand Down
8 changes: 2 additions & 6 deletions NetworkSocket/Core/Internal/ApiActionTable.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
/// <summary>
/// 表示Api行为表
/// </summary>
internal class ApiActionTable
class ApiActionTable
{
/// <summary>
/// Api行为字典
Expand Down Expand Up @@ -79,8 +76,7 @@ public void AddRange(IEnumerable<ApiAction> apiActions)
/// <returns></returns>
public ApiAction TryGetAndClone(string name)
{
ApiAction apiAction;
if (this.dictionary.TryGetValue(name, out apiAction))
if (this.dictionary.TryGetValue(name, out ApiAction apiAction))
{
return ((ICloneable<ApiAction>)apiAction).CloneConstructor();
}
Expand Down
6 changes: 1 addition & 5 deletions NetworkSocket/Core/Internal/DefaultDependencyResolver.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
/// <summary>
/// 默认的依赖关系解析程序的实现
/// </summary>
internal class DefaultDependencyResolver : IDependencyResolver
class DefaultDependencyResolver : IDependencyResolver
{
/// <summary>
/// 解析支持任意对象创建的一次注册的服务
Expand Down
3 changes: 1 addition & 2 deletions NetworkSocket/Core/Internal/DefaultDynamicJsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
using NetworkSocket.Util;
using Newtonsoft.Json;
using System;
using System.Globalization;

namespace NetworkSocket.Core
{
/// <summary>
/// 默认提供的动态Json序列化工具
/// </summary>
internal class DefaultDynamicJsonSerializer : IDynamicJsonSerializer
class DefaultDynamicJsonSerializer : IDynamicJsonSerializer
{
/// <summary>
/// 序列化为Json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
/// <summary>
/// 默认提供的Api行为特性过滤器提供者
/// </summary>
internal class DefaultFilterAttributeProvider : IFilterAttributeProvider
class DefaultFilterAttributeProvider : IFilterAttributeProvider
{
/// <summary>
/// ApiAction的过滤器缓存
Expand Down
1 change: 0 additions & 1 deletion NetworkSocket/Core/Internal/DomainAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace NetworkSocket.Core
{
Expand Down
3 changes: 1 addition & 2 deletions NetworkSocket/Core/Internal/GlobalFiltersBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Core
{
/// <summary>
/// 全局过滤器管理者的基础类
/// </summary>
internal class GlobalFiltersBase : IGlobalFilters
class GlobalFiltersBase : IGlobalFilters
{
/// <summary>
/// 获取过过滤器过滤器
Expand Down
8 changes: 2 additions & 6 deletions NetworkSocket/Core/Internal/PacketIdProvider.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading;

namespace NetworkSocket.Core
{
/// <summary>
/// 表示数据包id提供者
/// </summary>
internal class PacketIdProvider
class PacketIdProvider
{
/// <summary>
/// 基准值
Expand Down
4 changes: 0 additions & 4 deletions NetworkSocket/Core/NotNullAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetworkSocket.Core
{
Expand Down
4 changes: 0 additions & 4 deletions NetworkSocket/Core/ParameterFilterAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetworkSocket.Core
{
Expand Down
7 changes: 1 addition & 6 deletions NetworkSocket/Endians.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket
namespace NetworkSocket
{
/// <summary>
/// 表示字节存储次序枚举
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Exceptions/ApiExecuteException.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Exceptions
{
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Exceptions/ApiNotExistException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace NetworkSocket.Exceptions
{
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Exceptions/HttpException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace NetworkSocket.Exceptions
{
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Exceptions/RemoteException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace NetworkSocket.Exceptions
{
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Exceptions/ResolveException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace NetworkSocket.Exceptions
{
Expand Down
3 changes: 0 additions & 3 deletions NetworkSocket/Exceptions/SerializerException.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkSocket.Exceptions
{
Expand Down
Loading

0 comments on commit 2d1ca92

Please sign in to comment.