Exemple #1
0
        public BindingPane(Telemetry telemetry)
            : base(null)
        {
            StringCache stringCache = new StringCache();

            this.telemetry               = telemetry;
            this.bindingParser           = new BindingEntryParser(stringCache);
            this.viewModel               = new BindingPaneViewModel(telemetry, stringCache);
            this.cancellationTokenSource = new CancellationTokenSource();
            this.Caption = Resource.ToolWindow_Title;
        }
Exemple #2
0
        public BindingEntryParser(StringCache stringCache)
        {
            this.stringCache = stringCache;

            this.processTextRegex = new Regex(@"^System.Windows.Data Error: (?<code>\d+) : (?<text>.+?)$",
                                              RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.Multiline);

            // BindingEntryType.PathError
            this.pathErrorRegex = new Regex($@"BindingExpression path error: '(?<{nameof(BindingEntry.SourceProperty)}>.+?)' property not found on '(object|current item of collection)' '{BindingEntryParser.CaptureItem(nameof(BindingEntry.SourcePropertyType), nameof(BindingEntry.SourcePropertyName))}'. BindingExpression:Path=(?<{nameof(BindingEntry.BindingPath)}>.+?); DataItem={BindingEntryParser.CaptureItem(nameof(BindingEntry.DataItemType), nameof(BindingEntry.DataItemName))}; target element is {BindingEntryParser.CaptureItem(nameof(BindingEntry.TargetElementType), nameof(BindingEntry.TargetElementName))}; target property is '(?<{nameof(BindingEntry.TargetProperty)}>.+?)' \(type '(?<{nameof(BindingEntry.TargetPropertyType)}>.+?)'\)",
                                            RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture);
        }