Esempio n. 1
0
        private void About_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            InfoRichTextBox.LoadRtf("about");
            InfoRichTextBox.IsReadOnly = true;

            InfoDialog.Visibility = Visibility.Visible;
        }
Esempio n. 2
0
 private void InfoForm_Load(object sender, EventArgs e)
 {
     InfoRichTextBox.AppendText("Arduino Experiment controlpanel V1.0\n\n");
     InfoRichTextBox.AppendText("Functional design: Jaap Daniëlse\n");
     InfoRichTextBox.AppendText("Application design and development:\n");
     InfoRichTextBox.AppendText("Jaap, Tim, and Paul Daniëlse\n\n");
     InfoRichTextBox.AppendText("Copyright 2019, J.C. Daniëlse, Published under MIT Licence\n\n");
     InfoRichTextBox.AppendText("Documentation:\n https://github.com/JaapDanielse/VirtualPanel/wiki \n");
 }
        private void WriteMessageInRichTextBox(string message, SolidColorBrush color)
        {
            var error = new Paragraph(new Run(DateTime.Now.ToString("HH:mm:ss") + ": " + message))
            {
                Foreground = color
            };

            InfoRichTextBox.Document.Blocks.Add(error);
            InfoRichTextBox.ScrollToEnd();
        }
Esempio n. 4
0
 public void InfoPanelClear()
 {
     InfoLabel.Text       = "VirtualPanel";
     InfoRichTextBox.Text = "";
     InfoRichTextBox.AppendText("V1.4.0 - (Januari 2022)\n");
     InfoRichTextBox.AppendText("Arduino experiment control panel\n\n");
     InfoRichTextBox.AppendText("Functional design: Jaap Daniëlse\n");
     InfoRichTextBox.AppendText("Application design and development: Jaap, Tim and Paul Daniëlse\n");
     InfoRichTextBox.AppendText("Documentation review and electronics advice: Jan Daniëlse\n\n");
     InfoRichTextBox.AppendText("© 2022, J.C. Daniëlse, Published under MIT Licence\n\n");
     InfoRichTextBox.AppendText("Documentation:\n");
     InfoRichTextBox.AppendText("https://github.com/JaapDanielse/VirtualPanel/wiki\n");
 }
Esempio n. 5
0
        private void Arduinoport_MessageReceived(object sender, MessageEventArgs <object> mse)
        {
            if ((ChannelId)mse.ChannelID == ChannelId.Info && mse.Type == vp_type.vp_string)
            {
                if ((string)mse.Data == "$CLEAR")
                {
                    InfoPanelClear();
                }
            }

            if ((ChannelId)mse.ChannelID == ChannelId.InfoTitle && mse.Type == vp_type.vp_string)
            {
                InfoLabel.Text       = ((string)mse.Data);
                InfoRichTextBox.Text = "";
            }
            if ((ChannelId)mse.ChannelID == ChannelId.InfoText && mse.Type == vp_type.vp_string)
            {
                InfoRichTextBox.AppendText(((string)mse.Data) + "\n");
            }
        }
        public LogsWindow(string logsContent)
        {
            InitializeComponent();

            FlowDocument fd        = new FlowDocument();
            MemoryStream ms        = new MemoryStream(Encoding.ASCII.GetBytes(logsContent));
            TextRange    textRange = new TextRange(fd.ContentStart, fd.ContentEnd);

            textRange.Load(ms, DataFormats.Rtf);
            InfoRichTextBox.Document = fd;

            var warning = new Paragraph(new Run("WARNING: THIS WINDOW ISN'T AUTOMATICALLY REFRESHED. CLOSE AND REOPEN IT TO SEE THE LAST LOGS."))
            {
                Foreground = Brushes.Green
            };

            InfoRichTextBox.Document.Blocks.Add(warning);
            InfoRichTextBox.Document.Blocks.Add(new Paragraph());
            InfoRichTextBox.Focus();
            InfoRichTextBox.CaretPosition = InfoRichTextBox.CaretPosition.DocumentEnd;
            InfoRichTextBox.ScrollToEnd();
        }