Esempio n. 1
0
 private void SetInfo(int id, string textData, long duration, DateTime startTime, long reads, long writes, long cpu, long rows)
 {
     idValueLabel.Text                = id.ToString();
     textDataValueLabel.Text          = textData;
     durationValueLabel.Text          = GetTimeStringText(Convert.ToInt32(duration));
     relativeStartTimeValueLabel.Text = GetTimeStringText(GetRelativeStartTime(startTime));
     startTimeValueLabel.Text         = GenericHelper.FormatLongDate(startTime);
     readsValueLabel.Text             = reads.ToString();
     writesValueLabel.Text            = writes.ToString();
     cpuValueLabel.Text               = cpu.ToString();
     rowsValueLabel.Text              = rows.ToString();
     _textData = textData;
 }
Esempio n. 2
0
    private string GetBasedOnText()
    {
        string periodText;

        if (ConfigHandler.UseTranslation)
        {
            periodText = Translator.GetText("Period");
        }
        else
        {
            periodText = "Period:";
        }

        string totalEvents;

        if (ConfigHandler.UseTranslation)
        {
            totalEvents = Translator.GetText("TotalEvents");
        }
        else
        {
            totalEvents = "Based on {0} events";
        }

        string period;

        if (_minStartTime == DateTime.MinValue && _maxStartTime == DateTime.MinValue)
        {
            if (ConfigHandler.UseTranslation)
            {
                period = Translator.GetText("None");
            }
            else
            {
                period = "None";
            }
        }
        else
        {
            period = string.Format("{0} - {1}", GenericHelper.FormatLongDate(_minStartTime), GenericHelper.FormatLongDate(_maxStartTime));
        }

        totalEvents = string.Format(totalEvents, GenericHelper.FormatWithThousandSeparator(_totalRows));

        return(string.Format("{0} {1}, {2}", periodText, period, totalEvents));
    }
Esempio n. 3
0
    private void AddBarLabels(int i)
    {
        int id = Convert.ToInt32(_dataTable.Rows[i][0]);

        string barLabelText;

        if (barLabelsComboBox.SelectedItem.ToString() == "Duration")
        {
            barLabelText = GetTimeStringText(Convert.ToInt32(_dataTable.Rows[i][barLabelsComboBox.SelectedItem.ToString()]));
        }
        else if (barLabelsComboBox.SelectedItem.ToString() == "StartTime")
        {
            DateTime startTime = Convert.ToDateTime(_dataTable.Rows[i][barLabelsComboBox.SelectedItem.ToString()]);
            barLabelText = GenericHelper.FormatLongDate(startTime);
        }
        else
        {
            barLabelText = _dataTable.Rows[i][barLabelsComboBox.SelectedItem.ToString()].ToString();
        }

        AddText(_bmp, i, id, barLabelText);
    }