[csmaild-cvs] csmaild/src/TestClient Main.cs,1.5,1.6 Main.resx,1.5,1.6 TestClient.csproj,1.1,1.2
Brought to you by:
tamc
|
From: <ta...@us...> - 2003-08-08 22:39:30
|
Update of /cvsroot/csmaild/csmaild/src/TestClient In directory sc8-pr-cvs1:/tmp/cvs-serv18360/src/TestClient Modified Files: Main.cs Main.resx TestClient.csproj Log Message: Updated VS.NET 2002 project files to reflect currect VS.NET 2003 project Moved message flags into a FlagList class (this makes flag extensions easier to support) Modified the TestClient for easier debugging of the server Added BASE64 decoder to common library Moved argument parsing from ImapCommand into the newly created types (representing various arguments parsed from the client) Added support for AUTHENTICATE PLAIN Added TODO document in the docs !!Some stuff surely has been broken with all this code moving around, it'll compile and run, but some functionality hasn't been verified yet!! Index: Main.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/TestClient/Main.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Main.cs 29 Jul 2003 00:46:29 -0000 1.5 --- Main.cs 8 Aug 2003 22:39:26 -0000 1.6 *************** *** 15,24 **** { ClientHelper mHelper; ! int mCounter = 0; ! ArrayList mResponseCounts = new ArrayList(); private System.Windows.Forms.Button cmdLocalhost; - private System.Windows.Forms.Button cmdChegg; - private System.Windows.Forms.ListBox lstCommunicationLog; private System.Windows.Forms.TextBox txtAddCommands; private System.Windows.Forms.Button cmdAdd; --- 15,23 ---- { ClientHelper mHelper; ! ArrayList mCommandStartPosition = new ArrayList(); ! private TextReader mCompareFile; ! private string mTextCopy; private System.Windows.Forms.Button cmdLocalhost; private System.Windows.Forms.TextBox txtAddCommands; private System.Windows.Forms.Button cmdAdd; *************** *** 27,32 **** private System.Windows.Forms.Button cmdDelete; private System.Windows.Forms.NumericUpDown numPause; - private System.Windows.Forms.Label label1; private System.Windows.Forms.CheckedListBox lstCommandsToProcess; /// <summary> /// Required designer variable. --- 26,46 ---- private System.Windows.Forms.Button cmdDelete; private System.Windows.Forms.NumericUpDown numPause; private System.Windows.Forms.CheckedListBox lstCommandsToProcess; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.RichTextBox txtCommunicationLog; + private System.Windows.Forms.Button cmdEdit; + private System.Windows.Forms.ContextMenu ctxMenu; + private System.Windows.Forms.MenuItem mnuSaveAs; + private System.Windows.Forms.MenuItem mnuSaveAsText; + private System.Windows.Forms.MenuItem mnuSaveAsRichText; + private System.Windows.Forms.SaveFileDialog saveDlg; + private System.Windows.Forms.CheckBox chkWordWrap; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.CheckBox chkCompareToExpected; + private System.Windows.Forms.Label lblPause; + private System.Windows.Forms.Button cmdOther; /// <summary> /// Required designer variable. *************** *** 71,76 **** { this.cmdLocalhost = new System.Windows.Forms.Button(); - this.cmdChegg = new System.Windows.Forms.Button(); - this.lstCommunicationLog = new System.Windows.Forms.ListBox(); this.txtAddCommands = new System.Windows.Forms.TextBox(); this.cmdAdd = new System.Windows.Forms.Button(); --- 85,88 ---- *************** *** 79,85 **** this.cmdDelete = new System.Windows.Forms.Button(); this.numPause = new System.Windows.Forms.NumericUpDown(); ! this.label1 = new System.Windows.Forms.Label(); this.lstCommandsToProcess = new System.Windows.Forms.CheckedListBox(); ((System.ComponentModel.ISupportInitialize)(this.numPause)).BeginInit(); this.SuspendLayout(); // --- 91,113 ---- this.cmdDelete = new System.Windows.Forms.Button(); this.numPause = new System.Windows.Forms.NumericUpDown(); ! this.lblPause = new System.Windows.Forms.Label(); this.lstCommandsToProcess = new System.Windows.Forms.CheckedListBox(); + this.txtCommunicationLog = new System.Windows.Forms.RichTextBox(); + this.ctxMenu = new System.Windows.Forms.ContextMenu(); + this.mnuSaveAs = new System.Windows.Forms.MenuItem(); + this.mnuSaveAsText = new System.Windows.Forms.MenuItem(); + this.mnuSaveAsRichText = new System.Windows.Forms.MenuItem(); + this.panel1 = new System.Windows.Forms.Panel(); + this.cmdEdit = new System.Windows.Forms.Button(); + this.saveDlg = new System.Windows.Forms.SaveFileDialog(); + this.chkWordWrap = new System.Windows.Forms.CheckBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.chkCompareToExpected = new System.Windows.Forms.CheckBox(); + this.cmdOther = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.numPause)).BeginInit(); + this.panel1.SuspendLayout(); this.SuspendLayout(); // *************** *** 94,125 **** this.cmdLocalhost.Click += new System.EventHandler(this.cmdLocalhost_Click); // - // cmdChegg - // - this.cmdChegg.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.cmdChegg.Location = new System.Drawing.Point(80, 8); - this.cmdChegg.Name = "cmdChegg"; - this.cmdChegg.Size = new System.Drawing.Size(64, 20); - this.cmdChegg.TabIndex = 2; - this.cmdChegg.Text = "Chegg"; - this.cmdChegg.Click += new System.EventHandler(this.cmdChegg_Click); - // - // lstCommunicationLog - // - this.lstCommunicationLog.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.lstCommunicationLog.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lstCommunicationLog.IntegralHeight = false; - this.lstCommunicationLog.ItemHeight = 16; - this.lstCommunicationLog.Location = new System.Drawing.Point(8, 40); - this.lstCommunicationLog.Name = "lstCommunicationLog"; - this.lstCommunicationLog.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; - this.lstCommunicationLog.Size = new System.Drawing.Size(600, 432); - this.lstCommunicationLog.TabIndex = 3; - // // txtAddCommands // this.txtAddCommands.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; ! this.txtAddCommands.Location = new System.Drawing.Point(712, 456); this.txtAddCommands.Name = "txtAddCommands"; ! this.txtAddCommands.Size = new System.Drawing.Size(152, 20); this.txtAddCommands.TabIndex = 5; this.txtAddCommands.Text = ""; --- 122,132 ---- this.cmdLocalhost.Click += new System.EventHandler(this.cmdLocalhost_Click); // // txtAddCommands // + this.txtAddCommands.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.txtAddCommands.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; ! this.txtAddCommands.Location = new System.Drawing.Point(616, 456); this.txtAddCommands.Name = "txtAddCommands"; ! this.txtAddCommands.Size = new System.Drawing.Size(200, 20); this.txtAddCommands.TabIndex = 5; this.txtAddCommands.Text = ""; *************** *** 128,131 **** --- 135,139 ---- // cmdAdd // + this.cmdAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.cmdAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.cmdAdd.Location = new System.Drawing.Point(872, 456); *************** *** 178,213 **** this.numPause.Size = new System.Drawing.Size(40, 20); this.numPause.TabIndex = 10; - this.numPause.Value = new System.Decimal(new int[] { - 5, - 0, - 0, - 0}); // ! // label1 // ! this.label1.AutoSize = true; ! this.label1.Location = new System.Drawing.Point(224, 8); ! this.label1.Name = "label1"; ! this.label1.Size = new System.Drawing.Size(243, 16); ! this.label1.TabIndex = 11; ! this.label1.Text = "Pause between commands (tenths of a second)"; // // lstCommandsToProcess // this.lstCommandsToProcess.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.lstCommandsToProcess.Font = new System.Drawing.Font("Verdana", 8.25F); this.lstCommandsToProcess.Location = new System.Drawing.Point(616, 40); this.lstCommandsToProcess.Name = "lstCommandsToProcess"; ! this.lstCommandsToProcess.Size = new System.Drawing.Size(304, 386); this.lstCommandsToProcess.TabIndex = 12; this.lstCommandsToProcess.SelectedIndexChanged += new System.EventHandler(this.lstCommandsToProcess_SelectedIndexChanged); // // MainF // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(928, 485); ! this.Controls.Add(this.lstCommandsToProcess); ! this.Controls.Add(this.label1); this.Controls.Add(this.txtAddCommands); this.Controls.Add(this.numPause); this.Controls.Add(this.cmdDelete); --- 186,370 ---- this.numPause.Size = new System.Drawing.Size(40, 20); this.numPause.TabIndex = 10; // ! // lblPause // ! this.lblPause.AutoSize = true; ! this.lblPause.Location = new System.Drawing.Point(224, 8); ! this.lblPause.Name = "lblPause"; ! this.lblPause.Size = new System.Drawing.Size(217, 16); ! this.lblPause.TabIndex = 11; ! this.lblPause.Text = "Pause before sending (tenths of a second)"; // // lstCommandsToProcess // + this.lstCommandsToProcess.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); this.lstCommandsToProcess.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.lstCommandsToProcess.Font = new System.Drawing.Font("Verdana", 8.25F); this.lstCommandsToProcess.Location = new System.Drawing.Point(616, 40); this.lstCommandsToProcess.Name = "lstCommandsToProcess"; ! this.lstCommandsToProcess.Size = new System.Drawing.Size(304, 402); this.lstCommandsToProcess.TabIndex = 12; this.lstCommandsToProcess.SelectedIndexChanged += new System.EventHandler(this.lstCommandsToProcess_SelectedIndexChanged); // + // txtCommunicationLog + // + this.txtCommunicationLog.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.txtCommunicationLog.ContextMenu = this.ctxMenu; + this.txtCommunicationLog.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtCommunicationLog.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.txtCommunicationLog.HideSelection = false; + this.txtCommunicationLog.Location = new System.Drawing.Point(0, 0); + this.txtCommunicationLog.Name = "txtCommunicationLog"; + this.txtCommunicationLog.ReadOnly = true; + this.txtCommunicationLog.Size = new System.Drawing.Size(598, 414); + this.txtCommunicationLog.TabIndex = 13; + this.txtCommunicationLog.Text = ""; + // + // ctxMenu + // + this.ctxMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.mnuSaveAs}); + // + // mnuSaveAs + // + this.mnuSaveAs.Index = 0; + this.mnuSaveAs.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.mnuSaveAsText, + this.mnuSaveAsRichText}); + this.mnuSaveAs.Text = "Save As..."; + // + // mnuSaveAsText + // + this.mnuSaveAsText.Index = 0; + this.mnuSaveAsText.Text = "Text"; + this.mnuSaveAsText.Click += new System.EventHandler(this.mnuSaveAsText_Click); + // + // mnuSaveAsRichText + // + this.mnuSaveAsRichText.Index = 1; + this.mnuSaveAsRichText.Text = "Rich Text"; + this.mnuSaveAsRichText.Click += new System.EventHandler(this.mnuSaveAsRichText_Click); + // + // panel1 + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel1.Controls.Add(this.txtCommunicationLog); + this.panel1.Location = new System.Drawing.Point(8, 40); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(600, 416); + this.panel1.TabIndex = 14; + // + // cmdEdit + // + this.cmdEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cmdEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.cmdEdit.Location = new System.Drawing.Point(820, 456); + this.cmdEdit.Name = "cmdEdit"; + this.cmdEdit.Size = new System.Drawing.Size(48, 20); + this.cmdEdit.TabIndex = 15; + this.cmdEdit.Text = "Edit"; + // + // chkWordWrap + // + this.chkWordWrap.Checked = true; + this.chkWordWrap.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkWordWrap.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.chkWordWrap.Location = new System.Drawing.Point(472, 8); + this.chkWordWrap.Name = "chkWordWrap"; + this.chkWordWrap.Size = new System.Drawing.Size(80, 16); + this.chkWordWrap.TabIndex = 16; + this.chkWordWrap.Text = "Word Wrap"; + this.chkWordWrap.CheckedChanged += new System.EventHandler(this.chkWordWrap_CheckedChanged); + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label2.AutoSize = true; + this.label2.BackColor = System.Drawing.Color.White; + this.label2.ForeColor = System.Drawing.Color.ForestGreen; + this.label2.Location = new System.Drawing.Point(8, 464); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(38, 16); + this.label2.TabIndex = 17; + this.label2.Text = "Server"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label3.AutoSize = true; + this.label3.BackColor = System.Drawing.Color.White; + this.label3.ForeColor = System.Drawing.Color.Gold; + this.label3.Location = new System.Drawing.Point(279, 464); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(117, 16); + this.label3.TabIndex = 18; + this.label3.Text = "Line is wrong, this isn\'t"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label4 + // + this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label4.AutoSize = true; + this.label4.BackColor = System.Drawing.Color.White; + this.label4.ForeColor = System.Drawing.Color.Blue; + this.label4.Location = new System.Drawing.Point(146, 464); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(33, 16); + this.label4.TabIndex = 19; + this.label4.Text = "Client"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label5.AutoSize = true; + this.label5.BackColor = System.Drawing.Color.White; + this.label5.ForeColor = System.Drawing.Color.Red; + this.label5.Location = new System.Drawing.Point(496, 464); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(106, 16); + this.label5.TabIndex = 20; + this.label5.Text = "Line is wrong, this is"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // chkCompareToExpected + // + this.chkCompareToExpected.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.chkCompareToExpected.Location = new System.Drawing.Point(568, 8); + this.chkCompareToExpected.Name = "chkCompareToExpected"; + this.chkCompareToExpected.Size = new System.Drawing.Size(136, 16); + this.chkCompareToExpected.TabIndex = 21; + this.chkCompareToExpected.Text = "Compare to Expected"; + // + // cmdOther + // + this.cmdOther.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.cmdOther.Location = new System.Drawing.Point(80, 8); + this.cmdOther.Name = "cmdOther"; + this.cmdOther.Size = new System.Drawing.Size(80, 20); + this.cmdOther.TabIndex = 2; + this.cmdOther.Text = "Test Other..."; + this.cmdOther.Click += new System.EventHandler(this.cmdChegg_Click); + // // MainF // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(928, 485); ! this.Controls.Add(this.chkCompareToExpected); ! this.Controls.Add(this.label5); ! this.Controls.Add(this.label4); ! this.Controls.Add(this.label3); ! this.Controls.Add(this.label2); ! this.Controls.Add(this.lblPause); this.Controls.Add(this.txtAddCommands); + this.Controls.Add(this.chkWordWrap); + this.Controls.Add(this.cmdEdit); + this.Controls.Add(this.panel1); + this.Controls.Add(this.lstCommandsToProcess); this.Controls.Add(this.numPause); this.Controls.Add(this.cmdDelete); *************** *** 215,220 **** this.Controls.Add(this.cmdMoveUp); this.Controls.Add(this.cmdAdd); ! this.Controls.Add(this.lstCommunicationLog); ! this.Controls.Add(this.cmdChegg); this.Controls.Add(this.cmdLocalhost); this.Name = "MainF"; --- 372,376 ---- this.Controls.Add(this.cmdMoveUp); this.Controls.Add(this.cmdAdd); ! this.Controls.Add(this.cmdOther); this.Controls.Add(this.cmdLocalhost); this.Name = "MainF"; *************** *** 222,225 **** --- 378,382 ---- this.Load += new System.EventHandler(this.MainF_Load); ((System.ComponentModel.ISupportInitialize)(this.numPause)).EndInit(); + this.panel1.ResumeLayout(false); this.ResumeLayout(false); *************** *** 227,238 **** #endregion ! private void SendLine(string msg) { ! mHelper.Send(msg + "\r\n"); ! lstCommunicationLog.Items.Add(mCounter++.ToString().PadLeft(4, ' ') + " -> " + msg); ! lstCommunicationLog.SelectedIndex = lstCommunicationLog.Items.Count-1; ! mResponseCounts[mResponseCounts.Count-1] = (int)mResponseCounts[mResponseCounts.Count-1]+1; Application.DoEvents(); } --- 384,415 ---- #endregion ! private void AddTextLine(string msg, Color clr) { ! string compareLine = mCompareFile.ReadLine(); ! txtCommunicationLog.SelectionHangingIndent = 35; ! txtCommunicationLog.SelectionColor = clr; ! txtCommunicationLog.SelectedText = msg + "\r\n"; + if(chkCompareToExpected.Checked && compareLine != null && compareLine != msg) + { + int idx = 0; + for(; idx < Math.Min(compareLine.Length, msg.Length); ++idx) + if(compareLine[idx] != msg[idx]) + break; + + txtCommunicationLog.SelectionHangingIndent = 35; + txtCommunicationLog.SelectionColor = Color.Gold; + txtCommunicationLog.SelectedText = compareLine.Substring(0, idx); + txtCommunicationLog.SelectionHangingIndent = 35; + txtCommunicationLog.SelectionColor = Color.Red; + txtCommunicationLog.SelectedText = compareLine.Substring(idx) + "\r\n"; + } + } + + private void SendLine(string msg) + { + mHelper.Send(msg + "\r\n"); + AddTextLine(msg, Color.Blue); Application.DoEvents(); } *************** *** 242,250 **** string line = mHelper.ReceiveLine(); if(line != string.Empty) ! { ! lstCommunicationLog.Items.Add(mCounter++.ToString().PadLeft(4, ' ') + " <- " + line); ! lstCommunicationLog.SelectedIndex = lstCommunicationLog.Items.Count-1; ! mResponseCounts[mResponseCounts.Count-1] = (int)mResponseCounts[mResponseCounts.Count-1]+1; ! } Application.DoEvents(); return line; --- 419,423 ---- string line = mHelper.ReceiveLine(); if(line != string.Empty) ! AddTextLine(line, Color.ForestGreen); Application.DoEvents(); return line; *************** *** 279,286 **** private void Go() { ! lstCommunicationLog.Items.Clear(); ! mResponseCounts.Clear(); ! mResponseCounts.Add(0); cmdAdd.Enabled = false; --- 452,461 ---- private void Go() { ! txtCommunicationLog.ResetText(); ! txtCommunicationLog.Enabled = false; ! mCompareFile = new StreamReader("..\\ExpectedOutput.txt"); ! ! mCommandStartPosition.Clear(); cmdAdd.Enabled = false; *************** *** 290,294 **** lstCommandsToProcess.Enabled = false; cmdLocalhost.Enabled = false; ! cmdChegg.Enabled = false; ReadLine(); // read welcome msg --- 465,469 ---- lstCommandsToProcess.Enabled = false; cmdLocalhost.Enabled = false; ! cmdOther.Enabled = false; ReadLine(); // read welcome msg *************** *** 296,300 **** for(int idx = 0; idx < lstCommandsToProcess.CheckedIndices.Count; ++idx) { ! mResponseCounts.Add(0); lstCommandsToProcess.SelectedIndex = lstCommandsToProcess.CheckedIndices[idx]; SendReceiveCommand(lstCommandsToProcess.SelectedItem as string); --- 471,475 ---- for(int idx = 0; idx < lstCommandsToProcess.CheckedIndices.Count; ++idx) { ! mCommandStartPosition.Add(txtCommunicationLog.TextLength); lstCommandsToProcess.SelectedIndex = lstCommandsToProcess.CheckedIndices[idx]; SendReceiveCommand(lstCommandsToProcess.SelectedItem as string); *************** *** 302,305 **** --- 477,481 ---- } + txtCommunicationLog.Enabled = true; cmdAdd.Enabled = true; cmdDelete.Enabled = true; *************** *** 308,312 **** lstCommandsToProcess.Enabled = true; cmdLocalhost.Enabled = true; ! cmdChegg.Enabled = true; } --- 484,488 ---- lstCommandsToProcess.Enabled = true; cmdLocalhost.Enabled = true; ! cmdOther.Enabled = true; } *************** *** 355,373 **** else { ! lstCommunicationLog.SelectedIndex = -1; ! int idx = lstCommandsToProcess.CheckedIndices.IndexOf(lstCommandsToProcess.SelectedIndex); ! if(mResponseCounts.Count >= idx+2) { ! int pos = 0; ! for(int iidx = idx; iidx >= 0; --iidx) ! pos += (int)mResponseCounts[iidx]; ! int cnt = (int)mResponseCounts[idx+1]-1; ! for(; cnt >= 0; --cnt) ! if(pos+cnt < lstCommunicationLog.Items.Count) ! lstCommunicationLog.SetSelected(pos+cnt, true); } - cmdMoveUp.Enabled = (lstCommandsToProcess.SelectedIndex != 0); - cmdMoveDown.Enabled = (lstCommandsToProcess.SelectedIndex != lstCommandsToProcess.Items.Count-1); - cmdDelete.Enabled = true; } } --- 531,574 ---- else { ! if(lstCommandsToProcess.Enabled) { ! int idx = lstCommandsToProcess.CheckedIndices.IndexOf(lstCommandsToProcess.SelectedIndex); ! ! if(idx >= 0 && idx < mCommandStartPosition.Count) ! { ! ! if(mTextCopy == null) ! mTextCopy = txtCommunicationLog.Rtf; ! // else ! // txtCommunicationLog.Rtf = mTextCopy; ! ! int start = (int)mCommandStartPosition[idx]; ! int end = (idx+1 < mCommandStartPosition.Count ? (int)mCommandStartPosition[idx+1] : txtCommunicationLog.TextLength); ! ! // first set the font color of everything else to gray ! // txtCommunicationLog.SelectionStart = 0; ! // txtCommunicationLog.SelectionLength = start; ! // txtCommunicationLog.SelectionColor = Color.Gray; ! // txtCommunicationLog.SelectionStart = end; ! // txtCommunicationLog.SelectionLength = txtCommunicationLog.TextLength - end; ! // txtCommunicationLog.SelectionColor = Color.Gray; ! ! // now set the font to the select item to not italic and bold ! txtCommunicationLog.SelectionStart = start; ! txtCommunicationLog.SelectionLength = 0; ! txtCommunicationLog.ScrollToCaret(); ! if(idx+1 < mCommandStartPosition.Count) ! txtCommunicationLog.SelectionLength = (int)mCommandStartPosition[idx+1] - (int)mCommandStartPosition[idx]; ! else ! txtCommunicationLog.SelectionLength = txtCommunicationLog.TextLength - (int)mCommandStartPosition[idx]; ! // txtCommunicationLog.SelectionFont = new Font(txtCommunicationLog.Font, FontStyle.Bold); ! ! // txtCommunicationLog.SelectionLength = 0; ! } ! ! cmdMoveUp.Enabled = (lstCommandsToProcess.SelectedIndex != 0); ! cmdMoveDown.Enabled = (lstCommandsToProcess.SelectedIndex != lstCommandsToProcess.Items.Count-1); ! cmdDelete.Enabled = true; } } } *************** *** 435,438 **** --- 636,658 ---- ds.Dispose(); + } + + private void mnuSaveAsText_Click(object sender, System.EventArgs e) + { + saveDlg.Filter = "Text Files (*.txt)|*.txt"; + if(saveDlg.ShowDialog() == DialogResult.OK) + txtCommunicationLog.SaveFile(saveDlg.FileName, RichTextBoxStreamType.PlainText); + } + + private void mnuSaveAsRichText_Click(object sender, System.EventArgs e) + { + saveDlg.Filter = "Rich Text (*.rtf)|*.rtf"; + if(saveDlg.ShowDialog() == DialogResult.OK) + txtCommunicationLog.SaveFile(saveDlg.FileName, RichTextBoxStreamType.RichText); + } + + private void chkWordWrap_CheckedChanged(object sender, System.EventArgs e) + { + txtCommunicationLog.WordWrap = chkWordWrap.Checked; } } Index: Main.resx =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/TestClient/Main.resx,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Main.resx 29 Jul 2003 00:46:29 -0000 1.5 --- Main.resx 8 Aug 2003 22:39:27 -0000 1.6 *************** *** 107,128 **** <value>Private</value> </data> - <data name="cmdChegg.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="cmdChegg.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="cmdChegg.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lstCommunicationLog.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lstCommunicationLog.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="lstCommunicationLog.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> <data name="txtAddCommands.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> --- 107,110 ---- *************** *** 179,189 **** <value>Private</value> </data> ! <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> ! <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> ! <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> --- 161,171 ---- <value>Private</value> </data> ! <data name="lblPause.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> ! <data name="lblPause.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> ! <data name="lblPause.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> *************** *** 197,200 **** --- 179,317 ---- <value>Private</value> </data> + <data name="txtCommunicationLog.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="txtCommunicationLog.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="txtCommunicationLog.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="ctxMenu.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="ctxMenu.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </data> + <data name="ctxMenu.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuSaveAs.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuSaveAs.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuSaveAsText.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuSaveAsText.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuSaveAsRichText.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuSaveAsRichText.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>8, 8</value> + </data> + <data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="cmdEdit.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="cmdEdit.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="cmdEdit.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="saveDlg.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="saveDlg.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="saveDlg.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>110, 17</value> + </data> + <data name="chkWordWrap.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="chkWordWrap.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="chkWordWrap.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="label4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label5.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="label5.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label5.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="chkCompareToExpected.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="chkCompareToExpected.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="chkCompareToExpected.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="cmdOther.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="cmdOther.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="cmdOther.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> *************** *** 206,209 **** --- 323,329 ---- <value>False</value> </data> + <data name="$this.Name"> + <value>MainF</value> + </data> <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> *************** *** 215,223 **** <value>True</value> </data> - <data name="$this.Name"> - <value>MainF</value> - </data> <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> ! <value>80</value> </data> <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> --- 335,340 ---- <value>True</value> </data> <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> ! <value>52</value> </data> <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> Index: TestClient.csproj =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/TestClient/TestClient.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestClient.csproj 24 Jul 2003 04:32:14 -0000 1.1 --- TestClient.csproj 8 Aug 2003 22:39:27 -0000 1.2 *************** *** 87,91 **** <Reference Name = "System.XML" ! AssemblyName = "System.XML" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> --- 87,91 ---- <Reference Name = "System.XML" ! AssemblyName = "System.Xml" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> *************** *** 100,103 **** --- 100,104 ---- <File RelPath = "AssemblyInfo.cs" + SubType = "Code" BuildAction = "Compile" /> *************** *** 116,119 **** --- 117,124 ---- DependentUpon = "Main.cs" BuildAction = "EmbeddedResource" + /> + <File + RelPath = "bin\Commands.xml" + BuildAction = "Content" /> </Include> |