Extensions
Collection of different extension method specific for Silverlight
using System;
using System.Diagnostics;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.Threading;
namespace Renci.SshNet.Common
{
internal static class Extensions
{
[DebuggerNonUserCode]
internal static void Dispose(this Socket socket)
{
if (socket == null)
throw new NullReferenceException();
socket.Close();
}
[DebuggerNonUserCode]
internal static void Dispose(this WaitHandle handle)
{
if (handle == null)
throw new NullReferenceException();
handle.Close();
}
[DebuggerNonUserCode]
internal static void Dispose(this HashAlgorithm algorithm)
{
if (algorithm == null)
throw new NullReferenceException();
algorithm.Clear();
}
}
}