System.Net.ValidationHelper.HashString C# (CSharp) Method

HashString() public static method

public static HashString ( object objectValue ) : string
objectValue object
return string
        public static string HashString(object objectValue) {
            if (objectValue == null) {
                return "(null)";
            } else if (objectValue is string && ((string)objectValue).Length==0) {
                return "(string.empty)";
            } else {
                return objectValue.GetHashCode().ToString(NumberFormatInfo.InvariantInfo);
            }
        }

Usage Example

Example #1
0
 /// <devdoc>
 ///    <para>Logs an Info line</para>
 /// </devdoc>
 internal static void PrintInfo(TraceSource traceSource, object obj, string method, string param)
 {
     if (!ValidateSettings(traceSource, TraceEventType.Information))
     {
         return;
     }
     PrintLine(traceSource, TraceEventType.Information, 0,
               GetObjectName(obj) + "#" + ValidationHelper.HashString(obj)
               + "::" + method + "(" + param + ")");
 }
All Usage Examples Of System.Net.ValidationHelper::HashString