Beispiel #1
0
        public override TreeNode Render()
        {
            if (!Analyzer.ErrorSources.Any())
            {
                return(CreateNode(Analyzer.NoErrorFoundMessage));
            }

            var rootNode = CreateNode($"Out-of-database-connections error(s) found: {Analyzer.ErrorSources.Count}");

            ContextMenuStrips.Add(rootNode, createContextMenuStripForErrorNode(rootNode));

            var firstOccurrenceNode = CreateNode($"First occurrence at line {Analyzer.ErrorSources.First().LineNumber} in {Analyzer.ErrorSources.First().Source}");

            ContextMenuStrips.Add(firstOccurrenceNode,
                                  createContextMenuForLogFile(firstOccurrenceNode, Analyzer.ErrorSources.First().Source));
            rootNode.Nodes.Add(firstOccurrenceNode);

            var lastOccurrenceNode = CreateNode($"Last occurrence at line {Analyzer.ErrorSources.Last().LineNumber} in {Analyzer.ErrorSources.Last().Source}");

            ContextMenuStrips.Add(lastOccurrenceNode,
                                  createContextMenuForLogFile(lastOccurrenceNode, Analyzer.ErrorSources.Last().Source));
            rootNode.Nodes.Add(lastOccurrenceNode);

            TreeNode errorMessageNode = CreateNode("Error message");

            rootNode.Nodes.Add(errorMessageNode);

            ContextMenuStrips.Add(errorMessageNode, createContextMenuStripForErrorNode(errorMessageNode));

            CreateChunkedNodesFromString(Analyzer.ErrorMessage)
            .ToList().ForEach(n => errorMessageNode.Nodes.Add(n));

            return(rootNode);
        }
        public override TreeNode Render()
        {
            var node = CreateNode(Analyzer.AnalysesToString());

            ContextMenuStrips.Add(node, CreateCommonContextMenuStrip(node));
            return(node);
        }
        public override TreeNode Render()
        {
            if (!Analyzer.Results.Any())
            {
                return(CreateNode($"No matches found for {Analyzer.DisplayName} using pattern \"{Analyzer.RegexPattern}\""));
            }
            var rootNode        = CreateNode($"{Analyzer.DisplayName} matches found using pattern \"{Analyzer.RegexPattern}\": {Analyzer.Results.Count}");
            var matchesBySource = Analyzer.Results.GroupBy(e => e.Source,
                                                           (key, g) => new {
                Source  = key,
                Matches = g.ToList()
            });

            foreach (var matchGroup in matchesBySource)
            {
                var errorNode = CreateNode($"{matchGroup.Source} ({matchGroup.Matches.Count})");
                ContextMenuStrips.Add(errorNode, createContextMenuForLogFile(errorNode, matchGroup.Source));
                foreach (var match in matchGroup.Matches)
                {
                    var textNode = CreateNode($"Ln {match.StartLineNumber}: {match.Text}");
                    ContextMenuStrips.Add(textNode, CreateCommonContextMenuStrip(textNode));
                    errorNode.Nodes.Add(textNode);
                }
                rootNode.Nodes.Add(errorNode);
            }
            return(rootNode);
        }
        public override TreeNode Render()
        {
            var rootNode = new TreeNode {
                Text = $"Daily Inventory Cache Update Analyzer Results ({Analyzer.DailyInventoryCacheUpdates.Count})"
            };

            foreach (var cacheUpdate in Analyzer.DailyInventoryCacheUpdates)
            {
                var acctNode = CreateNodeWithCommonContextMenuStrip($"{cacheUpdate.Reference} - {cacheUpdate.AccountId}");

                var sourceNode = CreateNode($"Source: {cacheUpdate.Source}");
                ContextMenuStrips.Add(sourceNode, CreateContextMenuItemForLogFile(sourceNode, cacheUpdate.Source));
                acctNode.Nodes.Add(sourceNode);

                acctNode.Nodes.Add($"Lines {cacheUpdate.StartLineNumber} to {cacheUpdate.EndLineNumber}");
                acctNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Old Start Date: {cacheUpdate.OldStartDate}, Old End Date: {cacheUpdate.OldEndDate}"));
                acctNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"New Start Date: {cacheUpdate.NewStartDate}, New End Date: {cacheUpdate.NewEndDate}"));
                acctNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Old inventory: {cacheUpdate.OldInventoryIds}"));
                acctNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"New inventory: {cacheUpdate.NewInventoryIds}"));

                foreach (var log in cacheUpdate.LogEntries)
                {
                    acctNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Ln {log.StartLineNumber} {log.LogText}"));
                }
                rootNode.Nodes.Add(acctNode);
            }
            return(rootNode);
        }
        public override TreeNode Render()
        {
            var rootNode = new TreeNode {
                Text = $"Closed for Checkout Analyzer Results ({Analyzer.ClosedForCheckoutResults.Count})"
            };

            foreach (var result in Analyzer.ClosedForCheckoutResults)
            {
                var inventoryNode = CreateNodeWithCommonContextMenuStrip($"Inventory {result.InventoryId} | {result.Date}");
                var sourceNode    = CreateNode($"Ln {result.StartLineNumber} to {result.EndLineNumber} in {result.Source}");
                ContextMenuStrips.Add(sourceNode, CreateContextMenuItemForLogFile(sourceNode, result.Source));

                var productNode = CreateNodeWithCommonContextMenuStrip($"Product: {result.ProductName} ({result.ProductId})");
                var closedForCheckoutResultNode = CreateNodeWithCommonContextMenuStrip($"ClosedForCheckout result: {result.ClosedForCheckoutResult}");
                inventoryNode.Nodes.Add(productNode);
                inventoryNode.Nodes.Add(closedForCheckoutResultNode);
                inventoryNode.Nodes.Add(sourceNode);

                var dailyRatePlanLineNodes = CreateNode("Daily Rate Plan Lines");
                foreach (var drpl in result.DailyRatePlanLines)
                {
                    var drplNode = CreateNodeWithCommonContextMenuStrip($"{drpl.Id} - ClosedForCheckout: {drpl.ClosedForCheckout}");
                    dailyRatePlanLineNodes.Nodes.Add(drplNode);
                }
                inventoryNode.Nodes.Add(dailyRatePlanLineNodes);
                rootNode.Nodes.Add(inventoryNode);
            }
            return(rootNode);
        }
        public override TreeNode Render()
        {
            var rootBookingAnalyzer = new TreeNode {
                Text = $"Booking Analyzer Results ({Analyzer.Bookings.Count})"
            };

            foreach (var booking in Analyzer.Bookings)
            {
                var bookingNode = new TreeNode();
                bookingNode.Text = $"{booking.CustomerLastName}, {booking.CustomerFirstName}";
                ContextMenuStrips.Add(bookingNode, createContextMenuForBookingNode(bookingNode, booking));

                bookingNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Account Id: {booking.AccountId}"));
                bookingNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Distributor: {booking.DistributorShortName}"));
                bookingNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Provider: {booking.PrimaryProvider}"));
                bookingNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Commences: {booking.StartDateUTC}, Concludes: {booking.EndDateUTC}"));
                bookingNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Payment Amount: {booking.AmountPaid}"));
                bookingNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Payment Option: {booking.PaymentOption}"));
                bookingNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"Channel Commission: {booking.ChannelCommission}"));
                bookingNode.Nodes.Add(CreateNodeWithCommonContextMenuStrip($"{booking.ProductName} ({booking.ProductId})"));
                bookingNode.Nodes.Add(CreateNode($"Products: {booking.ProductTotal}, Extras: {booking.ExtrasTotal}"));

                createConfirmationNodes(booking, bookingNode);

                var logFileNode = CreateNode($"Source: {booking.Source}");
                ContextMenuStrips.Add(logFileNode, CreateContextMenuItemForLogFile(logFileNode, booking.Source));
                bookingNode.Nodes.Add(logFileNode);
                bookingNode.Nodes.Add(CreateNode($"Lines {booking.StartLineNumber} to {booking.EndLineNumber}"));

                if (booking.MiscellaneousTraceData.Any())
                {
                    var mtdRootNode = CreateNode($"Miscellaneous trace data");
                    bookingNode.Nodes.Add(mtdRootNode);
                    foreach (var mtd in booking.MiscellaneousTraceData)
                    {
                        var mtdNode     = CreateNode($"Ln {mtd.StartLineNumber} {mtd.ParsedMiscTraceData}");
                        var contextMenu = CreateContextMenuItemForLogFile(mtdNode, mtd.Source);
                        ContextMenuStrips.Add(mtdNode, contextMenu);
                        mtdRootNode.Nodes.Add(mtdNode);
                    }
                }

                rootBookingAnalyzer.Nodes.Add(bookingNode);
            }
            return(rootBookingAnalyzer);
        }
        private void createConfirmationNodes(BookingAnalysis booking, TreeNode bookingNode)
        {
            if (booking.Confirmation != null)
            {
                var referenceNode = CreateNodeWithCommonContextMenuStrip($"Reference: {booking.Confirmation.Reference}");
                bookingNode.Nodes.Add(referenceNode);

                var obxRefNode = CreateNode($"OBX Ref: {booking.Confirmation.ObxReference}");
                if (!string.IsNullOrWhiteSpace(booking.Confirmation.ObxReference))
                {
                    ContextMenuStrips.Add(obxRefNode, CreateCommonContextMenuStrip(obxRefNode));
                }
                bookingNode.Nodes.Add(obxRefNode);
            }
            else
            {
                bookingNode.Nodes.Add(CreateNode("No reservation confirmation data found"));
            }
        }
Beispiel #8
0
        public override TreeNode Render()
        {
            var rootNode = CreateNode($"Unhandled error(s) found: {Analyzer.Errors.Count}");

            var errorsBySource = Analyzer.Errors.GroupBy(e => e.Source,
                                                         (key, g) => new {
                Source = key,
                Errors = g.ToList()
            });

            foreach (var errorGroup in errorsBySource)
            {
                var errorNode = CreateNode($"{errorGroup.Source} ({errorGroup.Errors.Count})");
                ContextMenuStrips.Add(errorNode, createContextMenuForLogFile(errorNode, errorGroup.Source));
                foreach (var error in errorGroup.Errors)
                {
                    var errorMessageNode = CreateNode($"Ln {error.StartLineNumber}: {error.ErrorMessage}");
                    ContextMenuStrips.Add(errorMessageNode, CreateCommonContextMenuStrip(errorMessageNode));
                    errorNode.Nodes.Add(errorMessageNode);
                }
                rootNode.Nodes.Add(errorNode);
            }
            return(rootNode);
        }