Beispiel #1
0
 //打印日志信息
 public void Output(string log)
 {
     //如果日志信息长度超过100行,则自动清空
     if (TextBoxDialog.GetLineFromCharIndex(TextBoxDialog.Text.Length) > 100)
     {
         TextBoxDialog.Text = "";
     }
     //添加日志
     TextBoxDialog.AppendText(DateTime.Now.ToString("HH:mm:ss ") + log + "\r\n");
 }
Beispiel #2
0
            /// <inheritdoc/>
            public IDataStream CreateMessage()
            {
                var dialog = new TextBoxDialog("Enter the value of Sec-WebSocket-Key from client request.");

                if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    return(CreateMessage(dialog.Value));
                }
                return(CreateMessage(null));
            }
        public string InputDialog(string message, string title)
        {
            var dialog = new TextBoxDialog(title, message);

            if (dialog.ShowDialog() == true)
            {
                return(dialog.Input);
            }
            else
            {
                return(null);
            }
        }
Beispiel #4
0
        private static void ShowTestDialog()
        {
            var dialog = new TextBoxDialog()
            {
                Width = 300, Height = 100
            };

            dialog.TextBox.Text = "Enjoy  Pirate's Little Helper with voice recognition!";


            dialog.ShowDialog();

            dialog.Close();
        }
        /// <inheritdoc />
        public Network.DataFormats.IStreamWrapper CreateWrapper()
        {
            var dialog = new TextBoxDialog();

            dialog.DialogTitle      = "Chunked stream wrapper setup";
            dialog.DialogText       = "Enter chunk size:";
            dialog.ValidatingValue += dialog_ValidatingValue;
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                int chunkSize = int.Parse(dialog.Value);
                return(new BasicWrapper(delegate(IDataStream s) { return new ChunkedStream(s, chunkSize); }, "chunk", chunkSize));
            }
            return(null);
        }