Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1231 → Rev 1232

/TCPproxy/trunk/MainForm.cs
174,41 → 174,41
this.panel3.SuspendLayout();
this.panel4.SuspendLayout();
this.SuspendLayout();
//
//
// wordWrapMenuItem
//
//
this.wordWrapMenuItem.Index = 2;
this.wordWrapMenuItem.Text = "Word &Wrap";
this.wordWrapMenuItem.Click += new System.EventHandler(this.wordWrapMenuItem_Click);
//
//
// treeImageList
//
//
this.treeImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("treeImageList.ImageStream")));
this.treeImageList.TransparentColor = System.Drawing.Color.Magenta;
//
//
// messagesContextMenu
//
//
this.messagesContextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.selectAllmenuItem,
this.copyMenuItem,
this.wordWrapMenuItem});
//
//
// selectAllmenuItem
//
//
this.selectAllmenuItem.Index = 0;
this.selectAllmenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlA;
this.selectAllmenuItem.Text = "Select &All";
this.selectAllmenuItem.Click += new System.EventHandler(this.selectAllMenuItem_Click);
//
//
// copyMenuItem
//
//
this.copyMenuItem.Index = 1;
this.copyMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlC;
this.copyMenuItem.Text = "&Copy";
this.copyMenuItem.Click += new System.EventHandler(this.copyMenuItem_Click);
//
//
// statusBar
//
//
this.statusBar.Location = new System.Drawing.Point(0, 339);
this.statusBar.Name = "statusBar";
this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
216,44 → 216,44
this.statusBar.ShowPanels = true;
this.statusBar.Size = new System.Drawing.Size(780, 22);
this.statusBar.TabIndex = 0;
//
//
// connectionStatusBar
//
//
this.connectionStatusBar.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.connectionStatusBar.Width = 764;
//
//
// saveButtonImageList
//
//
this.saveButtonImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("saveButtonImageList.ImageStream")));
this.saveButtonImageList.TransparentColor = System.Drawing.Color.Magenta;
//
//
// closeConnectionMenuItem
//
//
this.closeConnectionMenuItem.Index = 0;
this.closeConnectionMenuItem.Text = "&Close connection";
this.closeConnectionMenuItem.Click += new System.EventHandler(this.closeConnectionMenuItem_Click);
//
//
// viewContextMenu
//
//
this.viewContextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.closeConnectionMenuItem,
this.autoExpandMenuItem});
//
//
// saveLogDialog
//
//
this.saveLogDialog.DefaultExt = "txt";
this.saveLogDialog.Filter = "Text Files (*.txt)|*.txt|All Files|*.*";
this.saveLogDialog.Title = "Save Log";
//
//
// mainMenu
//
//
this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.fileMenu,
this.viewMenu,
this.helpMenu});
//
//
// fileMenu
//
//
this.fileMenu.Index = 0;
this.fileMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.startMenuItem,
270,91 → 270,91
this.menuSeparator2,
this.exitMenuItem});
this.fileMenu.Text = "&File";
//
//
// startMenuItem
//
//
this.startMenuItem.Index = 0;
this.startMenuItem.Text = "&Start...";
this.startMenuItem.Click += new System.EventHandler(this.startMenuItem_Click);
//
//
// stopMenuItem
//
//
this.stopMenuItem.Enabled = false;
this.stopMenuItem.Index = 1;
this.stopMenuItem.Text = "S&top";
this.stopMenuItem.Click += new System.EventHandler(this.stopMenuItem_Click);
//
//
// recentListeningMenu
//
//
this.recentListeningMenu.Index = 2;
this.recentListeningMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.recentListeningNoItem});
this.recentListeningMenu.Text = "&Recent Listenings";
//
//
// recentListeningNoItem
//
//
this.recentListeningNoItem.Enabled = false;
this.recentListeningNoItem.Index = 0;
this.recentListeningNoItem.Text = "(no items)";
//
//
// menuSeparator5
//
//
this.menuSeparator5.Index = 3;
this.menuSeparator5.Text = "-";
//
//
// loadBinLogMenuItem
//
//
this.loadBinLogMenuItem.Index = 4;
this.loadBinLogMenuItem.Text = "&Load Bin Log...";
this.loadBinLogMenuItem.Click += new System.EventHandler(this.loadBinLogMenuItem_Click);
//
//
// saveBinLogMenuItem
//
//
this.saveBinLogMenuItem.Index = 5;
this.saveBinLogMenuItem.Text = "&Save Bin Log...";
this.saveBinLogMenuItem.Click += new System.EventHandler(this.saveBinLogMenuItem_Click);
//
//
// menuSeparator1
//
//
this.menuSeparator1.Index = 6;
this.menuSeparator1.Text = "-";
//
//
// saveLogMenuItem
//
//
this.saveLogMenuItem.Index = 7;
this.saveLogMenuItem.Text = "Save Log Messa&ges...";
this.saveLogMenuItem.Click += new System.EventHandler(this.saveLogMenuItem_Click);
//
//
// saveTcoLogMenuItem
//
//
this.saveTcoLogMenuItem.Index = 8;
this.saveTcoLogMenuItem.Text = "Save T&CP Log...";
this.saveTcoLogMenuItem.Click += new System.EventHandler(this.saveTcpMenuItem_Click);
//
//
// saveHttpLogMenuItem
//
//
this.saveHttpLogMenuItem.Index = 9;
this.saveHttpLogMenuItem.Text = "Save Htt&p Log...";
this.saveHttpLogMenuItem.Click += new System.EventHandler(this.saveHttpMenuItem_Click);
//
//
// saveXmlLogMenuItem
//
//
this.saveXmlLogMenuItem.Index = 10;
this.saveXmlLogMenuItem.Text = "Save X&ML Log...";
this.saveXmlLogMenuItem.Click += new System.EventHandler(this.saveXmlMenuItem_Click);
//
//
// menuSeparator2
//
//
this.menuSeparator2.Index = 11;
this.menuSeparator2.Text = "-";
//
//
// exitMenuItem
//
//
this.exitMenuItem.Index = 12;
this.exitMenuItem.Text = "E&xit";
//
//
// viewMenu
//
//
this.viewMenu.Index = 1;
this.viewMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.clearMainMenuItem,
366,15 → 366,15
this.autoExpandMainMenuItem,
this.wordWrapMainMenuItem});
this.viewMenu.Text = "&View";
//
//
// clearMainMenuItem
//
//
this.clearMainMenuItem.Index = 0;
this.clearMainMenuItem.Text = "&Clear";
this.clearMainMenuItem.Click += new System.EventHandler(this.clearMenuItem_Click);
//
//
// messagesMenu
//
//
this.messagesMenu.Index = 1;
this.messagesMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.allMessagesMenuItem,
381,76 → 381,76
this.infoMessagesMenuItem,
this.importantMessagesMenuItem});
this.messagesMenu.Text = "&Messages";
//
//
// allMessagesMenuItem
//
//
this.allMessagesMenuItem.Checked = true;
this.allMessagesMenuItem.Index = 0;
this.allMessagesMenuItem.Text = "&All";
this.allMessagesMenuItem.Click += new System.EventHandler(this.messagesMenuItem_Click);
//
//
// infoMessagesMenuItem
//
//
this.infoMessagesMenuItem.Index = 1;
this.infoMessagesMenuItem.Text = "&Info";
this.infoMessagesMenuItem.Click += new System.EventHandler(this.messagesMenuItem_Click);
//
//
// importantMessagesMenuItem
//
//
this.importantMessagesMenuItem.Index = 2;
this.importantMessagesMenuItem.Text = "I&mportant";
this.importantMessagesMenuItem.Click += new System.EventHandler(this.messagesMenuItem_Click);
//
//
// menuSeparator3
//
//
this.menuSeparator3.Index = 2;
this.menuSeparator3.Text = "-";
//
//
// tcpShowByDirectionMenuItem
//
//
this.tcpShowByDirectionMenuItem.Checked = true;
this.tcpShowByDirectionMenuItem.Index = 3;
this.tcpShowByDirectionMenuItem.Text = "TCP Show by &Direction";
this.tcpShowByDirectionMenuItem.Click += new System.EventHandler(this.tcpShowByDirectionMenuItem_Click);
//
//
// tcpShowByTimeMenuItem
//
//
this.tcpShowByTimeMenuItem.Index = 4;
this.tcpShowByTimeMenuItem.Text = "TCP Show by &Time";
this.tcpShowByTimeMenuItem.Click += new System.EventHandler(this.tcpShowByTimeMenuItem_Click);
//
//
// menuSeparator4
//
//
this.menuSeparator4.Index = 5;
this.menuSeparator4.Text = "-";
//
//
// autoExpandMainMenuItem
//
//
this.autoExpandMainMenuItem.Index = 6;
this.autoExpandMainMenuItem.Text = "Auto E&xpand";
this.autoExpandMainMenuItem.Click += new System.EventHandler(this.autoExpandMenuItem_Click);
//
//
// wordWrapMainMenuItem
//
//
this.wordWrapMainMenuItem.Index = 7;
this.wordWrapMainMenuItem.Text = "Word &Wrap";
this.wordWrapMainMenuItem.Click += new System.EventHandler(this.wordWrapMenuItem_Click);
//
//
// helpMenu
//
//
this.helpMenu.Index = 2;
this.helpMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.aboutMenuItem});
this.helpMenu.Text = "&Help";
//
//
// aboutMenuItem
//
//
this.aboutMenuItem.Index = 0;
this.aboutMenuItem.Text = "&About...";
this.aboutMenuItem.Click += new System.EventHandler(this.aboutMenuItem_Click);
//
//
// panel1
//
//
this.panel1.Controls.Add(this.panel3);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
457,9 → 457,9
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(780, 339);
this.panel1.TabIndex = 11;
//
//
// panel3
//
//
this.panel3.Controls.Add(this.panel4);
this.panel3.Controls.Add(this.splitter1);
this.panel3.Controls.Add(this.messageView);
468,9 → 468,9
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(780, 339);
this.panel3.TabIndex = 5;
//
//
// panel4
//
//
this.panel4.Controls.Add(this.messagesBox);
this.panel4.Controls.Add(this.splitter2);
this.panel4.Controls.Add(this.logBox);
479,9 → 479,9
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(617, 339);
this.panel4.TabIndex = 13;
//
//
// splitter2
//
//
this.splitter2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.splitter2.Location = new System.Drawing.Point(0, 268);
this.splitter2.Name = "splitter2";
488,9 → 488,9
this.splitter2.Size = new System.Drawing.Size(617, 3);
this.splitter2.TabIndex = 9;
this.splitter2.TabStop = false;
//
//
// logBox
//
//
this.logBox.Dock = System.Windows.Forms.DockStyle.Bottom;
this.logBox.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.logBox.HorizontalScrollbar = true;
500,17 → 500,17
this.logBox.ScrollAlwaysVisible = true;
this.logBox.Size = new System.Drawing.Size(617, 68);
this.logBox.TabIndex = 8;
//
//
// splitter1
//
//
this.splitter1.Location = new System.Drawing.Point(160, 0);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(3, 339);
this.splitter1.TabIndex = 12;
this.splitter1.TabStop = false;
//
//
// messageView
//
//
this.messageView.ContextMenu = this.viewContextMenu;
this.messageView.Dock = System.Windows.Forms.DockStyle.Left;
this.messageView.HideSelection = false;
523,27 → 523,27
this.messageView.TabIndex = 11;
this.messageView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.messageView_AfterSelect);
this.messageView.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.messageView_BeforeSelect);
//
//
// saveBinLogDialog
//
//
this.saveBinLogDialog.DefaultExt = "tcp";
this.saveBinLogDialog.Filter = "TCP Logs (*.bin)|*.bin|All Files|*.*";
this.saveBinLogDialog.Title = "Save Binary Log";
//
//
// loadBinLogDialog
//
//
this.loadBinLogDialog.FileName = "openFileDialog1";
this.loadBinLogDialog.Filter = "TCP Logs (*.bin)|*.bin|All Files|*.*";
this.loadBinLogDialog.Title = "Load Binary Log";
//
//
// autoExpandMenuItem
//
//
this.autoExpandMenuItem.Index = 1;
this.autoExpandMenuItem.Text = "Auto E&xpand";
this.autoExpandMenuItem.Click += new System.EventHandler(this.autoExpandMenuItem_Click);
//
//
// messagesBox
//
//
this.messagesBox.ContextMenu = this.messagesContextMenu;
this.messagesBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.messagesBox.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
552,9 → 552,9
this.messagesBox.Size = new System.Drawing.Size(617, 268);
this.messagesBox.TabIndex = 7;
this.messagesBox.WordWrap = true;
//
//
// MainForm
//
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(780, 361);
this.Controls.Add(this.panel1);
624,6 → 624,8
}
}
base.Dispose( disposing );
 
ThreadDebugger.PrintStatus();
}
 
[STAThread]
916,9 → 918,9
this.ClientSize = new Size(
(int)subkey.GetValue("Window.Width", this.ClientSize.Width),
(int)subkey.GetValue("Window.Hight", this.ClientSize.Height));
this.messageView.Width
this.messageView.Width
= (int)subkey.GetValue("Splitter.Left", this.messageView.Width);
this.logBox.Height
this.logBox.Height
= (int)subkey.GetValue("Splitter.Bottom", this.logBox.Height);
}
}
1053,10 → 1055,10
if(count == 0) {
}
else if(count < 10)
item.Text = string.Format("&{3} {0} to {1}:{2}", recentItem.ListenPort,
item.Text = string.Format("&{3} {0} to {1}:{2}", recentItem.ListenPort,
recentItem.ResendHost, recentItem.ResendPort, count + 1);
else
item.Text = string.Format("{0} to {1}:{2}", recentItem.ListenPort,
item.Text = string.Format("{0} to {1}:{2}", recentItem.ListenPort,
recentItem.ResendHost, recentItem.ResendPort);
count++;
}
1223,7 → 1225,7
StopListening();
ClearAll();
 
FileStream file = new FileStream(fileName, FileMode.Open);
FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
BinaryReader reader = new BinaryReader(file);
 
// header
1374,7 → 1376,7
 
data.Tcp = tcp;
treeNode.Tag = data;
treeNode.ImageIndex = (tcp.LocalState == SocketState.Closed
treeNode.ImageIndex = (tcp.LocalState == SocketState.Closed
&& tcp.RemoteState == SocketState.Closed) ? 2 : 1;
treeNode.SelectedImageIndex = treeNode.ImageIndex;
treeNodes[tcp] = data;