private ITableEntry ProcessKnownError(WpfTraceInfo info, Regex lineRegex, string text)
        {
            Match match = lineRegex.Match(text);

            if (!match.Success)
            {
                Debug.Fail($"Failed to parse error code {(int)info.Code}: {text}");
                return(this.ProcessUnknownError(info, text));
            }

            return(new WpfEntry(info, match, this.StringCache));
        }
        protected override ITableEntry ProcessLine(Match match)
        {
            string categoryString = match.Groups[WpfOutputParser.CaptureCategory].Value;
            string severityString = match.Groups[WpfOutputParser.CaptureSeverity].Value;
            string codeString     = match.Groups[WpfOutputParser.CaptureCode].Value;
            string text           = match.Groups[WpfOutputParser.CaptureText].Value;

            WpfTraceInfo info = new WpfTraceInfo(
                WpfTraceCategoryUtility.Parse(categoryString),
                WpfTraceSeverityUtility.Parse(severityString),
                WpfTraceCodeUtility.Parse(codeString));

            return(this.CodeToRegex.TryGetValue(info.Code, out Lazy <Regex> regex)
                ? this.ProcessKnownError(info, regex.Value, text)
                : this.ProcessUnknownError(info, text));
        }
Beispiel #3
0
        public WpfEntry(WpfTraceInfo info, string description, StringCache stringCache)
            : base(stringCache)
        {
            this.Info = info;

            this.SourceProperty     = string.Empty;
            this.SourcePropertyType = string.Empty;
            this.SourcePropertyName = string.Empty;
            this.BindingPath        = string.Empty;
            this.DataItemType       = string.Empty;
            this.DataItemName       = string.Empty;
            this.DataValue          = string.Empty;
            this.TargetElementType  = string.Empty;
            this.TargetElementName  = string.Empty;
            this.TargetProperty     = string.Empty;
            this.TargetPropertyType = string.Empty;
            this.Description        = stringCache.Get(description);
        }
Beispiel #4
0
        public WpfEntry(WpfTraceInfo info, Match match, StringCache stringCache)
            : base(stringCache)
        {
            this.Info = info;

            this.SourceProperty     = stringCache.Get(match.Groups[nameof(this.SourceProperty)].Value);
            this.SourcePropertyType = stringCache.Get(match.Groups[nameof(this.SourcePropertyType)].Value);
            this.SourcePropertyName = stringCache.Get(match.Groups[nameof(this.SourcePropertyName)].Value);
            this.BindingPath        = stringCache.Get(match.Groups[nameof(this.BindingPath)].Value);
            this.DataItemType       = stringCache.Get(match.Groups[nameof(this.DataItemType)].Value);
            this.DataItemName       = stringCache.Get(match.Groups[nameof(this.DataItemName)].Value);
            this.DataValue          = stringCache.Get(match.Groups[nameof(this.DataValue)].Value);
            this.TargetElementType  = stringCache.Get(match.Groups[nameof(this.TargetElementType)].Value);
            this.TargetElementName  = stringCache.Get(match.Groups[nameof(this.TargetElementName)].Value);
            this.TargetProperty     = stringCache.Get(match.Groups[nameof(this.TargetProperty)].Value);
            this.TargetPropertyType = stringCache.Get(match.Groups[nameof(this.TargetPropertyType)].Value);
            this.Description        = stringCache.Get(this.CreateDescription(match));
        }
 private ITableEntry ProcessUnknownError(WpfTraceInfo info, string lineText)
 {
     return(new WpfEntry(info, lineText, this.StringCache));
 }