Example #1
0
 private void resetStatusStrip()
 {
     ToolStripStatusLabel1.Text      = "";
     ToolStripStatusLabel1.ForeColor = Color.Black;
     StatusStrip1.Refresh();
     ErrorRichTextBox.ResetText();
 }
Example #2
0
 private void mViewer_OnStatus(string msg, int index, int max)
 {
     lblStatus.Text   = msg;
     Progress.Maximum = max;
     Progress.Value   = index;
     StatusStrip1.Refresh();
 }
Example #3
0
 private void alterStatusLabel(ToolStripStatusLabel lbl, string val)
 {
     if (StatusStrip1.InvokeRequired == true)
     {
         StatusStrip1.BeginInvoke(new Action(() => alterStatusLabel(lbl, val)));
     }
     else
     {
         lbl.Text = val;
     }
 }
Example #4
0
        private void showStatusError(string message)
        {
            string displayMessage = "Exception: " + message;

            ToolStripStatusLabel1.Text      = displayMessage;
            ToolStripStatusLabel1.ForeColor = Color.Red;
            StatusStrip1.Refresh();
            //MessageBox.Show(displayMessage, "Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
            ErrorRichTextBox.ResetText();
            ErrorRichTextBox.AppendText(displayMessage);
        }
Example #5
0
 private void SetServerTime(string serverTime)
 {
     if (StatusStrip1.InvokeRequired)
     {
         var del = new Action(() => SetServerTime(serverTime));
         StatusStrip1.BeginInvoke(del);
     }
     else
     {
         DateTimeLabel.Text = serverTime;
         StatusStrip1.Update();
     }
 }
Example #6
0
 private void SetStatusBar(string text)
 {
     if (StatusStrip1.InvokeRequired)
     {
         var del = new Action(() => SetStatusBar(text));
         StatusStrip1.BeginInvoke(del);
     }
     else
     {
         StatusLabel.Text = text;
         StatusStrip1.Update();
     }
 }
Example #7
0
 private void ConnectStatus(string text, Color foreColor, Color backColor, string toolTipText)
 {
     if (StatusStrip1.InvokeRequired)
     {
         var del = new Action(() => ConnectStatus(text, foreColor, backColor, toolTipText));
         StatusStrip1.BeginInvoke(del);
     }
     else
     {
         ConnStatusLabel.Text        = text;
         ConnStatusLabel.ToolTipText = toolTipText;
         ConnStatusLabel.ForeColor   = foreColor;
         StatusStrip1.BackColor      = backColor;
         StatusStrip1.Update();
     }
 }
Example #8
0
        private void SaveListToTextFile(object sender, EventArgs e)
        {
            if (ObjectList.SelectedObjects.Count <= 0)
            {
                Utils.ShowError(NoReplaysSelected);
                return;
            }

            SaveFileDialog1.DefaultExt = "txt";
            SaveFileDialog1.Filter     = "Text document (*.txt)|*.txt";
            if (SaveFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            statusLabel.Text = "Saving... ";
            StatusStrip1.Refresh();
            const int columnWidth = 2;
            var       file        = new StreamWriter(SaveFileDialog1.FileName);

            file.WriteLine($"{ObjectList.SelectedObjects.Count} replays");
            file.WriteLine();
            // Find out order of columns
            var cols = ObjectList.AllColumns.Select((x, i) => (x.DisplayIndex, i)).ToList();

            cols.Sort((x, y) => x.DisplayIndex.CompareTo(y.DisplayIndex));
            var columnOrder = cols.Select(x => x.i).ToList();
            // Get maximum text length for each column
            var maxColTextLength = new int[columnOrder.Count];

            for (var i = 0; i < columnOrder.Count; i++)
            {
                maxColTextLength[i] = 0;
                foreach (ListViewItem j in ObjectList.SelectedItems)
                {
                    maxColTextLength[i] = Math.Max(maxColTextLength[i], j.SubItems[columnOrder[i]].Text.Length);
                }
            }

            for (var i = 0; i < columnOrder.Count; i++)
            {
                if (maxColTextLength[i] > 0)
                {
                    file.Write($" - {ObjectList.Columns[columnOrder[i]].Text}");
                }
            }
            file.Write(" - ");
            file.WriteLine();
            ToolStripProgressBar1.Value   = 0;
            ToolStripProgressBar1.Maximum = ObjectList.SelectedObjects.Count;
            foreach (ListViewItem i in ObjectList.SelectedItems)
            {
                for (var j = 0; j < columnOrder.Count; j++)
                {
                    if (maxColTextLength[j] <= 0)
                    {
                        continue;
                    }
                    file.Write(i.SubItems[columnOrder[j]].Text);
                    for (var k = 0; k < maxColTextLength[j] - i.SubItems[columnOrder[j]].Text.Length; k++)
                    {
                        file.Write(' ');
                    }
                    if (j < columnOrder.Count - 1)
                    {
                        for (var k = 0; k < columnWidth; k++)
                        {
                            file.Write(' ');
                        }
                    }
                }

                file.WriteLine();
                ToolStripProgressBar1.Value++;
            }

            file.WriteLine();
            file.Write("Total time: ");
            var totalTime = GetTotalTimeOfSelected();

            file.Write(totalTime.ToTimeString(Global.AppSettings.ReplayManager.NumDecimals));

            statusLabel.Text            = "Ready";
            ToolStripProgressBar1.Value = 0;
            file.Close();
        }
Example #9
0
        /// <summary>
        /// Set the text in the ToolStripStatusLabel.
        /// </summary>
        ///
        /// <param name="status"> the text to display </param>

        private void UpdateStatusLabel(string status)
        {
            ToolStripStatusLabel1.Text = status;
            StatusStrip1.Update();
        }
Example #10
0
        /// <summary>
        /// Set the text in the ToolStripStatusLabel.
        /// </summary>
        ///
        /// <param name="status"> the text to display </param>

        private void UpdateStatusLabel(string status)
        {
            lblStatus.Text = status;
            StatusStrip1.Update();
        }