Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor with CodeMaid #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Binary file added .vs/WebSocket4Net/v15/Server/sqlite3/storage.ide
Binary file not shown.
8 changes: 2 additions & 6 deletions WebSocket4Net/Action.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace System
namespace System
{
public delegate void Action<T1, T2>(T1 t1, T2 t2);

public delegate void Action<T1, T2, T3>(T1 t1, T2 t2, T3 t3);

public delegate void Action<T1, T2, T3, T4>(T1 t1, T2 t2, T3 t3, T4 t4);
}
}
5 changes: 1 addition & 4 deletions WebSocket4Net/ClosedEventArgs.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 WebSocket4Net
{
Expand Down Expand Up @@ -37,4 +34,4 @@ public ClosedEventArgs(short code, string reason)
Reason = reason;
}
}
}
}
3 changes: 1 addition & 2 deletions WebSocket4Net/Command/BadRequest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Command
{
Expand Down Expand Up @@ -68,4 +67,4 @@ public override string Name
get { return OpCode.BadRequest.ToString(); }
}
}
}
}
9 changes: 2 additions & 7 deletions WebSocket4Net/Command/Binary.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using SuperSocket.ClientEngine;

namespace WebSocket4Net.Command
namespace WebSocket4Net.Command
{
public class Binary : WebSocketCommandBase
{
Expand All @@ -17,4 +12,4 @@ public override string Name
get { return OpCode.Binary.ToString(); }
}
}
}
}
9 changes: 2 additions & 7 deletions WebSocket4Net/Command/Close.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using SuperSocket.ClientEngine;

namespace WebSocket4Net.Command
namespace WebSocket4Net.Command
{
public class Close : WebSocketCommandBase
{
Expand All @@ -30,4 +25,4 @@ public override string Name
get { return OpCode.Close.ToString(); }
}
}
}
}
4 changes: 1 addition & 3 deletions WebSocket4Net/Command/Handshake.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Command
{
Expand All @@ -25,4 +23,4 @@ public override string Name
get { return OpCode.Handshake.ToString(); }
}
}
}
}
4 changes: 1 addition & 3 deletions WebSocket4Net/Command/Ping.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Command
{
Expand All @@ -17,4 +15,4 @@ public override string Name
get { return OpCode.Ping.ToString(); }
}
}
}
}
5 changes: 1 addition & 4 deletions WebSocket4Net/Command/Pong.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using SuperSocket.ClientEngine;

namespace WebSocket4Net.Command
{
Expand All @@ -18,4 +15,4 @@ public override string Name
get { return OpCode.Pong.ToString(); }
}
}
}
}
9 changes: 2 additions & 7 deletions WebSocket4Net/Command/Text.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using SuperSocket.ClientEngine;

namespace WebSocket4Net.Command
namespace WebSocket4Net.Command
{
public class Text : WebSocketCommandBase
{
Expand All @@ -17,4 +12,4 @@ public override string Name
get { return OpCode.Text.ToString(); }
}
}
}
}
8 changes: 2 additions & 6 deletions WebSocket4Net/Command/WebSocketCommandBase.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using SuperSocket.ClientEngine;
using WebSocket4Net.Common;
using WebSocket4Net.Common;

namespace WebSocket4Net.Command
{
Expand All @@ -12,4 +8,4 @@ public abstract class WebSocketCommandBase : ICommand<WebSocket, WebSocketComman

public abstract string Name { get; }
}
}
}
11 changes: 4 additions & 7 deletions WebSocket4Net/Common/ArraySegmentEx.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Common
namespace WebSocket4Net.Common
{
class ArraySegmentEx<T>
internal class ArraySegmentEx<T>
{
public ArraySegmentEx(T[] array, int offset, int count)
{
Array = array;
Offset = offset;
Count = count;
}

/// <summary>
/// Gets the array.
/// </summary>
Expand All @@ -31,4 +28,4 @@ public ArraySegmentEx(T[] array, int offset, int count)

public int To { get; set; }
}
}
}
13 changes: 6 additions & 7 deletions WebSocket4Net/Common/ArraySegmentList.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using SuperSocket.ClientEngine;

namespace WebSocket4Net.Common
{
Expand Down Expand Up @@ -263,7 +262,7 @@ internal ArraySegmentEx<T> QuickSearchSegment(int from, int to, int index, out i
}
}

#endregion
#endregion IList<T> Members

#region ICollection<T> Members

Expand Down Expand Up @@ -302,7 +301,7 @@ public bool Remove(T item)
throw new NotSupportedException();
}

#endregion
#endregion ICollection<T> Members

#region IEnumerable<T> Members

Expand All @@ -311,7 +310,7 @@ public IEnumerator<T> GetEnumerator()
throw new NotSupportedException();
}

#endregion
#endregion IEnumerable<T> Members

#region IEnumerable Members

Expand All @@ -320,7 +319,7 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
throw new NotSupportedException();
}

#endregion
#endregion IEnumerable Members

public void RemoveSegmentAt(int index)
{
Expand All @@ -331,7 +330,7 @@ public void RemoveSegmentAt(int index)

m_PrevSegment = null;

//the removed item is not the the last item
//the removed item is not the the last item
if (index != m_Segments.Count)
{
for (int i = index; i < m_Segments.Count; i++)
Expand Down Expand Up @@ -609,4 +608,4 @@ public void DecodeMask(byte[] mask, int offset, int length)
}
}
}
}
}
9 changes: 2 additions & 7 deletions WebSocket4Net/Common/BinaryCommandInfo.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Common
namespace WebSocket4Net.Common
{
public class BinaryCommandInfo : CommandInfo<byte[]>
{
public BinaryCommandInfo(string key, byte[] data)
: base(key, data)
{

}
}
}
}
12 changes: 4 additions & 8 deletions WebSocket4Net/Common/CommandInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Common
namespace WebSocket4Net.Common
{
public abstract class CommandInfo<TCommandData> : ICommandInfo<TCommandData>
{
Expand All @@ -16,12 +12,12 @@ public CommandInfo(string key, TCommandData data)

public TCommandData Data { get; private set; }

#endregion
#endregion ICommandInfo<TCommandData> Members

#region ICommandInfo Members

public string Key { get; private set; }

#endregion
#endregion ICommandInfo Members
}
}
}
11 changes: 3 additions & 8 deletions WebSocket4Net/Common/DelegateCommand.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.Text;
using SuperSocket.ClientEngine;

namespace WebSocket4Net.Common
namespace WebSocket4Net.Common
{
public delegate void CommandDelegate<TClientSession, TCommandInfo>(TClientSession session, TCommandInfo commandInfo);

class DelegateCommand<TClientSession, TCommandInfo> : ICommand<TClientSession, TCommandInfo>
internal class DelegateCommand<TClientSession, TCommandInfo> : ICommand<TClientSession, TCommandInfo>
where TClientSession : IClientSession
where TCommandInfo : ICommandInfo
{
Expand All @@ -26,4 +21,4 @@ public void ExecuteCommand(TClientSession session, TCommandInfo commandInfo)

public string Name { get; private set; }
}
}
}
8 changes: 2 additions & 6 deletions WebSocket4Net/Common/IClientCommandReader.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Common
namespace WebSocket4Net.Common
{
public interface IClientCommandReader<TCommandInfo>
where TCommandInfo : ICommandInfo
Expand All @@ -11,4 +7,4 @@ public interface IClientCommandReader<TCommandInfo>

IClientCommandReader<TCommandInfo> NextCommandReader { get; }
}
}
}
8 changes: 2 additions & 6 deletions WebSocket4Net/Common/ICommand.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Common
namespace WebSocket4Net.Common
{
public interface ICommand
{
Expand All @@ -14,4 +10,4 @@ public interface ICommand<TSession, TCommandInfo> : ICommand
{
void ExecuteCommand(TSession session, TCommandInfo commandInfo);
}
}
}
8 changes: 2 additions & 6 deletions WebSocket4Net/Common/ICommandInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Common
namespace WebSocket4Net.Common
{
public interface ICommandInfo
{
Expand All @@ -13,4 +9,4 @@ public interface ICommandInfo<TCommandData> : ICommandInfo
{
TCommandData Data { get; }
}
}
}
8 changes: 2 additions & 6 deletions WebSocket4Net/Common/StringCommandInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net.Common
namespace WebSocket4Net.Common
{
public class StringCommandInfo : CommandInfo<string>
{
Expand All @@ -27,4 +23,4 @@ public string this[int index]
get { return Parameters[index]; }
}
}
}
}
4 changes: 1 addition & 3 deletions WebSocket4Net/DataReceivedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WebSocket4Net
{
Expand All @@ -13,4 +11,4 @@ public DataReceivedEventArgs(byte[] data)

public byte[] Data { get; private set; }
}
}
}
Loading