/////////////////////////////////////////////////////////////////////// public static string GetPublicKeyToken( AssemblyName assemblyName ) { if (assemblyName != null) { try { return(ArrayOps.ToHexadecimalString( assemblyName.GetPublicKeyToken())); } catch { // do nothing. } } return(null); }
private static StringList GetAsyncCompletedArguments( Uri uri, string method, byte[] rawData, NameValueCollection collection, string fileName, AsyncCompletedEventArgs eventArgs ) { StringList result = new StringList(); if (uri != null) { result.Add("uri"); result.Add(uri.ToString()); } if (method != null) { result.Add("method"); result.Add(method); } if (rawData != null) { result.Add("rawData"); result.Add(ArrayOps.ToHexadecimalString(rawData)); } if (collection != null) { result.Add("collection"); result.Add(ListOps.FromNameValueCollection( collection, new StringList()).ToString()); } if (fileName != null) { result.Add("fileName"); result.Add(fileName); } if (eventArgs != null) { bool canceled = eventArgs.Cancelled; result.Add("canceled"); result.Add(canceled.ToString()); Exception exception = eventArgs.Error; if (exception != null) { result.Add("exception"); result.Add(exception.GetType().ToString()); result.Add("error"); result.Add(exception.ToString()); } } return(result); }