Exemplo n.º 1
0
        private void Run_UpdateStats(object sender, RoutedEventArgs e)
        {
            UC_RunBook_Item reporter = sender as UC_RunBook_Item;

            Total               += reporter.ElapsedTime;
            Succeed             += reporter.Succeed;
            Failed              += reporter.Failed;
            ElapsedTime         += reporter.ElapsedTime;
            AverageTime         += reporter.AverageTime;
            DeliveredPercentage += reporter.DeliveredPercentage;

            TB_NMessages.Text   = string.Format(CultureInfo.InvariantCulture, "{0:### ### ###.#}", Total).Trim();
            TB_N_Delivered.Text = string.Format(CultureInfo.InvariantCulture, "{0:###}", DeliveredPercentage);
            TB_N_AVG.Text       = TextHandler.GetTimeFormattedFromMilseconds(AverageTime);
            TB_N_Elapsed.Text   = TextHandler.GetTimeFormattedFromMilseconds(ElapsedTime);
            TB_N_Failed.Text    = string.Format(CultureInfo.InvariantCulture, "{0:### ### ###.#}", Failed).Trim();
            TB_N_Succeed.Text   = string.Format(CultureInfo.InvariantCulture, "{0:### ### ###.#}", Succeed).Trim();
        }
Exemplo n.º 2
0
        public void AddRun(EnvironmentHandler.Type environment, Tenant project, D2CMessagesConfig.Category D2CMessagesCategory, D2CMessagesConfig.Kind D2CMessagesKind, double nMessages, double nRuns, double nSeconds, List <Device> devices)
        {
            if (devices is null)
            {
                return;
            }

            RunBookItem newItem = new RunBookItem(environment, project, D2CMessagesCategory, D2CMessagesKind, nMessages, nRuns, nSeconds, devices, DateTime.Now);

            RunBookItems.Add(newItem);
            NActiveRuns++;

            var run = new UC_RunBook_Item()
            {
                Item = newItem,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Top
            };

            run.UpdateStats        += Run_UpdateStats;
            run.Done               += Run_Done;
            run.DoneAndUpdate      += Run_DoneAndUpdate;
            run.DoneUpdateAndClean += Run_DoneUpdateAndClean;
            run.DoneAndUpdateStyle += Run_DoneAndUpdateStyle;

            run.BindData();

            GRD_Runs_List.Children.Insert(0, run);

            int counter = 0;

            foreach (UC_RunBook_Item item in GRD_Runs_List.Children)
            {
                item.Margin = new Thickness(0, counter * ItemHeight + counter * DefaultMarginTop, DefaultMarginRight, 0);

                counter++;
            }

            SetAlertInfo();

            SB_Show_BTN.Begin();
        }