Example #1
0
        public LeveledStringBuilder ToString(LeveledStringBuilder sb, bool withName = true)
        {
            if (withName)
            {
                sb.Append(DatasourceName);
                sb.Append(": ");
            }
            sb.Append(Stats);
            sb++;
            if (ErrorMessage != null)
            {
                sb.AppendLine().Append(ErrorMessage);
            }

            if (PostProcessorReports != null)
            {
                sb++;
                foreach (var ppr in PostProcessorReports)
                {
                    sb.AppendLine();
                    ppr.ToString(sb);
                }
                sb--;
            }
            sb--;
            return(sb);
        }
Example #2
0
        public override string ToString()
        {
            var sb = new LeveledStringBuilder("   ");

            ToString(sb, true);
            return(sb.ToString());
        }
Example #3
0
 public LeveledStringBuilder ToString(LeveledStringBuilder sb, bool withName = true)
 {
     if (withName)
     {
         sb.Append(Name).Append(": ");
     }
     sb.Append(Stats);
     return(sb);
 }
Example #4
0
        public override string ToString()
        {
            var sb = new LeveledStringBuilder("-- ", "   ");

            foreach (var ds in DatasourceReports)
            {
                ds.ToString(sb.OptAppendLine());
            }

            if (UnknownSwitches != null)
            {
                sb.Append("Unknown switches: ");
                sb.Append(UnknownSwitches);
                sb.AppendLine();
            }
            if (MentionedSwitches != null)
            {
                sb.Append("Unknown switches: ");
                sb.Append(MentionedSwitches);
                sb.AppendLine();
            }
            return(sb.ToString());
        }
Example #5
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (asyncAdmin == null || !asyncAdmin.CheckStopped())
            {
                return;
            }
            try
            {
                timer1.Enabled = false;
                UseWaitCursor  = false;
                enableAllButCancel();
                asyncAdmin.Stop();

                gridStatus.Rows.Clear();
                gridStatus.Rows.Add(2 + asyncAdmin.Report.DatasourceReports.Count);
                int i = 0;
                if (asyncAdmin.Report.DatasourceReports.Count > 0)
                {
                    var line = new LeveledStringBuilder(null, "    ");
                    foreach (var rep in asyncAdmin.Report.DatasourceReports)
                    {
                        line.Buffer.Clear();
                        addRow(gridStatus.Rows[i++], rep.DatasourceName, rep.ToString(line, false).ToString());
                    }
                }
                addRow(gridStatus.Rows[i++], "Unknown switches", asyncAdmin.Report.UnknownSwitches);
                addRow(gridStatus.Rows[i++], "Mentioned switches", asyncAdmin.Report.MentionedSwitches);
                gridStatus.Columns[1].Width = gridStatus.Width - gridStatus.Columns[0].Width - 10;
                Utils.FreeAndNil(ref asyncAdmin);
            }
            catch
            {
                Utils.FreeAndNil(ref asyncAdmin);
                throw;
            }
        }