コード例 #1
0
ファイル: HexPane.cs プロジェクト: modulexcite/Hypertoken
        public void AddData(long[] timestamps, byte[] addr, byte[][] data)
        {
            for (int i = 0; i < timestamps.Length; i++)
            {
                DateTime timestamp = new DateTime(timestamps[i]);
                String   s         = "[" + timestamp.Hour.ToString() + ":" + timestamp.Minute.ToString() + ":" + timestamp.Second.ToString() + "." + timestamp.Millisecond.ToString("d3") + "]";
                s += ": 0x";
                s += addr[i].ToString("X2");
                s += ": ";

                for (int j = 0; j < data[i].Length; j++)
                {
                    s += " " + data[i][j].ToString("X2");
                }

                s += Environment.NewLine;
                IOBox.BeginInvoke(new MethodInvoker(
                                      delegate
                {
                    IOBox.AppendText(s);
                }));
            }

            ScrollToEnd(IOBox);

            /*IOBox.BeginInvoke(new MethodInvoker(
             *  delegate
             *  {
             *      IOBox.SelectionStart = IOBox.Text.Length - 1;
             *      IOBox.ScrollToCaret();
             *  }));*/
        }
コード例 #2
0
ファイル: ASCIIPane.cs プロジェクト: modulexcite/Hypertoken
 /// <summary>
 /// Add text to the pane
 /// Note: Threadsafe
 /// </summary>
 /// <param name="s">String to add</param>
 public void AddRawText(string s)
 {
     IOBox.BeginInvoke(new MethodInvoker(
                           delegate
     {
         IOBox.AppendText(s);
     }));
 }
コード例 #3
0
ファイル: ASCIIPane.cs プロジェクト: modulexcite/Hypertoken
        /// <summary>
        /// Add multiple lines to the pane
        /// Note: Threadsafe
        /// </summary>
        /// <param name="timestamps">Timestamp for each line</param>
        /// <param name="addr">Address for each line</param>
        /// <param name="data">Data array for each line</param>
        public void AddData(long[] timestamps, byte[] addr, byte[][] data)
        {
            for (int i = 0; i < timestamps.Length; i++)
            {
                timestamp = new DateTime(timestamps[i]);
                String s = "[" + timestamp.Hour.ToString() + ":" + timestamp.Minute.ToString() + ":" + timestamp.Second.ToString() + "." + timestamp.Millisecond.ToString("d3") + "]";
                s += ": ";
                s += addr[i].ToString();
                s += ": ";

                s += System.Text.UnicodeEncoding.ASCII.GetString(data[i], 0, data[i].Length);

                s += Environment.NewLine;

                IOBox.BeginInvoke(new MethodInvoker(
                                      delegate
                {
                    IOBox.AppendText(s);
                }));
            }

            ScrollToEnd(IOBox);
        }