return new ConfigXmlCDataSection (this, data);
}
- public override XmlComment CreateComment (string comment)
+ public override XmlComment CreateComment (string data)
{
- return new ConfigXmlComment (this, comment);
+ return new ConfigXmlComment (this, data);
}
public override XmlElement CreateElement (string prefix, string localName, string namespaceUri)
get { return properties; }
}
- public override bool Equals (object o)
+ public override bool Equals (object settings)
{
- SettingElement e = o as SettingElement;
+ SettingElement e = settings as SettingElement;
if (e == null)
return false;
{
SpecialSetting setting;
- public SpecialSettingAttribute (SpecialSetting setting)
+ public SpecialSettingAttribute (SpecialSetting specialSetting)
{
- this.setting = setting;
+ this.setting = specialSetting;
}
public SpecialSetting SpecialSetting {
return CounterSampleCalculator.ComputeCounterValue (counterSample, nextCounterSample);
}
- public override bool Equals (object obj)
+ public override bool Equals (object o)
{
- if (!(obj is CounterSample))
+ if (!(o is CounterSample))
return false;
- return Equals ((CounterSample) obj);
+ return Equals ((CounterSample) o);
}
- public bool Equals (CounterSample other)
+ public bool Equals (CounterSample sample)
{
return
- rawValue == other.rawValue &&
- baseValue == other.counterFrequency &&
- counterFrequency == other.counterFrequency &&
- systemFrequency == other.systemFrequency &&
- timeStamp == other.timeStamp &&
- timeStamp100nSec == other.timeStamp100nSec &&
- counterTimeStamp == other.counterTimeStamp &&
- counterType == other.counterType;
+ rawValue == sample.rawValue &&
+ baseValue == sample.counterFrequency &&
+ counterFrequency == sample.counterFrequency &&
+ systemFrequency == sample.systemFrequency &&
+ timeStamp == sample.timeStamp &&
+ timeStamp100nSec == sample.timeStamp100nSec &&
+ counterTimeStamp == sample.counterTimeStamp &&
+ counterType == sample.counterType;
}
- public static bool operator == (CounterSample obj1, CounterSample obj2)
+ public static bool operator == (CounterSample a, CounterSample b)
{
- return obj1.Equals (obj2);
+ return a.Equals (b);
}
- public static bool operator != (CounterSample obj1, CounterSample obj2)
+ public static bool operator != (CounterSample a, CounterSample b)
{
- return !obj1.Equals (obj2);
+ return !a.Equals (b);
}
public override int GetHashCode ()
get { return this; }
}
- public void CopyTo (EventLogEntry[] eventLogEntries, int index)
+ public void CopyTo (EventLogEntry[] entries, int index)
{
EventLogEntry[] evLogEntries = _impl.GetEntries ();
- Array.Copy (evLogEntries, 0, eventLogEntries, index, evLogEntries.Length);
+ Array.Copy (evLogEntries, 0, entries, index, evLogEntries.Length);
}
public IEnumerator GetEnumerator ()
[ComVisible (false)]
public override void TraceData (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, object data)
{
EventLogEntryType type;
- switch (eventType) {
+ switch (severity) {
case TraceEventType.Critical:
case TraceEventType.Error:
type = EventLogEntryType.Error;
[ComVisible (false)]
public override void TraceData (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, params object [] data)
{
string s = String.Empty;
arr [i] = data [i] != null ? data [i].ToString () : String.Empty;
s = String.Join (", ", arr);
}
- TraceData (eventCache, source, eventType, id, s);
+ TraceData (eventCache, source, severity, id, s);
}
[ComVisible (false)]
public override void TraceEvent (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, string message)
{
- TraceData (eventCache, source, eventType, id, message);
+ TraceData (eventCache, source, severity, id, message);
}
[ComVisible (false)]
public override void TraceEvent (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, string format, params object [] args)
{
- TraceEvent (eventCache, source, eventType, id, format != null ? String.Format (format, args) : null);
+ TraceEvent (eventCache, source, severity, id, format != null ? String.Format (format, args) : null);
}
}
}
}
[Obsolete ("Process.Start is not supported on the current platform.", true)]
- public static Process Start(string fileName, string username, SecureString password, string domain)
+ public static Process Start(string fileName, string userName, SecureString password, string domain)
{
throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform.");
}
[Obsolete ("Process.Start is not supported on the current platform.", true)]
- public static Process Start(string fileName, string arguments, string username, SecureString password, string domain)
+ public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain)
{
throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform.");
}
}
}
- public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state)
+ public override IAsyncResult BeginRead (byte [] array, int offset, int count,
+ AsyncCallback asyncCallback, object asyncState)
{
if (disposed)
throw new ObjectDisposedException (GetType ().FullName);
if (!CanRead)
throw new NotSupportedException ("This stream does not support reading");
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ if (array == null)
+ throw new ArgumentNullException ("array");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
if (offset < 0)
throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
- if (count + offset > buffer.Length)
+ if (count + offset > array.Length)
throw new ArgumentException ("Buffer too small. count/offset wrong.");
ReadMethod r = new ReadMethod (ReadInternal);
- return r.BeginInvoke (buffer, offset, count, cback, state);
+ return r.BeginInvoke (array, offset, count, asyncCallback, asyncState);
}
- public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state)
+ public override IAsyncResult BeginWrite (byte [] array, int offset, int count,
+ AsyncCallback asyncCallback, object asyncState)
{
if (disposed)
throw new ObjectDisposedException (GetType ().FullName);
if (!CanWrite)
throw new InvalidOperationException ("This stream does not support writing");
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ if (array == null)
+ throw new ArgumentNullException ("array");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
if (offset < 0)
throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
- if (count + offset > buffer.Length)
+ if (count + offset > array.Length)
throw new ArgumentException ("Buffer too small. count/offset wrong.");
WriteMethod w = new WriteMethod (WriteInternal);
- return w.BeginInvoke (buffer, offset, count, cback, state);
+ return w.BeginInvoke (array, offset, count, asyncCallback, asyncState);
}
- public override int EndRead(IAsyncResult async_result)
+ public override int EndRead(IAsyncResult asyncResult)
{
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
+ if (asyncResult == null)
+ throw new ArgumentNullException ("asyncResult");
- AsyncResult ares = async_result as AsyncResult;
+ AsyncResult ares = asyncResult as AsyncResult;
if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
ReadMethod r = ares.AsyncDelegate as ReadMethod;
if (r == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
- return r.EndInvoke (async_result);
+ return r.EndInvoke (asyncResult);
}
- public override void EndWrite (IAsyncResult async_result)
+ public override void EndWrite (IAsyncResult asyncResult)
{
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
+ if (asyncResult == null)
+ throw new ArgumentNullException ("asyncResult");
- AsyncResult ares = async_result as AsyncResult;
+ AsyncResult ares = asyncResult as AsyncResult;
if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
WriteMethod w = ares.AsyncDelegate as WriteMethod;
if (w == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
- w.EndInvoke (async_result);
+ w.EndInvoke (asyncResult);
return;
}
return encoding.GetString (seen.ToArray ());
}
- public void Write (string str)
+ public void Write (string text)
{
CheckOpen ();
- if (str == null)
- throw new ArgumentNullException ("str");
+ if (text == null)
+ throw new ArgumentNullException ("text");
- byte [] buffer = encoding.GetBytes (str);
+ byte [] buffer = encoding.GetBytes (text);
Write (buffer, 0, buffer.Length);
}
stream.Write (bytes, 0, bytes.Length);
}
- public void WriteLine (string str)
+ public void WriteLine (string text)
{
- Write (str + new_line);
+ Write (text + new_line);
}
void CheckOpen ()
return av;
}
- public static AlternateView CreateAlternateViewFromString (string content, Encoding encoding, string mediaType)
+ public static AlternateView CreateAlternateViewFromString (string content, Encoding contentEncoding, string mediaType)
{
if (content == null)
throw new ArgumentNullException ("content");
- if (encoding == null)
- encoding = Encoding.UTF8;
- MemoryStream ms = new MemoryStream (encoding.GetBytes (content));
+ if (contentEncoding == null)
+ contentEncoding = Encoding.UTF8;
+ MemoryStream ms = new MemoryStream (contentEncoding.GetBytes (content));
ContentType ct = new ContentType ();
ct.MediaType = mediaType;
- ct.CharSet = encoding.HeaderName;
+ ct.CharSet = contentEncoding.HeaderName;
AlternateView av = new AlternateView (ms, ct);
av.TransferEncoding = TransferEncoding.QuotedPrintable;
return av;
#region Methods
- public override bool Equals (object obj)
+ public override bool Equals (object value)
{
- if (obj == null)
+ if (value == null)
return false;
- return (0 == String.Compare (ToString (), obj.ToString (), StringComparison.OrdinalIgnoreCase));
+ return (0 == String.Compare (ToString (), value.ToString (), StringComparison.OrdinalIgnoreCase));
}
public override int GetHashCode ()
}
}
- public void Send (string from, string to, string subject, string body)
+ public void Send (string from, string recipients, string subject, string body)
{
- Send (new MailMessage (from, to, subject, body));
+ Send (new MailMessage (from, recipients, subject, body));
}
public Task SendMailAsync (MailMessage message)
worker.RunWorkerAsync (userToken);
}
- public void SendAsync (string from, string to, string subject, string body, object userToken)
+ public void SendAsync (string from, string recipients, string subject, string body, object userToken)
{
- SendAsync (new MailMessage (from, to, subject, body), userToken);
+ SendAsync (new MailMessage (from, recipients, subject, body), userToken);
}
public void SendAsyncCancel ()
{
}
- protected SmtpException (SerializationInfo info, StreamingContext context)
- : base (info, context)
+ protected SmtpException (SerializationInfo serializationInfo, StreamingContext streamingContext)
+ : base (serializationInfo, streamingContext)
{
try {
- statusCode = (SmtpStatusCode) info.GetValue ("Status", typeof (int));
+ statusCode = (SmtpStatusCode) serializationInfo.GetValue ("Status", typeof (int));
} catch (SerializationException) {
//For compliance with previously serialized version:
- statusCode = (SmtpStatusCode) info.GetValue ("statusCode", typeof (SmtpStatusCode));
+ statusCode = (SmtpStatusCode) serializationInfo.GetValue ("statusCode", typeof (SmtpStatusCode));
}
}
#endregion // Properties
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
- if (info == null)
- throw new ArgumentNullException ("info");
- base.GetObjectData (info, context);
- info.AddValue ("Status", statusCode, typeof (int));
+ if (serializationInfo == null)
+ throw new ArgumentNullException ("serializationInfo");
+ base.GetObjectData (serializationInfo, streamingContext);
+ serializationInfo.AddValue ("Status", statusCode, typeof (int));
}
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
{
}
- protected SmtpFailedRecipientException (SerializationInfo serializationInfo, StreamingContext streamingContext)
- : base (serializationInfo, streamingContext)
+ protected SmtpFailedRecipientException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
{
- if (serializationInfo == null)
- throw new ArgumentNullException ("serializationInfo");
- failedRecipient = serializationInfo.GetString ("failedRecipient");
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ failedRecipient = info.GetString ("failedRecipient");
}
public SmtpFailedRecipientException (SmtpStatusCode statusCode, string failedRecipient) : base (statusCode)
#region Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
- if (info == null)
- throw new ArgumentNullException ("info");
- base.GetObjectData (info, context);
- info.AddValue ("innerExceptions", innerExceptions);
+ if (serializationInfo == null)
+ throw new ArgumentNullException ("serializationInfo");
+ base.GetObjectData (serializationInfo, streamingContext);
+ serializationInfo.AddValue ("innerExceptions", innerExceptions);
}
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
sockares.Complete (acc_socket, total);
});
- public Socket EndAccept (IAsyncResult result)
+ public Socket EndAccept (IAsyncResult asyncResult)
{
int bytes;
byte[] buffer;
- return EndAccept (out buffer, out bytes, result);
+ return EndAccept (out buffer, out bytes, asyncResult);
}
public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
}
});
- public IAsyncResult BeginConnect (string host, int port, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (string host, int port, AsyncCallback requestCallback, object state)
{
ThrowIfDisposedAndClosed ();
if (is_listening)
throw new InvalidOperationException ();
- return BeginConnect (Dns.GetHostAddresses (host), port, callback, state);
+ return BeginConnect (Dns.GetHostAddresses (host), port, requestCallback, state);
}
- public IAsyncResult BeginConnect (EndPoint end_point, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
- if (end_point == null)
- throw new ArgumentNullException ("end_point");
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
if (is_listening)
throw new InvalidOperationException ();
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Connect) {
- EndPoint = end_point,
+ EndPoint = remoteEP,
};
// Bug #75154: Connect() should not succeed for .Any addresses.
- if (end_point is IPEndPoint) {
- IPEndPoint ep = (IPEndPoint) end_point;
+ if (remoteEP is IPEndPoint) {
+ IPEndPoint ep = (IPEndPoint) remoteEP;
if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
return sockares;
}
- end_point = RemapIPEndPoint (ep);
+ remoteEP = RemapIPEndPoint (ep);
}
int error = 0;
bool blk = is_blocking;
if (blk)
Blocking = false;
- Connect_internal (m_Handle, end_point.Serialize (), out error, false);
+ Connect_internal (m_Handle, remoteEP.Serialize (), out error, false);
if (blk)
Blocking = true;
return sockares;
}
- public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
{
ThrowIfDisposedAndClosed ();
if (is_listening)
throw new InvalidOperationException ();
- SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Connect) {
+ SocketAsyncResult sockares = new SocketAsyncResult (this, requestCallback, state, SocketOperation.Connect) {
Addresses = addresses,
Port = port,
};
}
});
- public void EndConnect (IAsyncResult result)
+ public void EndConnect (IAsyncResult asyncResult)
{
ThrowIfDisposedAndClosed ();
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndConnect", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndConnect", "asyncResult");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
}
});
- public IAsyncResult BeginReceiveFrom (byte[] buffer, int offset, int size, SocketFlags socket_flags, ref EndPoint remote_end, AsyncCallback callback, object state)
+ public IAsyncResult BeginReceiveFrom (byte[] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
ThrowIfBufferOutOfRange (buffer, offset, size);
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.ReceiveFrom) {
Buffer = buffer,
Offset = offset,
Size = size,
- SockFlags = socket_flags,
- EndPoint = remote_end,
+ SockFlags = socketFlags,
+ EndPoint = remoteEP,
};
QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
sockares.Complete (total);
});
- public int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
+ public int EndReceiveFrom(IAsyncResult asyncResult, ref EndPoint endPoint)
{
ThrowIfDisposedAndClosed ();
- if (end_point == null)
- throw new ArgumentNullException ("remote_end");
+ if (endPoint == null)
+ throw new ArgumentNullException ("endPoint");
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndReceiveFrom", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceiveFrom", "asyncResult");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
sockares.CheckIfThrowDelayedException();
- end_point = sockares.EndPoint;
+ endPoint = sockares.EndPoint;
return sockares.Total;
}
}
});
- public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socket_flags, EndPoint remote_end, AsyncCallback callback, object state)
+ public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
Buffer = buffer,
Offset = offset,
Size = size,
- SockFlags = socket_flags,
- EndPoint = remote_end,
+ SockFlags = socketFlags,
+ EndPoint = remoteEP,
};
QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
sockares.Complete ();
}
- public int EndSendTo (IAsyncResult result)
+ public int EndSendTo (IAsyncResult asyncResult)
{
ThrowIfDisposedAndClosed ();
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndSendTo", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndSendTo", "result");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
return result.Response;
}
- public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext)
+ public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext context)
{
- transportContext = null;
+ context = null;
return EndGetRequestStream (asyncResult);
}
_flags = StorePermissionFlags.NoFlags;
}
- public StorePermission (StorePermissionFlags flags)
+ public StorePermission (StorePermissionFlags flag)
{
// reuse validation by the Flags property
- Flags = flags;
+ Flags = flag;
}
return ((_flags & ~dp._flags) == 0);
}
- public override void FromXml (SecurityElement e)
+ public override void FromXml (SecurityElement securityElement)
{
// General validation in CodeAccessPermission
- PermissionHelper.CheckSecurityElement (e, "e", version, version);
+ PermissionHelper.CheckSecurityElement (securityElement, "securityElement", version, version);
// Note: we do not (yet) care about the return value
// as we only accept version 1 (min/max values)
- string s = e.Attribute ("Flags");
+ string s = securityElement.Attribute ("Flags");
if (s == null)
_flags = StorePermissionFlags.NoFlags;
else
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
- Assert.AreEqual ("info", ex.ParamName, "#5");
+ Assert.AreEqual ("serializationInfo", ex.ParamName, "#5");
}
}
}
class MySmtpException : SmtpException {
- public MySmtpException (SerializationInfo info, StreamingContext context)
- : base (info, context)
+ public MySmtpException (SerializationInfo serializationInfo, StreamingContext streamingContext)
+ : base (serializationInfo, streamingContext)
{
}
}