Exemplo n.º 1
0
        private void SetWatsonMethodNameFromStackTrace()
        {
            int        num  = 0;
            string     arg  = string.Empty;
            string     arg2 = string.Empty;
            StackFrame frame;
            MethodBase method;

            for (;;)
            {
                frame  = this.stackTrace.GetFrame(num);
                method = frame.GetMethod();
                string name = method.Name;
                if (name.IndexOf("log", StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    break;
                }
                num++;
                if (num >= this.stackTrace.FrameCount)
                {
                    return;
                }
            }
            num   += 2;
            frame  = this.stackTrace.GetFrame(num);
            method = frame.GetMethod();
            arg    = method.Name;
            arg2   = WatsonReport.GetShortParameter(method.DeclaringType.FullName);
            this.watsonMethodName = arg2 + '.' + arg;
        }
Exemplo n.º 2
0
 protected override string GetShortParameter(uint bucketParamId, string longParameter)
 {
     if (bucketParamId == 4U && Uri.IsWellFormedUriString(longParameter, UriKind.RelativeOrAbsolute))
     {
         return(longParameter.Trim());
     }
     return(WatsonReport.GetShortParameter(longParameter.Trim()));
 }