Merge pull request #28 from akorb/master

Code refactoring
This commit is contained in:
Drew DeVault 2015-03-15 14:54:42 -06:00
commit 70b81fdd65
36 changed files with 83 additions and 183 deletions

View File

@ -1,10 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatSharp", "ChatSharp\ChatSharp.csproj", "{4033AFFA-BEA3-4BDF-84EA-59A23360FD36}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestChatSharp", "TestChatSharp\TestChatSharp.csproj", "{BCCCE45F-32D5-4A04-B526-7D5A5673895F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatSharp", "ChatSharp\ChatSharp.csproj", "{4033AFFA-BEA3-4BDF-84EA-59A23360FD36}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View File

@ -1,9 +1,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq;
namespace ChatSharp
{
public class ChannelCollection : IEnumerable<IrcChannel>
@ -51,7 +50,7 @@ namespace ChatSharp
{
get
{
var channel = Channels.FirstOrDefault(c => string.Compare(c.Name, name, StringComparison.OrdinalIgnoreCase) == 0);
var channel = Channels.FirstOrDefault(c => string.Equals(c.Name, name, StringComparison.OrdinalIgnoreCase));
if (channel == null)
throw new KeyNotFoundException();
return channel;

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ChatSharp
namespace ChatSharp
{
public class ClientSettings
{

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class ChannelEventArgs : EventArgs

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class ChannelUserEventArgs : EventArgs

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class ErronousNickEventArgs : EventArgs

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class IrcNoticeEventArgs : EventArgs

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class ModeChangeEventArgs : EventArgs

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class PrivateMessageEventArgs : EventArgs

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class RawMessageEventArgs : EventArgs

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class ServerMOTDEventArgs : EventArgs

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Net.Sockets;
namespace ChatSharp.Events

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class SupportsEventArgs : EventArgs

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp.Events
{
public class WhoIsReceivedEventArgs : EventArgs

View File

@ -1,10 +1,8 @@
using ChatSharp.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChatSharp.Events;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Threading;
namespace ChatSharp.Handlers
{

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ChatSharp.Handlers
namespace ChatSharp.Handlers
{
internal static class ListingHandlers
{

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChatSharp.Events;
using ChatSharp.Events;
using System;
namespace ChatSharp.Handlers
{

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using ChatSharp.Events;
using System.Linq;
using System.Text;
using ChatSharp.Events;
namespace ChatSharp.Handlers
{

View File

@ -1,9 +1,6 @@
using ChatSharp.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChatSharp.Events;
using System.Linq;
namespace ChatSharp.Handlers
{
internal static class ServerHandlers

View File

@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Linq;
namespace ChatSharp.Handlers
{
public static class UserHandlers

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
namespace ChatSharp
{
public class IrcChannel

View File

@ -1,9 +1,6 @@
using ChatSharp.Handlers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Linq;
namespace ChatSharp
{
public partial class IrcClient

View File

@ -1,13 +1,13 @@
using System;
using System.IO;
using System.Net.Security;
using System.Text;
using System.Collections.Generic;
using System.Net.Sockets;
using ChatSharp.Events;
using ChatSharp.Events;
using ChatSharp.Handlers;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Net.Security;
using System.Net.Sockets;
using System.Text;
using System.Timers;
using ChatSharp.Handlers;
using System.Collections.Concurrent;
namespace ChatSharp
{

View File

@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Linq;
namespace ChatSharp
{
public class IrcMessage

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp
{
public class IrcProtocolException : Exception

View File

@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Linq;
namespace ChatSharp
{
public class IrcUser : IEquatable<IrcUser>

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace ChatSharp
{
public class Mask

View File

@ -1,9 +1,7 @@
using System;
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq;
namespace ChatSharp
{
public class MaskCollection : IEnumerable<Mask>

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ChatSharp
namespace ChatSharp
{
public class PrivateMessage
{

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View File

@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq;
namespace ChatSharp
{
public class RequestManager
@ -23,7 +22,7 @@ namespace ChatSharp
public RequestOperation PeekOperation(string key)
{
var realKey = PendingOperations.Keys.FirstOrDefault(k => string.Compare(k, key, StringComparison.OrdinalIgnoreCase) == 0);
var realKey = PendingOperations.Keys.FirstOrDefault(k => string.Equals(k, key, StringComparison.OrdinalIgnoreCase));
return PendingOperations[realKey];
}

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ChatSharp
namespace ChatSharp
{
public class ServerInfo
{

View File

@ -1,10 +1,7 @@
using System;
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
namespace ChatSharp
{
public class UserCollection : IEnumerable<IrcUser>

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ChatSharp
namespace ChatSharp
{
public class WhoIs
{

View File

@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChatSharp;
using ChatSharp.Events;
using ChatSharp;
using System;
using System.Linq;
namespace TestChatSharp
{
class Program

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following