diff --git a/Programs/WinGridProxy/FormWinGridProxy.Designer.cs b/Programs/WinGridProxy/FormWinGridProxy.Designer.cs index 39765158..bd764fcf 100644 --- a/Programs/WinGridProxy/FormWinGridProxy.Designer.cs +++ b/Programs/WinGridProxy/FormWinGridProxy.Designer.cs @@ -36,8 +36,13 @@ System.Windows.Forms.ListViewGroup listViewGroup4 = new System.Windows.Forms.ListViewGroup("EventQueue Messages", System.Windows.Forms.HorizontalAlignment.Left); this.panelMainWindow = new System.Windows.Forms.Panel(); this.splitContainerSessionsTabs = new System.Windows.Forms.SplitContainer(); - this.panelActionProgress = new System.Windows.Forms.Panel(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.listViewSessions = new WinGridProxy.ListViewNoFlicker(); + this.columnHeaderCounter = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderProtocol = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderType = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderSize = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderUrl = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderContentType = new System.Windows.Forms.ColumnHeader(); this.contextMenuStripSessions = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripMenuSessionsRemove = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStripRemove = new System.Windows.Forms.ContextMenuStrip(this.components); @@ -52,6 +57,7 @@ this.noneToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparatorSelectPacketProto = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItemSelectPacketName = new System.Windows.Forms.ToolStripMenuItem(); + this.selectToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparatorFilterPacketByName = new System.Windows.Forms.ToolStripSeparator(); this.enableDisableFilterByNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); @@ -66,6 +72,7 @@ this.unmarkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); this.findToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.autoscrollToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.tabControlMain = new System.Windows.Forms.TabControl(); this.tabPageSummary = new System.Windows.Forms.TabPage(); @@ -86,17 +93,21 @@ this.label5 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.tabPageFilters = new System.Windows.Forms.TabPage(); - this.splitContainerFilters = new System.Windows.Forms.SplitContainer(); - this.checkBoxCheckAllPackets = new System.Windows.Forms.CheckBox(); - this.grpUDPFilters = new System.Windows.Forms.GroupBox(); - this.checkBoxCheckAllMessages = new System.Windows.Forms.CheckBox(); - this.grpCapsFilters = new System.Windows.Forms.GroupBox(); this.toolStripFilters = new System.Windows.Forms.ToolStrip(); this.loadFilterSelectionsToolStripMenuItem = new System.Windows.Forms.ToolStripButton(); this.saveFilterSelectionsToolStripMenuItem = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSplitButton1 = new System.Windows.Forms.ToolStripSplitButton(); this.autoAddNewDiscoveredMessagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.splitContainerFilters = new System.Windows.Forms.SplitContainer(); + this.checkBoxCheckAllPackets = new System.Windows.Forms.CheckBox(); + this.grpUDPFilters = new System.Windows.Forms.GroupBox(); + this.listViewPacketFilters = new WinGridProxy.ListViewNoFlicker(); + this.columnHeaderPacketName = new System.Windows.Forms.ColumnHeader(); + this.checkBoxCheckAllMessages = new System.Windows.Forms.CheckBox(); + this.grpCapsFilters = new System.Windows.Forms.GroupBox(); + this.listViewMessageFilters = new WinGridProxy.ListViewNoFlicker(); + this.columnHeaderName = new System.Windows.Forms.ColumnHeader(); this.tabPageInspect = new System.Windows.Forms.TabPage(); this.splitContainerInspectorTab = new System.Windows.Forms.SplitContainer(); this.tabControlInspectorRequest = new System.Windows.Forms.TabControl(); @@ -126,10 +137,8 @@ this.labelHexBoxResponseStatus = new System.Windows.Forms.Label(); this.hexBoxResponse = new Be.Windows.Forms.HexBox(); this.tabPageInject = new System.Windows.Forms.TabPage(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripButtonInject = new System.Windows.Forms.ToolStripButton(); + this.buttonInjectPacket = new System.Windows.Forms.Button(); this.richTextBoxInject = new System.Windows.Forms.RichTextBox(); - this.selectToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.markToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripLabelHexEditorRequest = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); @@ -162,8 +171,6 @@ this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripDropDownButton4 = new System.Windows.Forms.ToolStripDropDownButton(); - this.documentationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutWinGridProxyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer1 = new System.Windows.Forms.Timer(this.components); @@ -210,9 +217,6 @@ this.autoColorizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.colorDialog1 = new System.Windows.Forms.ColorDialog(); this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripLowerStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripLogin = new System.Windows.Forms.ToolStrip(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); this.comboBoxListenAddress = new System.Windows.Forms.ToolStripComboBox(); @@ -221,27 +225,12 @@ this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel(); this.comboBoxLoginURL = new System.Windows.Forms.ToolStripComboBox(); this.buttonStartProxy = new System.Windows.Forms.ToolStripButton(); - this.toolStripQuickLaunch = new System.Windows.Forms.ToolStrip(); - this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox(); - this.buttonLaunchViewer = new System.Windows.Forms.ToolStripButton(); this.saveFileDialog3 = new System.Windows.Forms.SaveFileDialog(); - this.timerCleanupCache = new System.Windows.Forms.Timer(this.components); - this.listViewSessions = new WinGridProxy.ListViewNoFlicker(); - this.columnHeaderCounter = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderProtocol = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderType = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderSize = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderUrl = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderContentType = new System.Windows.Forms.ColumnHeader(); - this.listViewPacketFilters = new WinGridProxy.ListViewNoFlicker(); - this.columnHeaderPacketName = new System.Windows.Forms.ColumnHeader(); - this.listViewMessageFilters = new WinGridProxy.ListViewNoFlicker(); - this.columnHeaderName = new System.Windows.Forms.ColumnHeader(); + this.timerSessionQueue = new System.Windows.Forms.Timer(this.components); this.panelMainWindow.SuspendLayout(); this.splitContainerSessionsTabs.Panel1.SuspendLayout(); this.splitContainerSessionsTabs.Panel2.SuspendLayout(); this.splitContainerSessionsTabs.SuspendLayout(); - this.panelActionProgress.SuspendLayout(); this.contextMenuStripSessions.SuspendLayout(); this.contextMenuStripRemove.SuspendLayout(); this.contextMenuStripSelect.SuspendLayout(); @@ -252,12 +241,12 @@ this.groupBox2.SuspendLayout(); this.groupBox1.SuspendLayout(); this.tabPageFilters.SuspendLayout(); + this.toolStripFilters.SuspendLayout(); this.splitContainerFilters.Panel1.SuspendLayout(); this.splitContainerFilters.Panel2.SuspendLayout(); this.splitContainerFilters.SuspendLayout(); this.grpUDPFilters.SuspendLayout(); this.grpCapsFilters.SuspendLayout(); - this.toolStripFilters.SuspendLayout(); this.tabPageInspect.SuspendLayout(); this.splitContainerInspectorTab.Panel1.SuspendLayout(); this.splitContainerInspectorTab.Panel2.SuspendLayout(); @@ -275,17 +264,13 @@ this.tabPageResponseJson.SuspendLayout(); this.tabPageHexViewResponse.SuspendLayout(); this.tabPageInject.SuspendLayout(); - this.toolStrip1.SuspendLayout(); this.toolStripMenu.SuspendLayout(); this.contextMenuStripCopy.SuspendLayout(); this.contextMenuStripFilterOptions.SuspendLayout(); - this.toolStripContainer1.BottomToolStripPanel.SuspendLayout(); this.toolStripContainer1.ContentPanel.SuspendLayout(); this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); this.toolStripContainer1.SuspendLayout(); - this.statusStrip1.SuspendLayout(); this.toolStripLogin.SuspendLayout(); - this.toolStripQuickLaunch.SuspendLayout(); this.SuspendLayout(); // // panelMainWindow @@ -294,7 +279,7 @@ this.panelMainWindow.Dock = System.Windows.Forms.DockStyle.Fill; this.panelMainWindow.Location = new System.Drawing.Point(0, 0); this.panelMainWindow.Name = "panelMainWindow"; - this.panelMainWindow.Size = new System.Drawing.Size(1111, 442); + this.panelMainWindow.Size = new System.Drawing.Size(1111, 494); this.panelMainWindow.TabIndex = 1; // // splitContainerSessionsTabs @@ -306,38 +291,74 @@ // // splitContainerSessionsTabs.Panel1 // - this.splitContainerSessionsTabs.Panel1.Controls.Add(this.panelActionProgress); this.splitContainerSessionsTabs.Panel1.Controls.Add(this.listViewSessions); // // splitContainerSessionsTabs.Panel2 // this.splitContainerSessionsTabs.Panel2.Controls.Add(this.tabControlMain); - this.splitContainerSessionsTabs.Size = new System.Drawing.Size(1111, 442); + this.splitContainerSessionsTabs.Size = new System.Drawing.Size(1111, 494); this.splitContainerSessionsTabs.SplitterDistance = 479; this.splitContainerSessionsTabs.SplitterWidth = 5; this.splitContainerSessionsTabs.TabIndex = 0; // - // panelActionProgress + // listViewSessions // - this.panelActionProgress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panelActionProgress.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelActionProgress.Controls.Add(this.progressBar1); - this.panelActionProgress.Location = new System.Drawing.Point(117, 224); - this.panelActionProgress.Name = "panelActionProgress"; - this.panelActionProgress.Size = new System.Drawing.Size(244, 18); - this.panelActionProgress.TabIndex = 4; - this.panelActionProgress.Visible = false; + this.listViewSessions.AllowColumnReorder = true; + this.listViewSessions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderCounter, + this.columnHeaderProtocol, + this.columnHeaderType, + this.columnHeaderSize, + this.columnHeaderUrl, + this.columnHeaderContentType}); + this.listViewSessions.ContextMenuStrip = this.contextMenuStripSessions; + this.listViewSessions.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewSessions.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.listViewSessions.FullRowSelect = true; + this.listViewSessions.GridLines = true; + this.listViewSessions.HideSelection = false; + this.listViewSessions.Location = new System.Drawing.Point(0, 0); + this.listViewSessions.Name = "listViewSessions"; + this.listViewSessions.Size = new System.Drawing.Size(479, 494); + this.listViewSessions.SmallImageList = this.imageList1; + this.listViewSessions.TabIndex = 0; + this.listViewSessions.UseCompatibleStateImageBehavior = false; + this.listViewSessions.View = System.Windows.Forms.View.Details; + this.listViewSessions.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewSessions_ColumnClick); + this.listViewSessions.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listViewSessions_ItemSelectionChanged); // - // progressBar1 + // columnHeaderCounter // - this.progressBar1.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.progressBar1.Location = new System.Drawing.Point(0, 0); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(242, 16); - this.progressBar1.TabIndex = 0; + this.columnHeaderCounter.Tag = "number"; + this.columnHeaderCounter.Text = "#"; + this.columnHeaderCounter.Width = 40; + // + // columnHeaderProtocol + // + this.columnHeaderProtocol.Tag = "string"; + this.columnHeaderProtocol.Text = "Protocol"; + // + // columnHeaderType + // + this.columnHeaderType.Tag = "string"; + this.columnHeaderType.Text = "Name"; + this.columnHeaderType.Width = 151; + // + // columnHeaderSize + // + this.columnHeaderSize.Tag = ""; + this.columnHeaderSize.Text = "Bytes"; + this.columnHeaderSize.Width = 42; + // + // columnHeaderUrl + // + this.columnHeaderUrl.Text = "Host"; + this.columnHeaderUrl.Width = 312; + // + // columnHeaderContentType + // + this.columnHeaderContentType.Text = "Content Type"; + this.columnHeaderContentType.Width = 250; // // contextMenuStripSessions // @@ -349,16 +370,17 @@ this.toolStripSeparator15, this.markToolStripMenuItem2, this.toolStripSeparator16, - this.findToolStripMenuItem1}); + this.findToolStripMenuItem1, + this.autoscrollToolStripMenuItem}); this.contextMenuStripSessions.Name = "contextMenuStripSessions"; - this.contextMenuStripSessions.Size = new System.Drawing.Size(176, 132); + this.contextMenuStripSessions.Size = new System.Drawing.Size(218, 154); this.contextMenuStripSessions.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripSessions_Opening); // // toolStripMenuSessionsRemove // this.toolStripMenuSessionsRemove.DropDown = this.contextMenuStripRemove; this.toolStripMenuSessionsRemove.Name = "toolStripMenuSessionsRemove"; - this.toolStripMenuSessionsRemove.Size = new System.Drawing.Size(175, 22); + this.toolStripMenuSessionsRemove.Size = new System.Drawing.Size(217, 22); this.toolStripMenuSessionsRemove.Text = "Remove"; // // contextMenuStripRemove @@ -368,7 +390,7 @@ this.toolStripMenuItemRemoveSelected, this.toolStripMenuItemRemoveUnselected}); this.contextMenuStripRemove.Name = "contextMenuStripRemove"; - this.contextMenuStripRemove.OwnerItem = this.removeToolStripMenuItem2; + this.contextMenuStripRemove.OwnerItem = this.toolStripMenuSessionsRemove; this.contextMenuStripRemove.Size = new System.Drawing.Size(143, 70); // // toolStripMenuItemRemoveAll @@ -404,7 +426,7 @@ // this.selectToolStripMenuItem2.DropDown = this.contextMenuStripSelect; this.selectToolStripMenuItem2.Name = "selectToolStripMenuItem2"; - this.selectToolStripMenuItem2.Size = new System.Drawing.Size(175, 22); + this.selectToolStripMenuItem2.Size = new System.Drawing.Size(217, 22); this.selectToolStripMenuItem2.Text = "Select"; // // contextMenuStripSelect @@ -453,10 +475,17 @@ this.toolStripMenuItemSelectPacketName.Text = "All (Packet Type)"; this.toolStripMenuItemSelectPacketName.Click += new System.EventHandler(this.sessionSelectAllPacketType_Click); // + // selectToolStripMenuItem1 + // + this.selectToolStripMenuItem1.DropDown = this.contextMenuStripSelect; + this.selectToolStripMenuItem1.Name = "selectToolStripMenuItem1"; + this.selectToolStripMenuItem1.Size = new System.Drawing.Size(137, 22); + this.selectToolStripMenuItem1.Text = "Select"; + // // toolStripSeparatorFilterPacketByName // this.toolStripSeparatorFilterPacketByName.Name = "toolStripSeparatorFilterPacketByName"; - this.toolStripSeparatorFilterPacketByName.Size = new System.Drawing.Size(172, 6); + this.toolStripSeparatorFilterPacketByName.Size = new System.Drawing.Size(214, 6); // // enableDisableFilterByNameToolStripMenuItem // @@ -464,20 +493,21 @@ this.enableDisableFilterByNameToolStripMenuItem.CheckOnClick = true; this.enableDisableFilterByNameToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.enableDisableFilterByNameToolStripMenuItem.Name = "enableDisableFilterByNameToolStripMenuItem"; - this.enableDisableFilterByNameToolStripMenuItem.Size = new System.Drawing.Size(175, 22); + this.enableDisableFilterByNameToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.enableDisableFilterByNameToolStripMenuItem.Size = new System.Drawing.Size(217, 22); this.enableDisableFilterByNameToolStripMenuItem.Text = "Filter (Packet Type)"; this.enableDisableFilterByNameToolStripMenuItem.CheckedChanged += new System.EventHandler(this.filterDisableByPacketName_CheckedChanged); // // toolStripSeparator15 // this.toolStripSeparator15.Name = "toolStripSeparator15"; - this.toolStripSeparator15.Size = new System.Drawing.Size(172, 6); + this.toolStripSeparator15.Size = new System.Drawing.Size(214, 6); // // markToolStripMenuItem2 // this.markToolStripMenuItem2.DropDown = this.contextMenuStripMark; this.markToolStripMenuItem2.Name = "markToolStripMenuItem2"; - this.markToolStripMenuItem2.Size = new System.Drawing.Size(175, 22); + this.markToolStripMenuItem2.Size = new System.Drawing.Size(217, 22); this.markToolStripMenuItem2.Text = "Mark"; // // contextMenuStripMark @@ -491,7 +521,7 @@ this.toolStripSeparator17, this.unmarkToolStripMenuItem}); this.contextMenuStripMark.Name = "contextMenuStripMarkDropdown"; - this.contextMenuStripMark.OwnerItem = this.markToolStripMenuItem2; + this.contextMenuStripMark.OwnerItem = this.markToolStripMenuItem1; this.contextMenuStripMark.Size = new System.Drawing.Size(117, 142); // // redToolStripMenuItem2 @@ -544,16 +574,25 @@ // toolStripSeparator16 // this.toolStripSeparator16.Name = "toolStripSeparator16"; - this.toolStripSeparator16.Size = new System.Drawing.Size(172, 6); + this.toolStripSeparator16.Size = new System.Drawing.Size(214, 6); // // findToolStripMenuItem1 // this.findToolStripMenuItem1.Name = "findToolStripMenuItem1"; this.findToolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); - this.findToolStripMenuItem1.Size = new System.Drawing.Size(175, 22); + this.findToolStripMenuItem1.Size = new System.Drawing.Size(217, 22); this.findToolStripMenuItem1.Text = "Find"; this.findToolStripMenuItem1.Click += new System.EventHandler(this.findSessions_Click); // + // autoscrollToolStripMenuItem + // + this.autoscrollToolStripMenuItem.CheckOnClick = true; + this.autoscrollToolStripMenuItem.Name = "autoscrollToolStripMenuItem"; + this.autoscrollToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Q"; + this.autoscrollToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q))); + this.autoscrollToolStripMenuItem.Size = new System.Drawing.Size(217, 22); + this.autoscrollToolStripMenuItem.Text = "Autoscroll"; + // // imageList1 // this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); @@ -576,7 +615,7 @@ this.tabControlMain.Name = "tabControlMain"; this.tabControlMain.Padding = new System.Drawing.Point(10, 6); this.tabControlMain.SelectedIndex = 0; - this.tabControlMain.Size = new System.Drawing.Size(627, 442); + this.tabControlMain.Size = new System.Drawing.Size(627, 494); this.tabControlMain.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.tabControlMain.TabIndex = 0; // @@ -588,7 +627,7 @@ this.tabPageSummary.Location = new System.Drawing.Point(4, 30); this.tabPageSummary.Name = "tabPageSummary"; this.tabPageSummary.Padding = new System.Windows.Forms.Padding(3); - this.tabPageSummary.Size = new System.Drawing.Size(619, 408); + this.tabPageSummary.Size = new System.Drawing.Size(619, 460); this.tabPageSummary.TabIndex = 0; this.tabPageSummary.Text = "Summary"; this.tabPageSummary.UseVisualStyleBackColor = true; @@ -604,8 +643,9 @@ this.richTextBoxDebugLog.Location = new System.Drawing.Point(6, 101); this.richTextBoxDebugLog.Name = "richTextBoxDebugLog"; this.richTextBoxDebugLog.ReadOnly = true; + this.richTextBoxDebugLog.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; this.richTextBoxDebugLog.ShowSelectionMargin = true; - this.richTextBoxDebugLog.Size = new System.Drawing.Size(606, 299); + this.richTextBoxDebugLog.Size = new System.Drawing.Size(606, 352); this.richTextBoxDebugLog.TabIndex = 3; this.richTextBoxDebugLog.Text = ""; this.richTextBoxDebugLog.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBoxDecodedRequest_LinkClicked); @@ -621,7 +661,7 @@ this.panelStats.Controls.Add(this.groupBox1); this.panelStats.Location = new System.Drawing.Point(6, 6); this.panelStats.Name = "panelStats"; - this.panelStats.Size = new System.Drawing.Size(606, 64); + this.panelStats.Size = new System.Drawing.Size(606, 89); this.panelStats.TabIndex = 2; // // groupBox2 @@ -634,7 +674,7 @@ this.groupBox2.Controls.Add(this.label8); this.groupBox2.Location = new System.Drawing.Point(6, 3); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(280, 80); + this.groupBox2.Size = new System.Drawing.Size(221, 80); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; this.groupBox2.Text = "UDP Packets"; @@ -642,7 +682,7 @@ // labelPacketsTotal // this.labelPacketsTotal.AutoSize = true; - this.labelPacketsTotal.Location = new System.Drawing.Point(94, 58); + this.labelPacketsTotal.Location = new System.Drawing.Point(81, 58); this.labelPacketsTotal.Name = "labelPacketsTotal"; this.labelPacketsTotal.Size = new System.Drawing.Size(64, 15); this.labelPacketsTotal.TabIndex = 8; @@ -651,7 +691,7 @@ // label1PacketsOut // this.label1PacketsOut.AutoSize = true; - this.label1PacketsOut.Location = new System.Drawing.Point(94, 37); + this.label1PacketsOut.Location = new System.Drawing.Point(81, 37); this.label1PacketsOut.Name = "label1PacketsOut"; this.label1PacketsOut.Size = new System.Drawing.Size(64, 15); this.label1PacketsOut.TabIndex = 7; @@ -660,7 +700,7 @@ // labelPacketsIn // this.labelPacketsIn.AutoSize = true; - this.labelPacketsIn.Location = new System.Drawing.Point(94, 16); + this.labelPacketsIn.Location = new System.Drawing.Point(81, 16); this.labelPacketsIn.Name = "labelPacketsIn"; this.labelPacketsIn.Size = new System.Drawing.Size(64, 15); this.labelPacketsIn.TabIndex = 6; @@ -702,9 +742,9 @@ this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label7); - this.groupBox1.Location = new System.Drawing.Point(323, 3); + this.groupBox1.Location = new System.Drawing.Point(382, 3); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(280, 80); + this.groupBox1.Size = new System.Drawing.Size(221, 80); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "Caps Messages"; @@ -765,92 +805,16 @@ // // tabPageFilters // - this.tabPageFilters.Controls.Add(this.splitContainerFilters); this.tabPageFilters.Controls.Add(this.toolStripFilters); + this.tabPageFilters.Controls.Add(this.splitContainerFilters); this.tabPageFilters.Location = new System.Drawing.Point(4, 30); this.tabPageFilters.Name = "tabPageFilters"; this.tabPageFilters.Padding = new System.Windows.Forms.Padding(3); - this.tabPageFilters.Size = new System.Drawing.Size(619, 408); + this.tabPageFilters.Size = new System.Drawing.Size(619, 460); this.tabPageFilters.TabIndex = 1; this.tabPageFilters.Text = "Filters"; this.tabPageFilters.UseVisualStyleBackColor = true; // - // splitContainerFilters - // - this.splitContainerFilters.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainerFilters.Location = new System.Drawing.Point(3, 28); - this.splitContainerFilters.Name = "splitContainerFilters"; - // - // splitContainerFilters.Panel1 - // - this.splitContainerFilters.Panel1.Controls.Add(this.checkBoxCheckAllPackets); - this.splitContainerFilters.Panel1.Controls.Add(this.grpUDPFilters); - // - // splitContainerFilters.Panel2 - // - this.splitContainerFilters.Panel2.Controls.Add(this.checkBoxCheckAllMessages); - this.splitContainerFilters.Panel2.Controls.Add(this.grpCapsFilters); - this.splitContainerFilters.Size = new System.Drawing.Size(613, 377); - this.splitContainerFilters.SplitterDistance = 303; - this.splitContainerFilters.SplitterWidth = 5; - this.splitContainerFilters.TabIndex = 0; - // - // checkBoxCheckAllPackets - // - this.checkBoxCheckAllPackets.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBoxCheckAllPackets.AutoSize = true; - this.checkBoxCheckAllPackets.Checked = true; - this.checkBoxCheckAllPackets.CheckState = System.Windows.Forms.CheckState.Indeterminate; - this.checkBoxCheckAllPackets.Location = new System.Drawing.Point(3, 353); - this.checkBoxCheckAllPackets.Name = "checkBoxCheckAllPackets"; - this.checkBoxCheckAllPackets.Size = new System.Drawing.Size(127, 19); - this.checkBoxCheckAllPackets.TabIndex = 1; - this.checkBoxCheckAllPackets.Text = "Check/Uncheck All"; - this.checkBoxCheckAllPackets.UseVisualStyleBackColor = true; - this.checkBoxCheckAllPackets.CheckedChanged += new System.EventHandler(this.checkBoxCheckAllPackets_CheckedChanged); - // - // grpUDPFilters - // - this.grpUDPFilters.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.grpUDPFilters.Controls.Add(this.listViewPacketFilters); - this.grpUDPFilters.Enabled = false; - this.grpUDPFilters.Location = new System.Drawing.Point(3, 3); - this.grpUDPFilters.Name = "grpUDPFilters"; - this.grpUDPFilters.Size = new System.Drawing.Size(297, 344); - this.grpUDPFilters.TabIndex = 0; - this.grpUDPFilters.TabStop = false; - this.grpUDPFilters.Text = "UDP Packets && Login"; - // - // checkBoxCheckAllMessages - // - this.checkBoxCheckAllMessages.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBoxCheckAllMessages.AutoSize = true; - this.checkBoxCheckAllMessages.Checked = true; - this.checkBoxCheckAllMessages.CheckState = System.Windows.Forms.CheckState.Indeterminate; - this.checkBoxCheckAllMessages.Location = new System.Drawing.Point(6, 353); - this.checkBoxCheckAllMessages.Name = "checkBoxCheckAllMessages"; - this.checkBoxCheckAllMessages.Size = new System.Drawing.Size(127, 19); - this.checkBoxCheckAllMessages.TabIndex = 2; - this.checkBoxCheckAllMessages.Text = "Check/Uncheck All"; - this.checkBoxCheckAllMessages.UseVisualStyleBackColor = true; - this.checkBoxCheckAllMessages.CheckedChanged += new System.EventHandler(this.checkBoxCheckallCaps_CheckedChanged); - // - // grpCapsFilters - // - this.grpCapsFilters.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.grpCapsFilters.Controls.Add(this.listViewMessageFilters); - this.grpCapsFilters.Enabled = false; - this.grpCapsFilters.Location = new System.Drawing.Point(3, 3); - this.grpCapsFilters.Name = "grpCapsFilters"; - this.grpCapsFilters.Size = new System.Drawing.Size(299, 341); - this.grpCapsFilters.TabIndex = 1; - this.grpCapsFilters.TabStop = false; - this.grpCapsFilters.Text = "Capabilities && EventQueue messages"; - // // toolStripFilters // this.toolStripFilters.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; @@ -911,12 +875,156 @@ this.autoAddNewDiscoveredMessagesToolStripMenuItem.Size = new System.Drawing.Size(225, 22); this.autoAddNewDiscoveredMessagesToolStripMenuItem.Text = "Auto Check new Capabilities"; // + // splitContainerFilters + // + this.splitContainerFilters.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.splitContainerFilters.Location = new System.Drawing.Point(3, 31); + this.splitContainerFilters.Name = "splitContainerFilters"; + // + // splitContainerFilters.Panel1 + // + this.splitContainerFilters.Panel1.Controls.Add(this.checkBoxCheckAllPackets); + this.splitContainerFilters.Panel1.Controls.Add(this.grpUDPFilters); + // + // splitContainerFilters.Panel2 + // + this.splitContainerFilters.Panel2.Controls.Add(this.checkBoxCheckAllMessages); + this.splitContainerFilters.Panel2.Controls.Add(this.grpCapsFilters); + this.splitContainerFilters.Size = new System.Drawing.Size(613, 427); + this.splitContainerFilters.SplitterDistance = 303; + this.splitContainerFilters.SplitterWidth = 5; + this.splitContainerFilters.TabIndex = 0; + // + // checkBoxCheckAllPackets + // + this.checkBoxCheckAllPackets.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxCheckAllPackets.AutoSize = true; + this.checkBoxCheckAllPackets.Checked = true; + this.checkBoxCheckAllPackets.CheckState = System.Windows.Forms.CheckState.Indeterminate; + this.checkBoxCheckAllPackets.Location = new System.Drawing.Point(6, 404); + this.checkBoxCheckAllPackets.Name = "checkBoxCheckAllPackets"; + this.checkBoxCheckAllPackets.Size = new System.Drawing.Size(127, 19); + this.checkBoxCheckAllPackets.TabIndex = 1; + this.checkBoxCheckAllPackets.Text = "Check/Uncheck All"; + this.checkBoxCheckAllPackets.UseVisualStyleBackColor = true; + this.checkBoxCheckAllPackets.CheckedChanged += new System.EventHandler(this.checkBoxCheckAllPackets_CheckedChanged); + // + // grpUDPFilters + // + this.grpUDPFilters.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.grpUDPFilters.Controls.Add(this.listViewPacketFilters); + this.grpUDPFilters.Enabled = false; + this.grpUDPFilters.Location = new System.Drawing.Point(3, 3); + this.grpUDPFilters.Name = "grpUDPFilters"; + this.grpUDPFilters.Size = new System.Drawing.Size(297, 394); + this.grpUDPFilters.TabIndex = 0; + this.grpUDPFilters.TabStop = false; + this.grpUDPFilters.Text = "UDP Packets && Login"; + // + // listViewPacketFilters + // + this.listViewPacketFilters.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listViewPacketFilters.CheckBoxes = true; + this.listViewPacketFilters.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderPacketName}); + this.listViewPacketFilters.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewPacketFilters.FullRowSelect = true; + this.listViewPacketFilters.GridLines = true; + listViewGroup1.Header = "Login"; + listViewGroup1.Name = "Login"; + listViewGroup2.Header = "Packets"; + listViewGroup2.Name = "Packets"; + this.listViewPacketFilters.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup1, + listViewGroup2}); + this.listViewPacketFilters.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listViewPacketFilters.Location = new System.Drawing.Point(3, 17); + this.listViewPacketFilters.MultiSelect = false; + this.listViewPacketFilters.Name = "listViewPacketFilters"; + this.listViewPacketFilters.Size = new System.Drawing.Size(291, 374); + this.listViewPacketFilters.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.listViewPacketFilters.TabIndex = 0; + this.listViewPacketFilters.UseCompatibleStateImageBehavior = false; + this.listViewPacketFilters.View = System.Windows.Forms.View.Details; + this.listViewPacketFilters.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listViewPacketFilters_ItemChecked); + this.listViewPacketFilters.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewFilterSorter_ColumnClick); + // + // columnHeaderPacketName + // + this.columnHeaderPacketName.Text = "Name"; + this.columnHeaderPacketName.Width = 287; + // + // checkBoxCheckAllMessages + // + this.checkBoxCheckAllMessages.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxCheckAllMessages.AutoSize = true; + this.checkBoxCheckAllMessages.Checked = true; + this.checkBoxCheckAllMessages.CheckState = System.Windows.Forms.CheckState.Indeterminate; + this.checkBoxCheckAllMessages.Location = new System.Drawing.Point(6, 405); + this.checkBoxCheckAllMessages.Name = "checkBoxCheckAllMessages"; + this.checkBoxCheckAllMessages.Size = new System.Drawing.Size(127, 19); + this.checkBoxCheckAllMessages.TabIndex = 2; + this.checkBoxCheckAllMessages.Text = "Check/Uncheck All"; + this.checkBoxCheckAllMessages.UseVisualStyleBackColor = true; + this.checkBoxCheckAllMessages.CheckedChanged += new System.EventHandler(this.checkBoxCheckallCaps_CheckedChanged); + // + // grpCapsFilters + // + this.grpCapsFilters.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.grpCapsFilters.Controls.Add(this.listViewMessageFilters); + this.grpCapsFilters.Enabled = false; + this.grpCapsFilters.Location = new System.Drawing.Point(3, 3); + this.grpCapsFilters.Name = "grpCapsFilters"; + this.grpCapsFilters.Size = new System.Drawing.Size(299, 394); + this.grpCapsFilters.TabIndex = 1; + this.grpCapsFilters.TabStop = false; + this.grpCapsFilters.Text = "Capabilities && EventQueue messages"; + // + // listViewMessageFilters + // + this.listViewMessageFilters.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listViewMessageFilters.CheckBoxes = true; + this.listViewMessageFilters.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderName}); + this.listViewMessageFilters.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewMessageFilters.FullRowSelect = true; + this.listViewMessageFilters.GridLines = true; + listViewGroup3.Header = "Capabilities"; + listViewGroup3.Name = "Capabilities"; + listViewGroup4.Header = "EventQueue Messages"; + listViewGroup4.Name = "EventQueueMessages"; + this.listViewMessageFilters.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup3, + listViewGroup4}); + this.listViewMessageFilters.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listViewMessageFilters.Location = new System.Drawing.Point(3, 17); + this.listViewMessageFilters.MultiSelect = false; + this.listViewMessageFilters.Name = "listViewMessageFilters"; + this.listViewMessageFilters.Size = new System.Drawing.Size(293, 374); + this.listViewMessageFilters.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.listViewMessageFilters.TabIndex = 1; + this.listViewMessageFilters.UseCompatibleStateImageBehavior = false; + this.listViewMessageFilters.View = System.Windows.Forms.View.Details; + this.listViewMessageFilters.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listViewMessageFilters_ItemChecked); + this.listViewMessageFilters.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewFilterSorter_ColumnClick); + // + // columnHeaderName + // + this.columnHeaderName.Text = "Name"; + this.columnHeaderName.Width = 289; + // // tabPageInspect // this.tabPageInspect.Controls.Add(this.splitContainerInspectorTab); this.tabPageInspect.Location = new System.Drawing.Point(4, 30); this.tabPageInspect.Name = "tabPageInspect"; - this.tabPageInspect.Size = new System.Drawing.Size(619, 408); + this.tabPageInspect.Size = new System.Drawing.Size(619, 460); this.tabPageInspect.TabIndex = 3; this.tabPageInspect.Text = "Inspector"; this.tabPageInspect.UseVisualStyleBackColor = true; @@ -938,8 +1046,8 @@ // splitContainerInspectorTab.Panel2 // this.splitContainerInspectorTab.Panel2.Controls.Add(this.tabControlInspectorResponse); - this.splitContainerInspectorTab.Size = new System.Drawing.Size(619, 408); - this.splitContainerInspectorTab.SplitterDistance = 192; + this.splitContainerInspectorTab.Size = new System.Drawing.Size(619, 460); + this.splitContainerInspectorTab.SplitterDistance = 226; this.splitContainerInspectorTab.SplitterWidth = 6; this.splitContainerInspectorTab.TabIndex = 1; // @@ -957,7 +1065,7 @@ this.tabControlInspectorRequest.Location = new System.Drawing.Point(0, 0); this.tabControlInspectorRequest.Name = "tabControlInspectorRequest"; this.tabControlInspectorRequest.SelectedIndex = 0; - this.tabControlInspectorRequest.Size = new System.Drawing.Size(619, 192); + this.tabControlInspectorRequest.Size = new System.Drawing.Size(619, 226); this.tabControlInspectorRequest.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.tabControlInspectorRequest.TabIndex = 0; // @@ -968,7 +1076,7 @@ this.tabPageDecodedRequest.Location = new System.Drawing.Point(4, 24); this.tabPageDecodedRequest.Name = "tabPageDecodedRequest"; this.tabPageDecodedRequest.Padding = new System.Windows.Forms.Padding(3); - this.tabPageDecodedRequest.Size = new System.Drawing.Size(611, 164); + this.tabPageDecodedRequest.Size = new System.Drawing.Size(611, 198); this.tabPageDecodedRequest.TabIndex = 4; this.tabPageDecodedRequest.Text = "Request"; this.tabPageDecodedRequest.UseVisualStyleBackColor = true; @@ -981,7 +1089,7 @@ this.richTextBoxDecodedRequest.Location = new System.Drawing.Point(3, 3); this.richTextBoxDecodedRequest.Name = "richTextBoxDecodedRequest"; this.richTextBoxDecodedRequest.ShowSelectionMargin = true; - this.richTextBoxDecodedRequest.Size = new System.Drawing.Size(605, 158); + this.richTextBoxDecodedRequest.Size = new System.Drawing.Size(605, 192); this.richTextBoxDecodedRequest.TabIndex = 0; this.richTextBoxDecodedRequest.Text = ""; this.richTextBoxDecodedRequest.WordWrap = false; @@ -995,7 +1103,7 @@ this.tabPageRawRequest.Location = new System.Drawing.Point(4, 24); this.tabPageRawRequest.Name = "tabPageRawRequest"; this.tabPageRawRequest.Padding = new System.Windows.Forms.Padding(3); - this.tabPageRawRequest.Size = new System.Drawing.Size(611, 164); + this.tabPageRawRequest.Size = new System.Drawing.Size(611, 198); this.tabPageRawRequest.TabIndex = 0; this.tabPageRawRequest.Text = "Raw"; this.tabPageRawRequest.UseVisualStyleBackColor = true; @@ -1009,7 +1117,7 @@ this.richTextBoxRawRequest.Location = new System.Drawing.Point(3, 3); this.richTextBoxRawRequest.Name = "richTextBoxRawRequest"; this.richTextBoxRawRequest.ShowSelectionMargin = true; - this.richTextBoxRawRequest.Size = new System.Drawing.Size(605, 158); + this.richTextBoxRawRequest.Size = new System.Drawing.Size(605, 192); this.richTextBoxRawRequest.TabIndex = 1; this.richTextBoxRawRequest.Text = ""; this.richTextBoxRawRequest.WordWrap = false; @@ -1021,7 +1129,7 @@ this.tabPageXMLRequest.Location = new System.Drawing.Point(4, 24); this.tabPageXMLRequest.Name = "tabPageXMLRequest"; this.tabPageXMLRequest.Padding = new System.Windows.Forms.Padding(3); - this.tabPageXMLRequest.Size = new System.Drawing.Size(611, 164); + this.tabPageXMLRequest.Size = new System.Drawing.Size(611, 198); this.tabPageXMLRequest.TabIndex = 1; this.tabPageXMLRequest.Text = "XML"; this.tabPageXMLRequest.UseVisualStyleBackColor = true; @@ -1032,7 +1140,7 @@ this.treeViewXMLRequest.Dock = System.Windows.Forms.DockStyle.Fill; this.treeViewXMLRequest.Location = new System.Drawing.Point(3, 3); this.treeViewXMLRequest.Name = "treeViewXMLRequest"; - this.treeViewXMLRequest.Size = new System.Drawing.Size(605, 158); + this.treeViewXMLRequest.Size = new System.Drawing.Size(605, 192); this.treeViewXMLRequest.TabIndex = 1; // // tabPageRequestJson @@ -1042,7 +1150,7 @@ this.tabPageRequestJson.Location = new System.Drawing.Point(4, 24); this.tabPageRequestJson.Name = "tabPageRequestJson"; this.tabPageRequestJson.Padding = new System.Windows.Forms.Padding(3); - this.tabPageRequestJson.Size = new System.Drawing.Size(611, 164); + this.tabPageRequestJson.Size = new System.Drawing.Size(611, 198); this.tabPageRequestJson.TabIndex = 3; this.tabPageRequestJson.Text = "Notation"; this.tabPageRequestJson.UseVisualStyleBackColor = true; @@ -1055,7 +1163,7 @@ this.richTextBoxNotationRequest.Location = new System.Drawing.Point(3, 3); this.richTextBoxNotationRequest.Name = "richTextBoxNotationRequest"; this.richTextBoxNotationRequest.ShowSelectionMargin = true; - this.richTextBoxNotationRequest.Size = new System.Drawing.Size(605, 158); + this.richTextBoxNotationRequest.Size = new System.Drawing.Size(605, 192); this.richTextBoxNotationRequest.TabIndex = 0; this.richTextBoxNotationRequest.Text = ""; // @@ -1067,7 +1175,7 @@ this.tabPageHexRequest.ImageIndex = 1; this.tabPageHexRequest.Location = new System.Drawing.Point(4, 24); this.tabPageHexRequest.Name = "tabPageHexRequest"; - this.tabPageHexRequest.Size = new System.Drawing.Size(611, 164); + this.tabPageHexRequest.Size = new System.Drawing.Size(611, 198); this.tabPageHexRequest.TabIndex = 2; this.tabPageHexRequest.Text = "Hex"; this.tabPageHexRequest.UseVisualStyleBackColor = true; @@ -1076,7 +1184,7 @@ // this.buttonSaveRequestHex.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonSaveRequestHex.Font = new System.Drawing.Font("Arial", 3.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.buttonSaveRequestHex.Location = new System.Drawing.Point(594, 161); + this.buttonSaveRequestHex.Location = new System.Drawing.Point(594, 188); this.buttonSaveRequestHex.Name = "buttonSaveRequestHex"; this.buttonSaveRequestHex.Size = new System.Drawing.Size(13, 13); this.buttonSaveRequestHex.TabIndex = 4; @@ -1089,7 +1197,7 @@ this.labelHexRequestStatus.AutoSize = true; this.labelHexRequestStatus.Dock = System.Windows.Forms.DockStyle.Bottom; this.labelHexRequestStatus.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelHexRequestStatus.Location = new System.Drawing.Point(0, 151); + this.labelHexRequestStatus.Location = new System.Drawing.Point(0, 185); this.labelHexRequestStatus.Name = "labelHexRequestStatus"; this.labelHexRequestStatus.Size = new System.Drawing.Size(66, 13); this.labelHexRequestStatus.TabIndex = 3; @@ -1105,7 +1213,7 @@ this.hexBoxRequest.Location = new System.Drawing.Point(0, 0); this.hexBoxRequest.Name = "hexBoxRequest"; this.hexBoxRequest.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(60)))), ((int)(((byte)(188)))), ((int)(((byte)(255))))); - this.hexBoxRequest.Size = new System.Drawing.Size(611, 155); + this.hexBoxRequest.Size = new System.Drawing.Size(611, 185); this.hexBoxRequest.StringViewVisible = true; this.hexBoxRequest.TabIndex = 2; this.hexBoxRequest.UseFixedBytesPerLine = true; @@ -1128,7 +1236,7 @@ this.tabControlInspectorResponse.Multiline = true; this.tabControlInspectorResponse.Name = "tabControlInspectorResponse"; this.tabControlInspectorResponse.SelectedIndex = 0; - this.tabControlInspectorResponse.Size = new System.Drawing.Size(619, 210); + this.tabControlInspectorResponse.Size = new System.Drawing.Size(619, 228); this.tabControlInspectorResponse.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.tabControlInspectorResponse.TabIndex = 0; // @@ -1139,7 +1247,7 @@ this.tabPageDecodeResponse.Location = new System.Drawing.Point(4, 24); this.tabPageDecodeResponse.Name = "tabPageDecodeResponse"; this.tabPageDecodeResponse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageDecodeResponse.Size = new System.Drawing.Size(611, 182); + this.tabPageDecodeResponse.Size = new System.Drawing.Size(611, 200); this.tabPageDecodeResponse.TabIndex = 6; this.tabPageDecodeResponse.Text = "Response"; this.tabPageDecodeResponse.UseVisualStyleBackColor = true; @@ -1152,7 +1260,7 @@ this.richTextBoxDecodedResponse.Location = new System.Drawing.Point(3, 3); this.richTextBoxDecodedResponse.Name = "richTextBoxDecodedResponse"; this.richTextBoxDecodedResponse.ShowSelectionMargin = true; - this.richTextBoxDecodedResponse.Size = new System.Drawing.Size(605, 176); + this.richTextBoxDecodedResponse.Size = new System.Drawing.Size(605, 194); this.richTextBoxDecodedResponse.TabIndex = 0; this.richTextBoxDecodedResponse.Text = ""; this.richTextBoxDecodedResponse.WordWrap = false; @@ -1166,7 +1274,7 @@ this.tabPageInspectorRAWResponse.Location = new System.Drawing.Point(4, 24); this.tabPageInspectorRAWResponse.Name = "tabPageInspectorRAWResponse"; this.tabPageInspectorRAWResponse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageInspectorRAWResponse.Size = new System.Drawing.Size(611, 182); + this.tabPageInspectorRAWResponse.Size = new System.Drawing.Size(611, 200); this.tabPageInspectorRAWResponse.TabIndex = 0; this.tabPageInspectorRAWResponse.Text = "Raw"; this.tabPageInspectorRAWResponse.UseVisualStyleBackColor = true; @@ -1180,7 +1288,7 @@ this.richTextBoxRawResponse.Location = new System.Drawing.Point(3, 3); this.richTextBoxRawResponse.Name = "richTextBoxRawResponse"; this.richTextBoxRawResponse.ShowSelectionMargin = true; - this.richTextBoxRawResponse.Size = new System.Drawing.Size(605, 177); + this.richTextBoxRawResponse.Size = new System.Drawing.Size(605, 194); this.richTextBoxRawResponse.TabIndex = 0; this.richTextBoxRawResponse.Text = ""; this.richTextBoxRawResponse.WordWrap = false; @@ -1192,7 +1300,7 @@ this.tabPageInspectorXMLResponse.Location = new System.Drawing.Point(4, 24); this.tabPageInspectorXMLResponse.Name = "tabPageInspectorXMLResponse"; this.tabPageInspectorXMLResponse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageInspectorXMLResponse.Size = new System.Drawing.Size(611, 182); + this.tabPageInspectorXMLResponse.Size = new System.Drawing.Size(611, 200); this.tabPageInspectorXMLResponse.TabIndex = 1; this.tabPageInspectorXMLResponse.Text = "XML"; this.tabPageInspectorXMLResponse.UseVisualStyleBackColor = true; @@ -1203,7 +1311,7 @@ this.treeViewXmlResponse.Dock = System.Windows.Forms.DockStyle.Fill; this.treeViewXmlResponse.Location = new System.Drawing.Point(3, 3); this.treeViewXmlResponse.Name = "treeViewXmlResponse"; - this.treeViewXmlResponse.Size = new System.Drawing.Size(605, 177); + this.treeViewXmlResponse.Size = new System.Drawing.Size(605, 194); this.treeViewXmlResponse.TabIndex = 0; // // tabPageResponseJson @@ -1213,7 +1321,7 @@ this.tabPageResponseJson.Location = new System.Drawing.Point(4, 24); this.tabPageResponseJson.Name = "tabPageResponseJson"; this.tabPageResponseJson.Padding = new System.Windows.Forms.Padding(3); - this.tabPageResponseJson.Size = new System.Drawing.Size(611, 182); + this.tabPageResponseJson.Size = new System.Drawing.Size(611, 200); this.tabPageResponseJson.TabIndex = 5; this.tabPageResponseJson.Text = "Notation"; this.tabPageResponseJson.UseVisualStyleBackColor = true; @@ -1226,7 +1334,7 @@ this.richTextBoxNotationResponse.Location = new System.Drawing.Point(3, 3); this.richTextBoxNotationResponse.Name = "richTextBoxNotationResponse"; this.richTextBoxNotationResponse.ShowSelectionMargin = true; - this.richTextBoxNotationResponse.Size = new System.Drawing.Size(605, 177); + this.richTextBoxNotationResponse.Size = new System.Drawing.Size(605, 194); this.richTextBoxNotationResponse.TabIndex = 0; this.richTextBoxNotationResponse.Text = ""; // @@ -1238,7 +1346,7 @@ this.tabPageHexViewResponse.ImageIndex = 0; this.tabPageHexViewResponse.Location = new System.Drawing.Point(4, 24); this.tabPageHexViewResponse.Name = "tabPageHexViewResponse"; - this.tabPageHexViewResponse.Size = new System.Drawing.Size(611, 182); + this.tabPageHexViewResponse.Size = new System.Drawing.Size(611, 200); this.tabPageHexViewResponse.TabIndex = 4; this.tabPageHexViewResponse.Text = "Hex"; this.tabPageHexViewResponse.UseVisualStyleBackColor = true; @@ -1247,7 +1355,7 @@ // this.buttonExportRawHex.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonExportRawHex.Font = new System.Drawing.Font("Arial", 3.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.buttonExportRawHex.Location = new System.Drawing.Point(594, 180); + this.buttonExportRawHex.Location = new System.Drawing.Point(594, 190); this.buttonExportRawHex.Name = "buttonExportRawHex"; this.buttonExportRawHex.Size = new System.Drawing.Size(13, 13); this.buttonExportRawHex.TabIndex = 3; @@ -1260,7 +1368,7 @@ this.labelHexBoxResponseStatus.AutoSize = true; this.labelHexBoxResponseStatus.Dock = System.Windows.Forms.DockStyle.Bottom; this.labelHexBoxResponseStatus.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelHexBoxResponseStatus.Location = new System.Drawing.Point(0, 170); + this.labelHexBoxResponseStatus.Location = new System.Drawing.Point(0, 187); this.labelHexBoxResponseStatus.Name = "labelHexBoxResponseStatus"; this.labelHexBoxResponseStatus.Size = new System.Drawing.Size(66, 13); this.labelHexBoxResponseStatus.TabIndex = 2; @@ -1276,7 +1384,7 @@ this.hexBoxResponse.Location = new System.Drawing.Point(0, 0); this.hexBoxResponse.Name = "hexBoxResponse"; this.hexBoxResponse.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(60)))), ((int)(((byte)(188)))), ((int)(((byte)(255))))); - this.hexBoxResponse.Size = new System.Drawing.Size(611, 174); + this.hexBoxResponse.Size = new System.Drawing.Size(611, 187); this.hexBoxResponse.StringViewVisible = true; this.hexBoxResponse.TabIndex = 1; this.hexBoxResponse.UseFixedBytesPerLine = true; @@ -1286,37 +1394,27 @@ // // tabPageInject // - this.tabPageInject.Controls.Add(this.toolStrip1); + this.tabPageInject.Controls.Add(this.buttonInjectPacket); this.tabPageInject.Controls.Add(this.richTextBoxInject); this.tabPageInject.Location = new System.Drawing.Point(4, 30); this.tabPageInject.Name = "tabPageInject"; this.tabPageInject.Padding = new System.Windows.Forms.Padding(3); - this.tabPageInject.Size = new System.Drawing.Size(619, 408); + this.tabPageInject.Size = new System.Drawing.Size(619, 460); this.tabPageInject.TabIndex = 2; this.tabPageInject.Text = "Inject"; this.tabPageInject.UseVisualStyleBackColor = true; // - // toolStrip1 + // buttonInjectPacket // - this.toolStrip1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButtonInject}); - this.toolStrip1.Location = new System.Drawing.Point(3, 380); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(613, 25); - this.toolStrip1.TabIndex = 2; - this.toolStrip1.Text = "toolStrip1"; - // - // toolStripButtonInject - // - this.toolStripButtonInject.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButtonInject.Enabled = false; - this.toolStripButtonInject.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonInject.Image"))); - this.toolStripButtonInject.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonInject.Name = "toolStripButtonInject"; - this.toolStripButtonInject.Size = new System.Drawing.Size(40, 22); - this.toolStripButtonInject.Text = "Inject"; - this.toolStripButtonInject.Click += new System.EventHandler(this.toolStripButtonInject_Click); + this.buttonInjectPacket.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonInjectPacket.Enabled = false; + this.buttonInjectPacket.Location = new System.Drawing.Point(536, 429); + this.buttonInjectPacket.Name = "buttonInjectPacket"; + this.buttonInjectPacket.Size = new System.Drawing.Size(75, 23); + this.buttonInjectPacket.TabIndex = 1; + this.buttonInjectPacket.Text = "Inject"; + this.buttonInjectPacket.UseVisualStyleBackColor = true; + this.buttonInjectPacket.Click += new System.EventHandler(this.buttonInjectPacket_Click); // // richTextBoxInject // @@ -1324,22 +1422,13 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.richTextBoxInject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.richTextBoxInject.DetectUrls = false; - this.richTextBoxInject.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.richTextBoxInject.Location = new System.Drawing.Point(6, 6); this.richTextBoxInject.Name = "richTextBoxInject"; - this.richTextBoxInject.Size = new System.Drawing.Size(605, 396); + this.richTextBoxInject.Size = new System.Drawing.Size(605, 417); this.richTextBoxInject.TabIndex = 0; this.richTextBoxInject.Text = ""; this.richTextBoxInject.TextChanged += new System.EventHandler(this.richTextBoxInject_TextChanged); // - // selectToolStripMenuItem1 - // - this.selectToolStripMenuItem1.DropDown = this.contextMenuStripSelect; - this.selectToolStripMenuItem1.Name = "selectToolStripMenuItem1"; - this.selectToolStripMenuItem1.Size = new System.Drawing.Size(137, 22); - this.selectToolStripMenuItem1.Text = "Select"; - // // markToolStripMenuItem1 // this.markToolStripMenuItem1.DropDown = this.contextMenuStripMark; @@ -1364,7 +1453,7 @@ this.toolStripFileMenu, this.EditToolStripButton, this.toolStripDropDownButton4}); - this.toolStripMenu.Location = new System.Drawing.Point(3, 25); + this.toolStripMenu.Location = new System.Drawing.Point(3, 0); this.toolStripMenu.Name = "toolStripMenu"; this.toolStripMenu.Size = new System.Drawing.Size(108, 25); this.toolStripMenu.TabIndex = 2; @@ -1591,8 +1680,6 @@ // toolStripDropDownButton4 // this.toolStripDropDownButton4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.documentationToolStripMenuItem, - this.toolStripSeparator13, this.aboutToolStripMenuItem}); this.toolStripDropDownButton4.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripDropDownButton4.Name = "toolStripDropDownButton4"; @@ -1600,22 +1687,10 @@ this.toolStripDropDownButton4.Size = new System.Drawing.Size(36, 22); this.toolStripDropDownButton4.Text = "&Help"; // - // documentationToolStripMenuItem - // - this.documentationToolStripMenuItem.Name = "documentationToolStripMenuItem"; - this.documentationToolStripMenuItem.Size = new System.Drawing.Size(157, 22); - this.documentationToolStripMenuItem.Text = "Documentation"; - this.documentationToolStripMenuItem.Click += new System.EventHandler(this.documentationToolStripMenuItem_Click); - // - // toolStripSeparator13 - // - this.toolStripSeparator13.Name = "toolStripSeparator13"; - this.toolStripSeparator13.Size = new System.Drawing.Size(154, 6); - // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22); this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutWinGridProxyToolStripMenuItem_Click); // @@ -1628,7 +1703,6 @@ // // timer1 // - this.timer1.Interval = 250; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // toolStripDropDownButton1 @@ -1938,64 +2012,30 @@ this.autoColorizeToolStripMenuItem.Name = "autoColorizeToolStripMenuItem"; this.autoColorizeToolStripMenuItem.Size = new System.Drawing.Size(121, 22); this.autoColorizeToolStripMenuItem.Text = "Auto Colorize"; + this.autoColorizeToolStripMenuItem.Click += new System.EventHandler(this.autoColorizeToolStripMenuItem_Click); // // toolStripContainer1 // // - // toolStripContainer1.BottomToolStripPanel - // - this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.statusStrip1); - // // toolStripContainer1.ContentPanel // this.toolStripContainer1.ContentPanel.AutoScroll = true; this.toolStripContainer1.ContentPanel.Controls.Add(this.panelMainWindow); - this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(1111, 442); + this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(1111, 494); this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.toolStripContainer1.LeftToolStripPanelVisible = false; this.toolStripContainer1.Location = new System.Drawing.Point(0, 0); this.toolStripContainer1.Name = "toolStripContainer1"; this.toolStripContainer1.RightToolStripPanelVisible = false; - this.toolStripContainer1.Size = new System.Drawing.Size(1111, 514); + this.toolStripContainer1.Size = new System.Drawing.Size(1111, 519); this.toolStripContainer1.TabIndex = 6; this.toolStripContainer1.Text = "toolStripContainer1"; // // toolStripContainer1.TopToolStripPanel // - this.toolStripContainer1.TopToolStripPanel.BackColor = System.Drawing.SystemColors.Control; - this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStripQuickLaunch); this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStripMenu); this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStripLogin); // - // statusStrip1 - // - this.statusStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripLowerStatusLabel, - this.toolStripStatusLabel2}); - this.statusStrip1.Location = new System.Drawing.Point(0, 0); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.statusStrip1.Size = new System.Drawing.Size(1111, 22); - this.statusStrip1.SizingGrip = false; - this.statusStrip1.TabIndex = 0; - // - // toolStripLowerStatusLabel - // - this.toolStripLowerStatusLabel.Name = "toolStripLowerStatusLabel"; - this.toolStripLowerStatusLabel.Size = new System.Drawing.Size(0, 17); - // - // toolStripStatusLabel2 - // - this.toolStripStatusLabel2.BorderStyle = System.Windows.Forms.Border3DStyle.Sunken; - this.toolStripStatusLabel2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripStatusLabel2.Enabled = false; - this.toolStripStatusLabel2.Name = "toolStripStatusLabel2"; - this.toolStripStatusLabel2.Size = new System.Drawing.Size(1096, 17); - this.toolStripStatusLabel2.Spring = true; - this.toolStripStatusLabel2.Text = "WinGridProxy v0.8.0"; - this.toolStripStatusLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // toolStripLogin // this.toolStripLogin.Dock = System.Windows.Forms.DockStyle.None; @@ -2008,9 +2048,9 @@ this.comboBoxLoginURL, this.buttonStartProxy}); this.toolStripLogin.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; - this.toolStripLogin.Location = new System.Drawing.Point(111, 25); + this.toolStripLogin.Location = new System.Drawing.Point(111, 0); this.toolStripLogin.Name = "toolStripLogin"; - this.toolStripLogin.Size = new System.Drawing.Size(726, 25); + this.toolStripLogin.Size = new System.Drawing.Size(751, 25); this.toolStripLogin.TabIndex = 3; // // toolStripLabel1 @@ -2045,13 +2085,18 @@ // // comboBoxLoginURL // + this.comboBoxLoginURL.Items.AddRange(new object[] { + "https://login.agni.lindenlab.com/cgi-bin/login.cgi", + "https://login.aditi.lindenlab.com/cgi-bin/login.cgi", + "http://127.0.0.1:8002", + "http://osgrid.org:8002"}); this.comboBoxLoginURL.Name = "comboBoxLoginURL"; - this.comboBoxLoginURL.Size = new System.Drawing.Size(275, 25); - this.comboBoxLoginURL.Leave += new System.EventHandler(this.comboBoxLoginURL_Leave); + this.comboBoxLoginURL.Size = new System.Drawing.Size(300, 25); + this.comboBoxLoginURL.Text = "https://login.agni.lindenlab.com/cgi-bin/login.cgi"; // // buttonStartProxy // - this.buttonStartProxy.BackColor = System.Drawing.Color.LawnGreen; + this.buttonStartProxy.BackColor = System.Drawing.Color.LightGreen; this.buttonStartProxy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.buttonStartProxy.ImageTransparentColor = System.Drawing.Color.Magenta; this.buttonStartProxy.Name = "buttonStartProxy"; @@ -2059,181 +2104,23 @@ this.buttonStartProxy.Text = "Start Proxy"; this.buttonStartProxy.Click += new System.EventHandler(this.buttonStartProxy_Click); // - // toolStripQuickLaunch - // - this.toolStripQuickLaunch.BackColor = System.Drawing.SystemColors.Control; - this.toolStripQuickLaunch.Dock = System.Windows.Forms.DockStyle.None; - this.toolStripQuickLaunch.Enabled = false; - this.toolStripQuickLaunch.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripComboBox1, - this.buttonLaunchViewer}); - this.toolStripQuickLaunch.Location = new System.Drawing.Point(3, 0); - this.toolStripQuickLaunch.Name = "toolStripQuickLaunch"; - this.toolStripQuickLaunch.Size = new System.Drawing.Size(164, 25); - this.toolStripQuickLaunch.TabIndex = 4; - // - // toolStripComboBox1 - // - this.toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.toolStripComboBox1.Name = "toolStripComboBox1"; - this.toolStripComboBox1.Size = new System.Drawing.Size(100, 25); - // - // buttonLaunchViewer - // - this.buttonLaunchViewer.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.buttonLaunchViewer.Image = ((System.Drawing.Image)(resources.GetObject("buttonLaunchViewer.Image"))); - this.buttonLaunchViewer.ImageTransparentColor = System.Drawing.Color.Magenta; - this.buttonLaunchViewer.Name = "buttonLaunchViewer"; - this.buttonLaunchViewer.Size = new System.Drawing.Size(50, 22); - this.buttonLaunchViewer.Text = "Launch"; - this.buttonLaunchViewer.Click += new System.EventHandler(this.toolStripButtonLaunchViewer_Click); - // // saveFileDialog3 // this.saveFileDialog3.DefaultExt = "packet"; this.saveFileDialog3.Filter = "Packets|*.packet|All Files|*.*"; this.saveFileDialog3.Title = "Export Binary Data to File"; // - // timerCleanupCache + // timerSessionQueue // - this.timerCleanupCache.Enabled = true; - this.timerCleanupCache.Interval = 30000; - this.timerCleanupCache.Tick += new System.EventHandler(this.timerExpireCache_Tick); - // - // listViewSessions - // - this.listViewSessions.Activation = System.Windows.Forms.ItemActivation.OneClick; - this.listViewSessions.AllowColumnReorder = true; - this.listViewSessions.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.listViewSessions.CheckBoxes = true; - this.listViewSessions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeaderCounter, - this.columnHeaderProtocol, - this.columnHeaderType, - this.columnHeaderSize, - this.columnHeaderUrl, - this.columnHeaderContentType}); - this.listViewSessions.ContextMenuStrip = this.contextMenuStripSessions; - this.listViewSessions.Dock = System.Windows.Forms.DockStyle.Fill; - this.listViewSessions.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.listViewSessions.FullRowSelect = true; - this.listViewSessions.GridLines = true; - this.listViewSessions.Location = new System.Drawing.Point(0, 0); - this.listViewSessions.Name = "listViewSessions"; - this.listViewSessions.ShowItemToolTips = true; - this.listViewSessions.Size = new System.Drawing.Size(479, 442); - this.listViewSessions.SmallImageList = this.imageList1; - this.listViewSessions.TabIndex = 0; - this.listViewSessions.UseCompatibleStateImageBehavior = false; - this.listViewSessions.View = System.Windows.Forms.View.Details; - this.listViewSessions.VirtualMode = true; - this.listViewSessions.Scrolling += new System.EventHandler(this.listViewSessions_Scrolling); - this.listViewSessions.VirtualItemsSelectionRangeChanged += new System.Windows.Forms.ListViewVirtualItemsSelectionRangeChangedEventHandler(this.listViewSessions_VirtualItemsSelectionRangeChanged); - this.listViewSessions.SelectedIndexChanged += new System.EventHandler(this.listViewSessions_SelectedIndexChanged); - this.listViewSessions.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewSessions_ColumnClick); - this.listViewSessions.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.listViewSessions_RetrieveVirtualItem); - this.listViewSessions.CacheVirtualItems += new System.Windows.Forms.CacheVirtualItemsEventHandler(this.listViewSessions_CacheVirtualItems); - // - // columnHeaderCounter - // - this.columnHeaderCounter.Text = "#"; - this.columnHeaderCounter.Width = 50; - // - // columnHeaderProtocol - // - this.columnHeaderProtocol.Text = "Protocol"; - // - // columnHeaderType - // - this.columnHeaderType.Text = "Name"; - this.columnHeaderType.Width = 151; - // - // columnHeaderSize - // - this.columnHeaderSize.Text = "Bytes"; - this.columnHeaderSize.Width = 42; - // - // columnHeaderUrl - // - this.columnHeaderUrl.Text = "Host"; - this.columnHeaderUrl.Width = 150; - // - // columnHeaderContentType - // - this.columnHeaderContentType.Text = "Content Type"; - this.columnHeaderContentType.Width = 250; - // - // listViewPacketFilters - // - this.listViewPacketFilters.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.listViewPacketFilters.CheckBoxes = true; - this.listViewPacketFilters.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeaderPacketName}); - this.listViewPacketFilters.Dock = System.Windows.Forms.DockStyle.Fill; - this.listViewPacketFilters.FullRowSelect = true; - this.listViewPacketFilters.GridLines = true; - listViewGroup1.Header = "Login"; - listViewGroup1.Name = "Login"; - listViewGroup2.Header = "Packets"; - listViewGroup2.Name = "Packets"; - this.listViewPacketFilters.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup1, - listViewGroup2}); - this.listViewPacketFilters.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - this.listViewPacketFilters.Location = new System.Drawing.Point(3, 17); - this.listViewPacketFilters.MultiSelect = false; - this.listViewPacketFilters.Name = "listViewPacketFilters"; - this.listViewPacketFilters.Size = new System.Drawing.Size(291, 324); - this.listViewPacketFilters.Sorting = System.Windows.Forms.SortOrder.Ascending; - this.listViewPacketFilters.TabIndex = 0; - this.listViewPacketFilters.UseCompatibleStateImageBehavior = false; - this.listViewPacketFilters.View = System.Windows.Forms.View.Details; - this.listViewPacketFilters.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listViewPacketFilters_ItemChecked); - this.listViewPacketFilters.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewFilterSorter_ColumnClick); - // - // columnHeaderPacketName - // - this.columnHeaderPacketName.Text = "Name"; - this.columnHeaderPacketName.Width = 287; - // - // listViewMessageFilters - // - this.listViewMessageFilters.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.listViewMessageFilters.CheckBoxes = true; - this.listViewMessageFilters.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeaderName}); - this.listViewMessageFilters.Dock = System.Windows.Forms.DockStyle.Fill; - this.listViewMessageFilters.FullRowSelect = true; - this.listViewMessageFilters.GridLines = true; - listViewGroup3.Header = "Capabilities"; - listViewGroup3.Name = "Capabilities"; - listViewGroup4.Header = "EventQueue Messages"; - listViewGroup4.Name = "EventQueueMessages"; - this.listViewMessageFilters.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup3, - listViewGroup4}); - this.listViewMessageFilters.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - this.listViewMessageFilters.Location = new System.Drawing.Point(3, 17); - this.listViewMessageFilters.MultiSelect = false; - this.listViewMessageFilters.Name = "listViewMessageFilters"; - this.listViewMessageFilters.Size = new System.Drawing.Size(293, 321); - this.listViewMessageFilters.Sorting = System.Windows.Forms.SortOrder.Ascending; - this.listViewMessageFilters.TabIndex = 1; - this.listViewMessageFilters.UseCompatibleStateImageBehavior = false; - this.listViewMessageFilters.View = System.Windows.Forms.View.Details; - this.listViewMessageFilters.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listViewMessageFilters_ItemChecked); - this.listViewMessageFilters.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewFilterSorter_ColumnClick); - // - // columnHeaderName - // - this.columnHeaderName.Text = "Name"; - this.columnHeaderName.Width = 289; + this.timerSessionQueue.Enabled = true; + this.timerSessionQueue.Interval = 250; + this.timerSessionQueue.Tick += new System.EventHandler(this.timerSessionQueue_Tick); // // FormWinGridProxy // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1111, 514); + this.ClientSize = new System.Drawing.Size(1111, 519); this.Controls.Add(this.toolStripContainer1); this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "FormWinGridProxy"; @@ -2243,7 +2130,6 @@ this.splitContainerSessionsTabs.Panel1.ResumeLayout(false); this.splitContainerSessionsTabs.Panel2.ResumeLayout(false); this.splitContainerSessionsTabs.ResumeLayout(false); - this.panelActionProgress.ResumeLayout(false); this.contextMenuStripSessions.ResumeLayout(false); this.contextMenuStripRemove.ResumeLayout(false); this.contextMenuStripSelect.ResumeLayout(false); @@ -2257,6 +2143,8 @@ this.groupBox1.PerformLayout(); this.tabPageFilters.ResumeLayout(false); this.tabPageFilters.PerformLayout(); + this.toolStripFilters.ResumeLayout(false); + this.toolStripFilters.PerformLayout(); this.splitContainerFilters.Panel1.ResumeLayout(false); this.splitContainerFilters.Panel1.PerformLayout(); this.splitContainerFilters.Panel2.ResumeLayout(false); @@ -2264,8 +2152,6 @@ this.splitContainerFilters.ResumeLayout(false); this.grpUDPFilters.ResumeLayout(false); this.grpCapsFilters.ResumeLayout(false); - this.toolStripFilters.ResumeLayout(false); - this.toolStripFilters.PerformLayout(); this.tabPageInspect.ResumeLayout(false); this.splitContainerInspectorTab.Panel1.ResumeLayout(false); this.splitContainerInspectorTab.Panel2.ResumeLayout(false); @@ -2285,26 +2171,17 @@ this.tabPageHexViewResponse.ResumeLayout(false); this.tabPageHexViewResponse.PerformLayout(); this.tabPageInject.ResumeLayout(false); - this.tabPageInject.PerformLayout(); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); this.toolStripMenu.ResumeLayout(false); this.toolStripMenu.PerformLayout(); this.contextMenuStripCopy.ResumeLayout(false); this.contextMenuStripFilterOptions.ResumeLayout(false); - this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false); - this.toolStripContainer1.BottomToolStripPanel.PerformLayout(); this.toolStripContainer1.ContentPanel.ResumeLayout(false); this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false); this.toolStripContainer1.TopToolStripPanel.PerformLayout(); this.toolStripContainer1.ResumeLayout(false); this.toolStripContainer1.PerformLayout(); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); this.toolStripLogin.ResumeLayout(false); this.toolStripLogin.PerformLayout(); - this.toolStripQuickLaunch.ResumeLayout(false); - this.toolStripQuickLaunch.PerformLayout(); this.ResumeLayout(false); } @@ -2344,6 +2221,7 @@ private System.Windows.Forms.TabPage tabPageHexViewResponse; private Be.Windows.Forms.HexBox hexBoxResponse; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.Button buttonInjectPacket; private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label8; @@ -2501,19 +2379,8 @@ private System.Windows.Forms.Button buttonExportRawHex; private System.Windows.Forms.Button buttonSaveRequestHex; private System.Windows.Forms.SaveFileDialog saveFileDialog3; - private System.Windows.Forms.Panel panelActionProgress; - private System.Windows.Forms.ProgressBar progressBar1; - private System.Windows.Forms.Timer timerCleanupCache; - private System.Windows.Forms.ToolStrip toolStripQuickLaunch; - private System.Windows.Forms.ToolStripComboBox toolStripComboBox1; - private System.Windows.Forms.ToolStripButton buttonLaunchViewer; - private System.Windows.Forms.ToolStripMenuItem documentationToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; - private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ToolStripButton toolStripButtonInject; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2; - private System.Windows.Forms.ToolStripStatusLabel toolStripLowerStatusLabel; + private System.Windows.Forms.ToolStripMenuItem autoscrollToolStripMenuItem; + private System.Windows.Forms.Timer timerSessionQueue; } } diff --git a/Programs/WinGridProxy/FormWinGridProxy.cs b/Programs/WinGridProxy/FormWinGridProxy.cs index 5dc0f193..7a23ba88 100644 --- a/Programs/WinGridProxy/FormWinGridProxy.cs +++ b/Programs/WinGridProxy/FormWinGridProxy.cs @@ -76,17 +76,9 @@ namespace WinGridProxy private int PacketsOutCounter; private int PacketsOutBytes; + private List QueuedSessions; private bool monoRuntime; - // Sessions & Sessions ListView related - private List m_SessionViewItems; - private Dictionary m_SessionViewCache = new Dictionary(); - private SortOrder m_ListViewSortOrder = SortOrder.None; - // disable listview virtual items counter being updated - // if we're scrolling the listview to get around a flicker issue - // due to an item selected going out of view - private bool m_AllowUpdate = true; - private const string PROTO_CAPABILITIES = "Cap"; private const string PROTO_EVENTMESSAGE = "Event"; private const string PROTO_PACKETSTRING = "UDP"; @@ -98,19 +90,10 @@ namespace WinGridProxy private readonly Color Color_Cap = Color.Honeydew; private readonly Color Color_Event = Color.AliceBlue; - // some UI customization - private Dictionary m_InstalledViewers = new Dictionary(); - private List m_DefaultGridLoginServers; - - // a reference to the last selected session item - private Session m_CurrentSession; - public FormWinGridProxy() - { + { InitializeComponent(); - m_SessionViewItems = new List(); - Logger.Log("WinGridProxy ready", Helpers.LogLevel.Info); if (FireEventAppender.Instance != null) @@ -118,9 +101,7 @@ namespace WinGridProxy FireEventAppender.Instance.MessageLoggedEvent += new MessageLoggedEventHandler(Instance_MessageLoggedEvent); } - - - // Attempt to work around some mono inefficiencies + // Attempt to work around some mono bugs monoRuntime = Type.GetType("Mono.Runtime") != null; // Officially supported way of detecting mono if (monoRuntime) { @@ -133,7 +114,12 @@ namespace WinGridProxy richTextBoxRawResponse.Font = fixedFont; } - InitializeInterfaceDefaults(); + QueuedSessions = new List(); + + // populate the listen box with the known IP Addresses of this host + IPHostEntry iphostentry = Dns.GetHostByName(Dns.GetHostName()); + foreach (IPAddress address in iphostentry.AddressList) + comboBoxListenAddress.Items.Add(address.ToString()); ProxyManager.OnPacketLog += ProxyManager_OnPacketLog; ProxyManager.OnMessageLog += ProxyManager_OnMessageLog; @@ -142,96 +128,7 @@ namespace WinGridProxy ProxyManager.OnEventMessageLog += ProxyManager_OnEventMessageLog; } - #region GUI Initialization - private void InitializeInterfaceDefaults() - { - // populate the listen box with the known IP Addresses of this host - IPHostEntry iphostentry = Dns.GetHostByName(Dns.GetHostName()); - foreach (IPAddress address in iphostentry.AddressList) - comboBoxListenAddress.Items.Add(address.ToString()); - - // Initialize login server combo box: - // * If gridservers.ini exists, read it and use values from that file - // * If gridservers.ini does not exist or is blank, use some pre-defined defaults - m_DefaultGridLoginServers = new List(); - string[] gridServers; - if (File.Exists("gridservers.ini")) - { - gridServers = File.ReadAllLines("gridservers.ini"); - for (int i = 0; i < gridServers.Length; i++) - { - if (String.IsNullOrEmpty(gridServers[i]) || !gridServers[i].Trim().StartsWith("http")) - continue; - m_DefaultGridLoginServers.Add(gridServers[i]); - } - } - string[] loginServers = {"https://login.agni.lindenlab.com/cgi-bin/login.cgi", - "https://login.aditi.lindenlab.com/cgi-bin/login.cgi", - "http://127.0.0.1:12043", - "http://127.0.0.1:8002", - "http://osgrid.org:8002"}; - - if (m_DefaultGridLoginServers.Count <= 0) - m_DefaultGridLoginServers.AddRange(loginServers); - - comboBoxLoginURL.Items.AddRange(m_DefaultGridLoginServers.ToArray()); - comboBoxLoginURL.Text = comboBoxLoginURL.Items[0].ToString(); - - // Find installed viewers for launch toolbar if running under windows - string[] viewerDistKeys = { "Linden Research, Inc.", "Open Metaverse Foundation" }; - Microsoft.Win32.RegistryKey viewerKeyRoot = null; - if (!monoRuntime) - { - viewerKeyRoot = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"Software\Wow6432Node"); - if (viewerKeyRoot == null) - { - viewerKeyRoot = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"Software"); - } - } - - if (viewerKeyRoot != null) - { - foreach (string key in viewerDistKeys) - { - Microsoft.Win32.RegistryKey viewerKey = viewerKeyRoot.OpenSubKey(key); - if (viewerKey != null) - { - string[] installed = viewerKey.GetSubKeyNames(); - foreach (string viewer in installed) - { - if (!m_InstalledViewers.ContainsKey(viewer)) - { - Microsoft.Win32.RegistryKey me = viewerKey.OpenSubKey(viewer); - if (me != null) - { - string dir = me.GetValue("").ToString(); // the install directory - string exe = me.GetValue("Exe").ToString(); // the executable name - string ver = me.GetValue("Version").ToString(); // the viewer version - - if (!String.IsNullOrEmpty(dir) && !String.IsNullOrEmpty(exe) && !String.IsNullOrEmpty(ver) && File.Exists(Path.Combine(dir, exe))) - { - toolStripComboBox1.Items.Add(viewer + " " + ver); - m_InstalledViewers.Add(viewer + " " + ver, Path.Combine(dir, exe)); - } - } - } - } - } - } - } - - if (toolStripComboBox1.Items.Count > 0) - { - toolStripComboBox1.Text = toolStripComboBox1.Items[0].ToString(); - } - else - { - toolStripQuickLaunch.Visible = false; - } - } - #endregion - - #region Event Handlers for Messages/Packets arriving via GridProxy + #region Event Handlers for Messages/Packets /// /// Adds a new EventQueue message to the Message Filters listview. @@ -327,7 +224,7 @@ namespace WinGridProxy sessionEntry.Tag = sessionLogin; sessionEntry.ImageIndex = (int)sessionLogin.Direction; - m_SessionViewItems.Add(sessionLogin); + AddSession(sessionEntry); } } } @@ -351,8 +248,11 @@ namespace WinGridProxy SessionPacket sessionPacket = new SessionPacket(packet, direction, endpoint, PacketDecoder.InterpretOptions(packet.Header) + " Seq: " + packet.Header.Sequence.ToString() + " Freq:" + packet.Header.Frequency.ToString()); - m_SessionViewItems.Add(sessionPacket); + ListViewItem sessionItem = new ListViewItem(new string[] { PacketCounter.ToString(), sessionPacket.Protocol, sessionPacket.Name, sessionPacket.Length.ToString(), sessionPacket.Host, sessionPacket.ContentType }); + sessionItem.Tag = sessionPacket; + sessionItem.ImageIndex = (int)sessionPacket.Direction; + AddSession(sessionItem); } /// @@ -405,7 +305,7 @@ namespace WinGridProxy if (found.Group.Header.Equals("Capabilities")) { capsSession = new SessionCaps(req.RawRequest, req.RawResponse, req.RequestHeaders, - req.ResponseHeaders, direction, req.Info.URI, req.Info.CapType, proto); + req.ResponseHeaders, direction, req.Info.URI, req.Info.CapType, proto, req.FullUri); } else { @@ -420,7 +320,7 @@ namespace WinGridProxy session.BackColor = found.BackColor; - m_SessionViewItems.Add(capsSession); + AddSession(session); } else { @@ -452,28 +352,6 @@ namespace WinGridProxy return null; } - private void UpdateVirtualListSize(int newSize) - { - if (listViewSessions.VirtualListSize != newSize && listViewSessions.InvokeRequired) - { - this.BeginInvoke((MethodInvoker)(() => UpdateVirtualListSize(newSize))); - } - else - { - //if(listViewSessions.VirtualListSize != newSize) - //{ - listViewSessions.VirtualListSize = newSize; - //} - } - } - - private void ClearCache() - { - lock (m_SessionViewCache) - { - m_SessionViewCache.Clear(); - } - } private static string FormatBytes(long bytes) { @@ -506,7 +384,7 @@ namespace WinGridProxy proxy.Start(); - toolStripQuickLaunch.Enabled = loadFilterSelectionsToolStripMenuItem.Enabled = saveFilterSelectionsToolStripMenuItem.Enabled = true; + loadFilterSelectionsToolStripMenuItem.Enabled = saveFilterSelectionsToolStripMenuItem.Enabled = true; // enable any gui elements toolStripSplitButton1.Enabled = @@ -518,7 +396,7 @@ namespace WinGridProxy } else if (buttonStartProxy.Text.StartsWith("Stop") && m_ProxyRunning.Equals(true)) { - toolStripQuickLaunch.Enabled = loadFilterSelectionsToolStripMenuItem.Enabled = saveFilterSelectionsToolStripMenuItem.Enabled = false; + loadFilterSelectionsToolStripMenuItem.Enabled = saveFilterSelectionsToolStripMenuItem.Enabled = false; // stop the proxy proxy.Stop(); toolStripMenuItemPlugins.Enabled = grpUDPFilters.Enabled = grpCapsFilters.Enabled = m_ProxyRunning = false; @@ -539,6 +417,47 @@ namespace WinGridProxy } } + private void listViewSessions_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) + { + + if (e.IsSelected && listViewSessions.SelectedItems.Count == 1) + { + tabControlMain.SelectTab("tabPageInspect"); + + object tag = e.Item.Tag; + + if (tag is Session) + { + Session session = (Session)tag; + + treeViewXmlResponse.Nodes.Clear(); + treeViewXMLRequest.Nodes.Clear(); + + Be.Windows.Forms.DynamicByteProvider responseBytes = new Be.Windows.Forms.DynamicByteProvider(session.ToBytes(Direction.Incoming)); + richTextBoxDecodedResponse.Text = session.ToPrettyString(Direction.Incoming); + richTextBoxRawResponse.Text = session.ToRawString(Direction.Incoming); + richTextBoxNotationResponse.Text = session.ToStringNotation(Direction.Incoming); + hexBoxResponse.ByteProvider = responseBytes; + updateTreeView(session.ToXml(Direction.Incoming), treeViewXmlResponse); + + Be.Windows.Forms.DynamicByteProvider requestBytes = new Be.Windows.Forms.DynamicByteProvider(session.ToBytes(Direction.Outgoing)); + richTextBoxDecodedRequest.Text = session.ToPrettyString(Direction.Outgoing); + richTextBoxRawRequest.Text = session.ToRawString(Direction.Outgoing); + richTextBoxNotationRequest.Text = session.ToStringNotation(Direction.Outgoing); + hexBoxRequest.ByteProvider = requestBytes; + updateTreeView(session.ToXml(Direction.Outgoing), treeViewXMLRequest); + + RequestPosition_Changed(this, EventArgs.Empty); + ReplyPosition_Changed(this, EventArgs.Empty); + } + else + { + richTextBoxDecodedResponse.Text = "Unknown data object encountered: " + tag.GetType().ToString(); + } + + } + } + private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (m_ProxyRunning) @@ -551,125 +470,54 @@ namespace WinGridProxy // select all items in session list private void sessionSelectAll_Click(object sender, EventArgs e) { - lock (m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - m_SessionViewItems.ForEach((session) => session.Selected = true); + item.Selected = true; } - - ClearCache(); - listViewSessions.Invalidate(); } // unselect all items in session list private void sessionSelectNone_Click(object sender, EventArgs e) { - lock (m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - m_SessionViewItems.ForEach((session) => session.Selected = false); + item.Selected = false; } - - ClearCache(); - listViewSessions.Invalidate(); } // invert selection private void sessionInvertSelection_Click(object sender, EventArgs e) { - lock (m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - m_SessionViewItems.ForEach((session) => session.Selected = !session.Selected); + item.Selected = !item.Selected; } - - ClearCache(); - listViewSessions.Invalidate(); } // remove all sessions private void sessionRemoveAll_Click(object sender, EventArgs e) { - lock (m_SessionViewItems) - { - m_SessionViewItems.Clear(); - } - - ClearCache(); - listViewSessions.VirtualListSize = 0; - listViewSessions.Invalidate(); + listViewSessions.Items.Clear(); } // remove sessions that are currently selected private void sessionRemoveSelected_Click(object sender, EventArgs e) { - - // first we'll check for any highlighted items - if (listViewSessions.SelectedIndices.Count > 0) + foreach (ListViewItem item in listViewSessions.Items) { - for (int i = 0; i < listViewSessions.SelectedIndices.Count; i++) - { - int index = listViewSessions.SelectedIndices[i]; - lock (m_SessionViewItems) - { - m_SessionViewItems.RemoveAt(index); - } - } + if (item.Selected) + listViewSessions.Items.Remove(item); } - - // now we'll check for items that have their selected bool set - bool hasSelected = false; - - m_SessionViewItems.ForEach(delegate(Session action) - { - if (action.Selected) - { - hasSelected = true; - return; - } - }); - - if (hasSelected) - { - progressBar1.Step = 1; - progressBar1.Maximum = m_SessionViewItems.Count; - progressBar1.Value = 0; - panelActionProgress.Visible = true; - - lock (m_SessionViewItems) - { - m_SessionViewItems.RemoveAll(delegate(Session sess) - { - progressBar1.PerformStep(); - return sess.Selected; - }); - } - } - - ClearCache(); - panelActionProgress.Visible = false; - listViewSessions.VirtualListSize = m_SessionViewItems.Count; - listViewSessions.SelectedIndices.Clear(); - listViewSessions.Invalidate(); } // remove sessions that are not currently selected private void sessionRemoveUnselected_Click(object sender, EventArgs e) { - progressBar1.Step = m_SessionViewItems.Count / 100; - progressBar1.Value = 0; - panelActionProgress.Visible = true; - - lock (m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - for (int i = 0; i < m_SessionViewItems.Count; i++) - { - progressBar1.PerformStep(); - if (!m_SessionViewItems[i].Selected) - m_SessionViewItems.RemoveAt(i);//.Remove(m_SessionViewItems[i]); - } + if (!item.Selected) + listViewSessions.Items.Remove(item); } - - ClearCache(); - listViewSessions.Invalidate(); - panelActionProgress.Visible = false; } // Colorize selected sessions @@ -677,30 +525,22 @@ namespace WinGridProxy { ToolStripMenuItem menu = (ToolStripMenuItem)sender; - lock (m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - for (int i = 0; i < m_SessionViewItems.Count; i++) - { - if (m_SessionViewItems[i].Selected) - m_SessionViewItems[i].BackColor = Color.FromName(menu.Text); - } + if (item.Selected) + item.BackColor = Color.FromName(menu.Text); } - sessionSelectNone_Click(sender, e); } // Unmark selected sessions private void sessionUnmarkSelected_Click(object sender, EventArgs e) { - lock (m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - for (int i = 0; i < m_SessionViewItems.Count; i++) - { - if (m_SessionViewItems[i].Selected) - m_SessionViewItems[i].BackColor = Color.White; - } + if (item.Selected) + item.BackColor = Color.White; } - sessionSelectNone_Click(sender, e); } @@ -736,18 +576,11 @@ namespace WinGridProxy // select all specified sessions by packet name private void sessionSelectAllPacketType_Click(object sender, EventArgs e) { - lock (m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - for (int i = 0; i < m_SessionViewItems.Count; i++) - { - Session item = m_SessionViewItems[i]; - if (item.Name.Equals(toolStripMenuItemSelectPacketName.Tag) && !item.Selected) - item.Selected = true; - } + if (item.SubItems[2].Text.Equals(toolStripMenuItemSelectPacketName.Tag) && !item.Selected) + item.Selected = true; } - - ClearCache(); - listViewSessions.Invalidate(); } // stop capturing selected filters @@ -774,16 +607,19 @@ namespace WinGridProxy /// /// Setup the context menu prior to it being displayed with specific entries for filtering packets/messages /// + /// + /// private void contextMenuStripSessions_Opening(object sender, CancelEventArgs e) { - if (listViewSessions.FocusedItem != null) + if (listViewSessions.SelectedItems.Count == 1) { - string strPacketOrMessage = (listViewSessions.FocusedItem.SubItems[1].Text.Equals(PROTO_PACKETSTRING)) ? "Packets" : "Messages"; + ListViewItem item = listViewSessions.SelectedItems[0]; + string strPacketOrMessage = (item.SubItems[1].Text.Equals(PROTO_PACKETSTRING)) ? "Packets" : "Messages"; - enableDisableFilterByNameToolStripMenuItem.Text = String.Format("Capture {0} {1}", listViewSessions.FocusedItem.SubItems[2].Text, strPacketOrMessage); - toolStripMenuItemSelectPacketName.Tag = enableDisableFilterByNameToolStripMenuItem.Tag = listViewSessions.FocusedItem.SubItems[2].Text; + enableDisableFilterByNameToolStripMenuItem.Text = String.Format("Capture {0} {1}", item.SubItems[2].Text, strPacketOrMessage); + toolStripMenuItemSelectPacketName.Tag = enableDisableFilterByNameToolStripMenuItem.Tag = item.SubItems[2].Text; - toolStripMenuItemSelectPacketName.Text = String.Format("All {0} {1}", listViewSessions.FocusedItem.SubItems[2].Text, strPacketOrMessage); + toolStripMenuItemSelectPacketName.Text = String.Format("All {0} {1}", item.SubItems[2].Text, strPacketOrMessage); enableDisableFilterByNameToolStripMenuItem.Visible = toolStripSeparatorSelectPacketProto.Visible = @@ -818,7 +654,6 @@ namespace WinGridProxy if (listViewSessions.Items.Count > 0) { - toolStripMenuItemRemoveAll.Visible = markToolStripMenuItem2.Enabled = findToolStripMenuItem1.Enabled = toolStripMenuSessionsRemove.Enabled = @@ -826,7 +661,6 @@ namespace WinGridProxy } else { - toolStripMenuItemRemoveAll.Visible = markToolStripMenuItem2.Enabled = findToolStripMenuItem1.Enabled = toolStripMenuSessionsRemove.Enabled = @@ -836,7 +670,7 @@ namespace WinGridProxy private void findSessions_Click(object sender, EventArgs e) { - FilterOptions opts = new FilterOptions((listViewSessions.SelectedIndices.Count > 0)); + FilterOptions opts = new FilterOptions((listViewSessions.SelectedItems.Count > 0)); FormSessionSearch search = new FormSessionSearch(ref opts); search.ShowDialog(); @@ -851,6 +685,17 @@ namespace WinGridProxy } } + // Enable Inject button if box contains text + private void richTextBoxInject_TextChanged(object sender, EventArgs e) + { + buttonInjectPacket.Enabled = (richTextBoxInject.TextLength > 0); + } + + private void buttonInjectPacket_Click(object sender, EventArgs e) + { + proxy.InjectPacket(richTextBoxInject.Text, true); + } + private void saveFilterSelectionsToolStripMenuItem_Click(object sender, EventArgs e) { if (saveFileDialog2.ShowDialog() == DialogResult.OK) @@ -903,7 +748,6 @@ namespace WinGridProxy item.Checked = checkBoxCheckAllMessages.Checked; } } - #endregion /// /// Start/Stop the statistics gathering timer @@ -925,13 +769,47 @@ namespace WinGridProxy { OSDMap map = new OSDMap(1); OSDArray sessionArray = new OSDArray(); - - foreach (Session item in m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - OSDMap session = new OSDMap(); - session["type"] = OSD.FromString(item.GetType().Name); - session["tag"] = OSD.FromBinary(item.Serialize()); - sessionArray.Add(session); + if (item.Tag is Session) + { + Session data = null; + if (item.Tag is SessionCaps) + { + data = (SessionCaps)item.Tag; + } + else if (item.Tag is SessionEvent) + { + data = (SessionEvent)item.Tag; + } + else if (item.Tag is SessionLogin) + { + data = (SessionLogin)item.Tag; + } + else if (item.Tag is SessionPacket) + { + data = (SessionPacket)item.Tag; + } + else + { + Console.WriteLine("Not a valid session type?"); + continue; + } + //Type t = item.Tag.GetType(); + + //Session data = (SessionCaps)item.Tag; + OSDMap session = new OSDMap(); + //session["name"] = OSD.FromString(item.Name); + //session["image_index"] = OSD.FromInteger(item.ImageIndex); + session["id"] = OSD.FromString(item.SubItems[0].Text); + //session["protocol"] = OSD.FromString(item.SubItems[1].Text); + //session["packet"] = OSD.FromString(item.SubItems[2].Text); + //session["size"] = OSD.FromString(item.SubItems[3].Text); + //session["host"] = OSD.FromString(item.SubItems[4].Text); + session["type"] = OSD.FromString(data.GetType().ToString()); + session["tag"] = OSD.FromBinary(data.Serialize()); + sessionArray.Add(session); + } } map["sessions"] = sessionArray; @@ -947,131 +825,38 @@ namespace WinGridProxy } } - private void SetProgressStep(int step) - { - if (progressBar1.InvokeRequired) - { - progressBar1.Invoke(new MethodInvoker(delegate() - { - SetProgressStep(step); - })); - } - else - { - //progressBar1.Step = step; - progressBar1.Value += step; - } - } - - private void SetProgressVisible(bool visible) - { - if (panelActionProgress.InvokeRequired) - { - panelActionProgress.BeginInvoke(new MethodInvoker(delegate() - { - SetProgressVisible(visible); - })); - } - else - { - panelActionProgress.Visible = visible; - } - } - private void loadSessionArchiveToolStripMenuItem_Click(object sender, EventArgs e) { - if (openFileDialog1.ShowDialog() == DialogResult.OK) { - FileInfo fi = new FileInfo(openFileDialog1.FileName); - progressBar1.Maximum = (int)fi.Length; - progressBar1.Value = 0; + OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(File.ReadAllText(openFileDialog1.FileName)); - // toss this job into a thread so the UI remains responsive for large files - System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(Object obj) - { - lock (m_FileIOLockerObject) - { - SetProgressVisible(true); - StringBuilder fileContents = new StringBuilder((int)fi.Length); - using (StreamReader sr = fi.OpenText()) - { - String input; - while ((input = sr.ReadLine()) != null) - { - fileContents.AppendLine(input); - SetProgressStep(input.Length); - } - input = null; - } - - OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(fileContents.ToString()); - - // Give the GC a little push - fileContents = null; - GC.Collect(0); - GC.WaitForPendingFinalizers(); - - // turn the map into a list - OSDMapToSessions(map); - SetProgressVisible(false); - } - })); - } - } - - private void OSDMapToSessions(OSDMap map) - { - if (!map.ContainsKey("sessions")) - return; - - if (listViewSessions.InvokeRequired) - listViewSessions.BeginInvoke((MethodInvoker)(() => OSDMapToSessions(map))); - else - { OSDArray sessionsArray = (OSDArray)map["sessions"]; - progressBar1.Maximum = sessionsArray.Count; - progressBar1.Value = 0; - progressBar1.Step = 1; - - panelActionProgress.Visible = true; - - listViewSessions.VirtualListSize = 0; - m_SessionViewItems.Clear(); - - ClearCache(); - + listViewSessions.Items.Clear(); + listViewSessions.BeginUpdate(); for (int i = 0; i < sessionsArray.Count; i++) { OSDMap session = (OSDMap)sessionsArray[i]; - - Session importedSession = (Session)m_CurrentAssembly.CreateInstance("WinGridProxy." + session["type"].AsString()); - if (importedSession == null) - { - // System.Diagnostics.Debug.Assert(importedSession != null, session["type"].AsString() + ); - } - - importedSession.Deserialize(session["tag"].AsBinary()); - m_SessionViewItems.Add(importedSession); - progressBar1.PerformStep(); + Session importedSession = (Session)m_CurrentAssembly.CreateInstance(session["type"].AsString()); + importedSession.Deserialize(session["tag"].AsBinary()); + + ListViewItem addedItem = new ListViewItem(new string[] { + session["id"].AsString(), + importedSession.Protocol, + importedSession.Name, + importedSession.Length.ToString(), + importedSession.Host, + importedSession.ContentType}); + AddSession(addedItem); + //addedItem.ImageIndex = session["image_index"].AsInteger(); + addedItem.ImageIndex = (int)importedSession.Direction; + addedItem.BackColor = Color.GhostWhite; // give imported items a different color + addedItem.Tag = importedSession; } - listViewSessions.VirtualListSize = m_SessionViewItems.Count; - - listViewSessions.Invalidate(); - - // resize columns to fit whats currently on screen - listViewSessions.Columns[0].Width = - listViewSessions.Columns[1].Width = - listViewSessions.Columns[2].Width = - listViewSessions.Columns[3].Width = - listViewSessions.Columns[5].Width = -2; - - panelActionProgress.Visible = false; - - map = null; + listViewSessions.EndUpdate(); } } @@ -1094,14 +879,9 @@ namespace WinGridProxy { // TODO: warn if client is connected! - if (timer1 != null) - timer1.Dispose(); - - if (timerCleanupCache != null) - timerCleanupCache.Dispose(); - this.Close(); } + #endregion GUI Event Handlers #region Helpers @@ -1136,77 +916,73 @@ namespace WinGridProxy Store.SaveSessionOnExit = saveOptionsOnExitToolStripMenuItem.Checked; Store.AutoCheckNewCaps = autoAddNewDiscoveredMessagesToolStripMenuItem.Checked; - lock (m_FileIOLockerObject) - { - Store.SerializeToFile(fileName); - } + Store.SerializeToFile(fileName); } private void RestoreSavedSettings(string fileName) { // load saved settings from OSD Formatted file - lock (m_FileIOLockerObject) + + if (Store.DeserializeFromFile(fileName)) { - if (!Store.DeserializeFromFile(fileName)) - return; + enableStatisticsToolStripMenuItem.Checked = Store.StatisticsEnabled; + saveOptionsOnExitToolStripMenuItem.Checked = Store.SaveSessionOnExit; + autoAddNewDiscoveredMessagesToolStripMenuItem.Checked = Store.AutoCheckNewCaps; + + // Update message filter listview + listViewMessageFilters.BeginUpdate(); + foreach (KeyValuePair kvp in Store.MessageSessions) + { + ListViewItem foundMessage = FindListViewItem(listViewPacketFilters, kvp.Key, false); + if (foundMessage == null) + { + ListViewItem addedItem = listViewMessageFilters.Items.Add( + new ListViewItem(kvp.Key, listViewMessageFilters.Groups[kvp.Value.Group])); + addedItem.Name = kvp.Key; + addedItem.Checked = kvp.Value.Checked; + addedItem.SubItems.Add(kvp.Value.Type); + //addedItem.Group = listViewMessageFilters.Groups[kvp.Value.Group]; + + addedItem.BackColor = (kvp.Value.Type.Equals(PROTO_CAPABILITIES)) ? Color_Cap : Color_Event; + } + else + { + foundMessage.Checked = kvp.Value.Checked; + } + if (kvp.Value.Type.Equals(PROTO_CAPABILITIES)) + { + proxy.AddCapsDelegate(kvp.Key, kvp.Value.Checked); + } + } + listViewMessageFilters.EndUpdate(); + + // updateTreeView packet filter listview + listViewPacketFilters.BeginUpdate(); + foreach (KeyValuePair kvp in Store.PacketSessions) + { + ListViewItem foundPacket = FindListViewItem(listViewPacketFilters, kvp.Key, false); + if (foundPacket == null) + { + ListViewItem addedItem = listViewPacketFilters.Items.Add( + new ListViewItem(kvp.Key, listViewPacketFilters.Groups[kvp.Value.Group])); + + addedItem.Name = kvp.Key; + addedItem.Checked = kvp.Value.Checked; + addedItem.SubItems.Add(kvp.Value.Type); + + addedItem.BackColor = (kvp.Value.Type.Equals(PROTO_AUTHENTICATE)) ? Color_Login : Color_Packet; + } + else + { + foundPacket.Checked = kvp.Value.Checked; + } + if (kvp.Value.Type.Equals(PROTO_PACKETSTRING)) + { + proxy.AddUDPDelegate(PacketTypeFromName(kvp.Key), kvp.Value.Checked); + } + } + listViewPacketFilters.EndUpdate(); } - - enableStatisticsToolStripMenuItem.Checked = Store.StatisticsEnabled; - saveOptionsOnExitToolStripMenuItem.Checked = Store.SaveSessionOnExit; - autoAddNewDiscoveredMessagesToolStripMenuItem.Checked = Store.AutoCheckNewCaps; - - // Update message filter listview - listViewMessageFilters.BeginUpdate(); - foreach (KeyValuePair kvp in Store.MessageSessions) - { - ListViewItem foundMessage = FindListViewItem(listViewPacketFilters, kvp.Key, false); - if (foundMessage == null) - { - ListViewItem addedItem = listViewMessageFilters.Items.Add( - new ListViewItem(kvp.Key, listViewMessageFilters.Groups[kvp.Value.Group])); - addedItem.Name = kvp.Key; - addedItem.Checked = kvp.Value.Checked; - addedItem.SubItems.Add(kvp.Value.Type); - - addedItem.BackColor = (kvp.Value.Type.Equals(PROTO_CAPABILITIES)) ? Color_Cap : Color_Event; - } - else - { - foundMessage.Checked = kvp.Value.Checked; - } - if (kvp.Value.Type.Equals(PROTO_CAPABILITIES)) - { - proxy.AddCapsDelegate(kvp.Key, kvp.Value.Checked); - } - } - listViewMessageFilters.EndUpdate(); - - // updateTreeView packet filter listview - listViewPacketFilters.BeginUpdate(); - foreach (KeyValuePair kvp in Store.PacketSessions) - { - ListViewItem foundPacket = FindListViewItem(listViewPacketFilters, kvp.Key, false); - if (foundPacket == null) - { - ListViewItem addedItem = listViewPacketFilters.Items.Add( - new ListViewItem(kvp.Key, listViewPacketFilters.Groups[kvp.Value.Group])); - - addedItem.Name = kvp.Key; - addedItem.Checked = kvp.Value.Checked; - addedItem.SubItems.Add(kvp.Value.Type); - - addedItem.BackColor = (kvp.Value.Type.Equals(PROTO_AUTHENTICATE)) ? Color_Login : Color_Packet; - } - else - { - foundPacket.Checked = kvp.Value.Checked; - } - if (kvp.Value.Type.Equals(PROTO_PACKETSTRING)) - { - proxy.AddUDPDelegate(PacketTypeFromName(kvp.Key), kvp.Value.Checked); - } - } - listViewPacketFilters.EndUpdate(); } private void InitProxyFilters() @@ -1268,51 +1044,40 @@ namespace WinGridProxy else { int resultCount = 0; - progressBar1.Step = 1;// m_SessionViewItems.Count / 100 / 100; - progressBar1.Maximum = m_SessionViewItems.Count; - progressBar1.Value = 0; - panelActionProgress.Visible = true; - lock (m_SessionViewItems) + foreach (ListViewItem item in listViewSessions.Items) { - for (int i = 0; i < m_SessionViewItems.Count; i++) + if (opts.UnMarkPrevious) + item.BackColor = Color.White; + + if (opts.SearchSelected && !item.Selected) { - Session session = m_SessionViewItems[i]; + continue; + } - if (opts.UnMarkPrevious) - session.BackColor = Color.White; - - if (opts.SearchSelected && !session.Selected) - continue; - - if ( + if ( (opts.MatchCase - && (session.Name.Contains(opts.SearchText) - || session.ToPrettyString(session.Direction).Contains(opts.SearchText)) + && (item.SubItems[2].Text.Contains(opts.SearchText) + /*|| TagToString(item.Tag, item.SubItems[2].Text).Contains(opts.SearchText)*/) ) // no case matching - || ((session.Name.ToLower().Contains(opts.SearchText.ToLower()) - || session.ToPrettyString(session.Direction).ToLower().Contains(opts.SearchText.ToLower()) + || ((item.SubItems[2].Text.ToLower().Contains(opts.SearchText.ToLower()) + /*|| TagToString(item.Tag, item.SubItems[2].Text).ToLower().Contains(opts.SearchText.ToLower())*/ )) ) - { - if (opts.MarkMatches) - session.BackColor = opts.HighlightMatchColor; + { + resultCount++; - if (opts.SelectResults) - session.Selected = true; - else - session.Selected = false; + if (opts.MarkMatches) + item.BackColor = opts.HighlightMatchColor; - resultCount++; - } - progressBar1.PerformStep(); + if (opts.SelectResults) + item.Selected = true; + else + item.Selected = false; } } - ClearCache(); - listViewSessions.Invalidate(); - panelActionProgress.Visible = false; - toolStripLowerStatusLabel.Text = String.Format("Searched {0} session{2} and found {1} matche{2}", m_SessionViewItems.Count, resultCount, - (resultCount != 1) ? "s" : ""); + + //toolStripMainLabel.Text = String.Format("Search found {0} Matches", resultCount); } } @@ -1322,10 +1087,10 @@ namespace WinGridProxy private void updateTreeView(string xml, TreeView treeView) { - treeView.BeginUpdate(); try { treeView.Nodes.Clear(); + XmlDocument tmpxmldoc = new XmlDocument(); tmpxmldoc.LoadXml(xml); FillTree(tmpxmldoc.DocumentElement, treeView.Nodes); @@ -1333,11 +1098,7 @@ namespace WinGridProxy } catch (Exception ex) { - Logger.Log("Error during XML conversion", Helpers.LogLevel.Error, ex); - } - finally - { - treeView.EndUpdate(); + Console.WriteLine("Error during xml conversion:" + ex.Message); } } @@ -1399,118 +1160,115 @@ namespace WinGridProxy } else { - label1PacketsOut.Text = String.Format("{0} ({1})", PacketsOutCounter, FormatBytes(PacketsOutBytes)); - labelPacketsIn.Text = String.Format("{0} ({1})", PacketsInCounter, FormatBytes(PacketsInBytes)); - labelPacketsTotal.Text = String.Format("{0} ({1})", PacketsOutCounter + PacketsInCounter, FormatBytes(PacketsOutBytes + PacketsInBytes)); - - labelCapsIn.Text = String.Format("{0} ({1})", CapsInCounter, FormatBytes(CapsInBytes)); - labelCapsOut.Text = String.Format("{0} ({1})", CapsOutCounter, FormatBytes(CapsOutBytes)); - labelCapsTotal.Text = String.Format("{0} ({1})", CapsInCounter + CapsOutCounter, FormatBytes(CapsOutBytes + CapsInBytes)); - - // pause during scroll - if (m_AllowUpdate) - UpdateVirtualListSize(m_SessionViewItems.Count); + label1PacketsOut.Text = String.Format("{0} ({1} bytes)", PacketsOutCounter, PacketsOutBytes); + labelPacketsIn.Text = String.Format("{0} ({1} bytes)", PacketsInCounter, PacketsInBytes); + labelPacketsTotal.Text = String.Format("{0} ({1} bytes)", PacketsOutCounter + PacketsInCounter, PacketsOutBytes + PacketsInBytes); + labelCapsIn.Text = String.Format("{0} ({1} bytes)", CapsInCounter, CapsInBytes); + labelCapsOut.Text = String.Format("{0} ({1} bytes)", CapsOutCounter, CapsOutBytes); + labelCapsTotal.Text = String.Format("{0} ({1} bytes)", CapsInCounter + CapsOutCounter, CapsOutBytes + CapsInBytes); } } - private void timerExpireCache_Tick(object sender, EventArgs e) + private void timerSessionQueue_Tick(object sender, EventArgs e) { - int expired = 0; - lock (m_SessionViewCache) + lock (QueuedSessions) { - int[] keys = new int[m_SessionViewCache.Keys.Count]; - m_SessionViewCache.Keys.CopyTo(keys, 0); - - foreach (int key in keys) + if (QueuedSessions.Count > 0) { - long expires = 0; - if (long.TryParse(m_SessionViewCache[key].Name, out expires)) + listViewSessions.BeginUpdate(); + listViewSessions.Items.AddRange(QueuedSessions.ToArray()); + if (listViewSessions.Items.Count > 0 && autoscrollToolStripMenuItem.Checked) { - if (expires > 0 && expires <= DateTime.UtcNow.ToLocalTime().Ticks) - { - expired++; - m_SessionViewCache.Remove(key); - } + listViewSessions.Items[listViewSessions.Items.Count - 1].EnsureVisible(); } + listViewSessions.EndUpdate(); + QueuedSessions.Clear(); } } } + #endregion private void EditToolStripButton_DropDownOpening(object sender, EventArgs e) { - lock (m_SessionViewItems) + if (listViewSessions.Items.Count > 0) { - if (m_SessionViewItems.Count > 0) + toolStripMenuSessionsRemove.Enabled = + removeToolStripMenuItem2.Enabled = + selectToolStripMenuItem1.Enabled = + saveSessionArchiveToolStripMenuItem.Enabled = + toolStripMenuItemRemoveAll.Enabled = true; + + if (listViewSessions.SelectedItems.Count < listViewSessions.Items.Count) { - toolStripMenuSessionsRemove.Enabled = - removeToolStripMenuItem2.Enabled = - selectToolStripMenuItem1.Enabled = - saveSessionArchiveToolStripMenuItem.Enabled = - toolStripMenuItemRemoveAll.Enabled = true; - - if (listViewSessions.SelectedIndices.Count > 0) - { - toolStripMenuItemRemoveUnselected.Enabled = - markToolStripMenuItem1.Enabled = - toolStripSeparatorSelectPacketProto.Visible = - toolStripMenuItemSelectPacketName.Visible = - noneToolStripMenuItem2.Enabled = - copyToolStripMenuItem1.Enabled = - toolStripMenuItemRemoveSelected.Enabled = true; - } - else - { - toolStripMenuItemRemoveUnselected.Enabled = - markToolStripMenuItem1.Enabled = - toolStripSeparatorSelectPacketProto.Visible = - toolStripMenuItemSelectPacketName.Visible = - noneToolStripMenuItem2.Enabled = - noneToolStripMenuItem2.Enabled = - copyToolStripMenuItem1.Enabled = - toolStripMenuItemRemoveSelected.Enabled = false; - } - - //if (listViewSessions.SelectedIndices.Count > 0 - // && listViewSessions.SelectedItems.Count != listViewSessions.Items.Count) - //{ - // toolStripMenuItemRemoveUnselected.Enabled = - // invertToolStripMenuItem1.Enabled = - // noneToolStripMenuItem2.Enabled = true; - //} - //else - //{ - // toolStripMenuItemRemoveUnselected.Enabled = - // invertToolStripMenuItem1.Enabled = - // noneToolStripMenuItem2.Enabled = false; - //} - + toolStripMenuItemRemoveUnselected.Enabled = true; } else { - toolStripMenuSessionsRemove.Enabled = + toolStripMenuItemRemoveUnselected.Enabled = false; + } + + if (listViewSessions.SelectedItems.Count > 0) + { + markToolStripMenuItem1.Enabled = toolStripSeparatorSelectPacketProto.Visible = toolStripMenuItemSelectPacketName.Visible = - findToolStripMenuItem.Enabled = - selectToolStripMenuItem1.Enabled = - removeToolStripMenuItem2.Enabled = - toolStripMenuItemRemoveUnselected.Enabled = + noneToolStripMenuItem2.Enabled = copyToolStripMenuItem1.Enabled = - markToolStripMenuItem1.Enabled = - saveSessionArchiveToolStripMenuItem.Enabled = - toolStripMenuItemRemoveAll.Enabled = false; - } - - if (listViewPacketFilters.Items.Count + m_SessionViewItems.Count > 0) - { - saveFilterSelectionsToolStripMenuItem.Enabled = true; + toolStripMenuItemRemoveSelected.Enabled = true; } else { - saveFilterSelectionsToolStripMenuItem.Enabled = false; + markToolStripMenuItem1.Enabled = + toolStripSeparatorSelectPacketProto.Visible = + toolStripMenuItemSelectPacketName.Visible = + noneToolStripMenuItem2.Enabled = + noneToolStripMenuItem2.Enabled = + copyToolStripMenuItem1.Enabled = + toolStripMenuItemRemoveSelected.Enabled = false; } + + if (listViewSessions.SelectedItems.Count > 0 + && listViewSessions.SelectedItems.Count != listViewSessions.Items.Count) + { + toolStripMenuItemRemoveUnselected.Enabled = + invertToolStripMenuItem1.Enabled = + noneToolStripMenuItem2.Enabled = true; + } + else + { + toolStripMenuItemRemoveUnselected.Enabled = + invertToolStripMenuItem1.Enabled = + noneToolStripMenuItem2.Enabled = false; + } + } + else + { + toolStripMenuSessionsRemove.Enabled = + toolStripSeparatorSelectPacketProto.Visible = + // toolStripMenuItemSelectProtocol.Visible = + toolStripMenuItemSelectPacketName.Visible = + findToolStripMenuItem.Enabled = + selectToolStripMenuItem1.Enabled = + removeToolStripMenuItem2.Enabled = + toolStripMenuItemRemoveUnselected.Enabled = + copyToolStripMenuItem1.Enabled = + markToolStripMenuItem1.Enabled = + saveSessionArchiveToolStripMenuItem.Enabled = + toolStripMenuItemRemoveAll.Enabled = false; + } + + if (listViewPacketFilters.Items.Count + listViewSessions.Items.Count > 0) + { + saveFilterSelectionsToolStripMenuItem.Enabled = true; + } + else + { + saveFilterSelectionsToolStripMenuItem.Enabled = false; + } + } private void autoColorizeToolStripMenuItem_Click(object sender, EventArgs e) @@ -1585,6 +1343,14 @@ namespace WinGridProxy } } + private void AddSession(ListViewItem item) + { + lock (QueuedSessions) + { + QueuedSessions.Add(item); + } + } + private void asDecodedTextToolStripMenuItem_Click(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) @@ -1625,13 +1391,41 @@ namespace WinGridProxy { SaveAllSettings("settings.osd"); } + // Column sorter + private void listViewSessions_ColumnClick(object sender, ColumnClickEventArgs e) + { + ListView listView1 = (ListView)sender; + ListViewSorter Sorter = new ListViewSorter(); + listView1.ListViewItemSorter = Sorter; + if (!(listView1.ListViewItemSorter is ListViewSorter)) + return; + + Sorter = (ListViewSorter)listView1.ListViewItemSorter; + + if (Sorter.LastSort == e.Column) + { + if (listView1.Sorting == SortOrder.Ascending) + listView1.Sorting = SortOrder.Descending; + else + listView1.Sorting = SortOrder.Ascending; + } + else + { + listView1.Sorting = SortOrder.Descending; + } + Sorter.ByColumn = e.Column; + + listView1.Sort(); + + listView1.Columns[e.Column].Width = -2;// = listView1.Columns[e.Column].Text + " " + '\u23BC'; + } private void buttonSaveRequestHex_Click(object sender, EventArgs e) { if (hexBoxRequest.ByteProvider != null && hexBoxRequest.ByteProvider.Length > 0) { - saveFileDialog3.FileName = m_CurrentSession.Name; + saveFileDialog3.FileName = listViewSessions.SelectedItems[0].Name; if (saveFileDialog3.ShowDialog() == DialogResult.OK) { byte[] bytes = new byte[hexBoxRequest.ByteProvider.Length]; @@ -1648,7 +1442,7 @@ namespace WinGridProxy { if (hexBoxResponse.ByteProvider != null && hexBoxResponse.ByteProvider.Length > 0) { - saveFileDialog3.FileName = m_CurrentSession.Name; + saveFileDialog3.FileName = listViewSessions.SelectedItems[0].Name; if (saveFileDialog3.ShowDialog() == DialogResult.OK) { byte[] bytes = new byte[hexBoxResponse.ByteProvider.Length]; @@ -1659,245 +1453,76 @@ namespace WinGridProxy File.WriteAllBytes(saveFileDialog3.FileName, bytes); } } - } - - - /// - /// Column Sorting - /// - private void listViewSessions_ColumnClick(object sender, ColumnClickEventArgs e) - { - if (m_ListViewSortOrder == SortOrder.Ascending) - m_ListViewSortOrder = SortOrder.Descending; else - m_ListViewSortOrder = SortOrder.Ascending; - - string name = ((ListView)sender).Columns[e.Column].Text; - lock (m_SessionViewItems) { - switch (name) - { - case "#": - if (m_ListViewSortOrder == SortOrder.Ascending) - m_SessionViewItems.Sort((x, y) => x.TimeStamp.CompareTo(y.TimeStamp)); - else - m_SessionViewItems.Sort((x, y) => y.TimeStamp.CompareTo(x.TimeStamp)); - break; - case "Protocol": - if (m_ListViewSortOrder == SortOrder.Ascending) - m_SessionViewItems.Sort((x, y) => x.Protocol.CompareTo(y.Protocol)); - else - m_SessionViewItems.Sort((x, y) => y.Protocol.CompareTo(x.Protocol)); - break; - case "Name": - if (m_ListViewSortOrder == SortOrder.Ascending) - m_SessionViewItems.Sort((x, y) => x.Name.CompareTo(y.Name)); - else - m_SessionViewItems.Sort((x, y) => y.Name.CompareTo(x.Name)); - break; - case "Bytes": - if (m_ListViewSortOrder == SortOrder.Ascending) - m_SessionViewItems.Sort((x, y) => x.Length.CompareTo(y.Length)); - else - m_SessionViewItems.Sort((x, y) => y.Length.CompareTo(x.Length)); - break; - case "Host": - if (m_ListViewSortOrder == SortOrder.Ascending) - m_SessionViewItems.Sort((x, y) => x.Host.CompareTo(y.Host)); - else - m_SessionViewItems.Sort((x, y) => y.Host.CompareTo(x.Host)); - break; - case "Content Type": - if (m_ListViewSortOrder == SortOrder.Ascending) - m_SessionViewItems.Sort((x, y) => x.ContentType.CompareTo(y.ContentType)); - else - m_SessionViewItems.Sort((x, y) => y.ContentType.CompareTo(x.ContentType)); - break; - } + // no bytes to read! + } + } + } + + public class ListViewSorter : System.Collections.IComparer + { + public int Compare(object o1, object o2) + { + if (!(o1 is ListViewItem)) + return 0; + if (!(o2 is ListViewItem)) + return 0; + + int result; + + ListViewItem lvi1 = (ListViewItem)o2; + ListViewItem lvi2 = (ListViewItem)o1; + + if (lvi1.ListView.Columns[ByColumn].Tag == null + || lvi1.ListView.Columns[ByColumn].Tag == null) + { + return 0; } - ClearCache(); - listViewSessions.Invalidate(); - ((ListView)sender).Columns[e.Column].Width = -2; - } - - /// - /// Retrieve an item for display in the listview, first trying the cache - /// - private void listViewSessions_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) - { - lock (m_SessionViewCache) + if (lvi1.ListView.Columns[ByColumn].Tag.ToString().ToLower().Equals("number")) { - if (m_SessionViewCache.ContainsKey(e.ItemIndex)) - { - e.Item = m_SessionViewCache[e.ItemIndex]; - } + float fl1 = float.Parse(lvi1.SubItems[ByColumn].Text); + float fl2 = float.Parse(lvi2.SubItems[ByColumn].Text); + + if (lvi1.ListView.Sorting == SortOrder.Ascending) + result = fl1.CompareTo(fl2); else - { - e.Item = GenerateListViewItem(e.ItemIndex); - m_SessionViewCache.Add(e.ItemIndex, e.Item); - } + result = fl2.CompareTo(fl1); } - } - - private ListViewItem GenerateListViewItem(int index) - { - Session sessionItem = null; - lock (m_SessionViewItems) + else if (lvi1.ListView.Columns[ByColumn].Tag.ToString().ToLower().Equals("string")) { - sessionItem = m_SessionViewItems[index]; - } + string str1 = lvi1.SubItems[ByColumn].Text; + string str2 = lvi2.SubItems[ByColumn].Text; - ListViewItem sessionViewItem = new ListViewItem(new string[] { sessionItem.TimeStamp.ToLocalTime().ToString("hh:m:s.fff")/*index.ToString()*/, sessionItem.Protocol, sessionItem.Name, - sessionItem.Length.ToString(), sessionItem.Host, sessionItem.ContentType }); - - sessionViewItem.Checked = sessionItem.Selected; - sessionViewItem.Tag = sessionItem; - sessionViewItem.ImageIndex = (int)sessionItem.Direction; - - sessionViewItem.BackColor = sessionItem.BackColor; - - if (sessionItem is SessionPacket && Int32.Parse(sessionViewItem.SubItems[3].Text) > 1400) - { - sessionViewItem.UseItemStyleForSubItems = false; - sessionViewItem.SubItems[3].ForeColor = Color.Red; - } - - // this is used for expiring the cache - sessionViewItem.Name = DateTime.UtcNow.ToLocalTime().AddMinutes(1).Ticks.ToString(); - - return sessionViewItem; - } - - private void listViewSessions_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) - { - int end = (e.EndIndex + 2 <= m_SessionViewItems.Count) ? e.EndIndex + 2 : m_SessionViewItems.Count; - - lock (m_SessionViewItems) - { - for (int i = e.StartIndex; i < end; i++) - { - m_SessionViewItems[i].Selected = e.IsSelected; - } - } - - ClearCache(); - listViewSessions.Invalidate(); - } - - private void listViewSessions_CacheVirtualItems(object sender, CacheVirtualItemsEventArgs e) - { - for (int i = e.StartIndex; i < e.EndIndex + 1; i++) - { - lock (m_SessionViewCache) - { - if (!m_SessionViewCache.ContainsKey(i)) - m_SessionViewCache.Add(i, GenerateListViewItem(i)); - } - } - } - - private void listViewSessions_SelectedIndexChanged(object sender, EventArgs e) - { - if (listViewSessions.SelectedIndices.Count == 1) - { - // update the context menus - contextMenuStripSessions_Opening(sender, null); - - tabControlMain.SelectTab("tabPageInspect"); - - int index = listViewSessions.SelectedIndices[0]; - - object tag = null; - if (m_SessionViewCache.ContainsKey(index)) - tag = m_SessionViewCache[index].Tag; + if (lvi1.ListView.Sorting == SortOrder.Ascending) + result = String.Compare(str1, str2); else - tag = GenerateListViewItem(listViewSessions.SelectedIndices[0]).Tag; //e.Item.Tag; - - if (tag is Session) - { - Session session = (Session)tag; - - this.m_CurrentSession = session; - - treeViewXmlResponse.Nodes.Clear(); - treeViewXMLRequest.Nodes.Clear(); - - Be.Windows.Forms.DynamicByteProvider responseBytes = new Be.Windows.Forms.DynamicByteProvider(session.ToBytes(Direction.Incoming)); - richTextBoxDecodedResponse.Text = session.ToPrettyString(Direction.Incoming); - richTextBoxRawResponse.Text = session.ToRawString(Direction.Incoming); - richTextBoxNotationResponse.Text = session.ToStringNotation(Direction.Incoming); - hexBoxResponse.ByteProvider = responseBytes; - updateTreeView(session.ToXml(Direction.Incoming), treeViewXmlResponse); - - Be.Windows.Forms.DynamicByteProvider requestBytes = new Be.Windows.Forms.DynamicByteProvider(session.ToBytes(Direction.Outgoing)); - richTextBoxDecodedRequest.Text = session.ToPrettyString(Direction.Outgoing); - richTextBoxRawRequest.Text = session.ToRawString(Direction.Outgoing); - richTextBoxNotationRequest.Text = session.ToStringNotation(Direction.Outgoing); - hexBoxRequest.ByteProvider = requestBytes; - updateTreeView(session.ToXml(Direction.Outgoing), treeViewXMLRequest); - - RequestPosition_Changed(this, EventArgs.Empty); - ReplyPosition_Changed(this, EventArgs.Empty); - } - else - { - richTextBoxDecodedResponse.Text = "Unknown data object encountered: " + tag.GetType().ToString(); - } + result = String.Compare(str2, str1); } - } - - private void toolStripButtonLaunchViewer_Click(object sender, EventArgs e) - { - System.Diagnostics.Process.Start(String.Format("{0}", m_InstalledViewers[toolStripComboBox1.Text]), String.Format("--set InstallLanguage en -multiple -loginuri http://{0}:{1}", comboBoxListenAddress.Text, textBoxProxyPort)); - } - - private void listViewSessions_Scrolling(object sender, ScrollingEventArgs e) - { - m_AllowUpdate = !e.Scrolling; - if (!e.Scrolling) + else { - listViewSessions.TopItem.Focused = true; + return 0; } + + LastSort = ByColumn; + + return (result); } - private void comboBoxLoginURL_Leave(object sender, EventArgs e) + + public int ByColumn { - if (!String.IsNullOrEmpty(comboBoxLoginURL.Text)) - { - if (m_DefaultGridLoginServers.Contains(comboBoxLoginURL.Text)) - { - // make the selection the default for next time - m_DefaultGridLoginServers.Remove(comboBoxLoginURL.Text); - } - m_DefaultGridLoginServers.Insert(0, comboBoxLoginURL.Text); - - File.WriteAllLines("gridservers.ini", m_DefaultGridLoginServers.ToArray()); - } + get { return Column; } + set { Column = value; } } + int Column = 0; - private void documentationToolStripMenuItem_Click(object sender, EventArgs e) + public int LastSort { - System.Diagnostics.Process.Start("http://lib.openmetaverse.org/wiki/WinGridProxy"); + get { return LastColumn; } + set { LastColumn = value; } } - - #region Inject Tab - // Enable Inject button if box contains text - private void richTextBoxInject_TextChanged(object sender, EventArgs e) - { - toolStripButtonInject.Enabled = (richTextBoxInject.TextLength > 0); - } - - private void toolStripButtonInject_Click(object sender, EventArgs e) - { - proxy.InjectPacket(richTextBoxInject.Text, true); - } - - #endregion Inject Tab - - private void listViewSessions_SearchForVirtualItem(object sender, SearchForVirtualItemEventArgs e) - { - - } - } + int LastColumn = 0; + } } diff --git a/Programs/WinGridProxy/FormWinGridProxy.resx b/Programs/WinGridProxy/FormWinGridProxy.resx index ea10b438..605e2f55 100644 --- a/Programs/WinGridProxy/FormWinGridProxy.resx +++ b/Programs/WinGridProxy/FormWinGridProxy.resx @@ -118,26 +118,26 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 567, 0 + 555, 17 - 17, 39 + 104, 56 - 1116, 0 + 1104, 17 - 762, 0 + 750, 17 - 321, 0 + 309, 17 AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACe - CQAAAk1TRnQBSQFMAgEBAgEAARQBAAEUAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAgEAAZQBAAGUAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -182,7 +182,7 @@ - 339, 39 + 426, 56 @@ -230,24 +230,6 @@ xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC - - - - 352, 78 - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI - ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9 - HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN - rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K - TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx - oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8 - 7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI - xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX - LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd - KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC @@ -269,7 +251,7 @@ - 939, 0 + 927, 17 @@ -288,7 +270,7 @@ - 234, 0 + 226, 17 @@ -336,54 +318,30 @@ - 470, 39 + 557, 56 - 606, 39 + 693, 56 - 746, 39 + 833, 56 - 882, 39 + 969, 56 - 17, 78 + 17, 95 - 1022, 39 + 1109, 56 - - 236, 78 - - - 236, 58 - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI - ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9 - HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN - rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K - TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx - oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8 - 7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI - xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX - LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd - KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC - - - 210, 39 + 297, 56 - 431, 0 + 419, 17 - - 147, 0 - - - 25 + + 17, 56 \ No newline at end of file diff --git a/Programs/WinGridProxy/ListViewNoFlicker.cs b/Programs/WinGridProxy/ListViewNoFlicker.cs index 3aa5a498..41265095 100644 --- a/Programs/WinGridProxy/ListViewNoFlicker.cs +++ b/Programs/WinGridProxy/ListViewNoFlicker.cs @@ -27,75 +27,32 @@ using System; using System.Collections.Generic; using System.Text; -using System.ComponentModel; using System.Windows.Forms; namespace WinGridProxy { - internal class ListViewNoFlicker : ListView + class ListViewNoFlicker : ListView { public ListViewNoFlicker() - { - this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); - this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); + { + + //Activate double buffering + this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); //Enable the OnNotifyMessage event so we get a chance to filter out // Windows messages before they get to the form's WndProc - this.SetStyle(ControlStyles.EnableNotifyMessage, true); + this.SetStyle(ControlStyles.EnableNotifyMessage, true); } - - protected override void OnNotifyMessage(Message m) - { - //private const UInt32 WM_VSCROLL = 0x0115; - if (m.Msg == 0x0115) - { - if (m.WParam.ToInt32().Equals(8)) - { - // Scrollbar scrolling stopped - OnScrolling(new ScrollingEventArgs(false)); - } - else - { - // Scroll starting - OnScrolling(new ScrollingEventArgs(true)); - } - } - + protected override void OnNotifyMessage(Message m) + { //Filter out the WM_ERASEBKGND message if (m.Msg != 0x14) { base.OnNotifyMessage(m); - } - } - - private EventHandler m_Scrolling; - private void OnScrolling(ScrollingEventArgs e) - { - EventHandler handler = m_Scrolling; - if (handler != null) - handler(this, e); + } } - private readonly object m_ScrollingLock = new object(); - - [Description("Occurs, when the listview scrolling starts and stops")] - public event EventHandler Scrolling - { - add { lock (m_ScrollingLock) { m_Scrolling += value; } } - remove { lock (m_ScrollingLock) { m_Scrolling -= value; } } - } - } - - public class ScrollingEventArgs : EventArgs - { - private bool m_Scrolling; - public bool Scrolling { get { return m_Scrolling; } set { this.m_Scrolling = value; } } - - public ScrollingEventArgs(bool scrolling) - { - this.m_Scrolling = scrolling; - } } public class ListViewItemComparer : IComparer diff --git a/Programs/WinGridProxy/Properties/AssemblyInfo.cs b/Programs/WinGridProxy/Properties/AssemblyInfo.cs index c8b16c0d..e8e8089c 100644 --- a/Programs/WinGridProxy/Properties/AssemblyInfo.cs +++ b/Programs/WinGridProxy/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.8.0.*")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.9.0.*")] +[assembly: AssemblyFileVersion("0.9.0.0")] diff --git a/Programs/WinGridProxy/SessionTypes.cs b/Programs/WinGridProxy/SessionTypes.cs index b05568c8..386d5dec 100644 --- a/Programs/WinGridProxy/SessionTypes.cs +++ b/Programs/WinGridProxy/SessionTypes.cs @@ -172,42 +172,8 @@ namespace WinGridProxy this.Length = packetData.Length; int packetEnd = packetData.Length - 1; - - try - { - bool msg_zer = ((packetData[0] & Helpers.MSG_ZEROCODED) != 0); - bool msg_res = ((packetData[0] & Helpers.MSG_RESENT) != 0); - bool msg_rel = ((packetData[0] & Helpers.MSG_RELIABLE) != 0); - bool msg_ack = ((packetData[0] & Helpers.MSG_APPENDED_ACKS) != 0); - - if ((packetData[0] & Helpers.MSG_ZEROCODED) != 0) - { - packetData[0] = 0x00; - } - - this.Packet = Packet.BuildPacket(packetData, ref packetEnd, null); - - this.Packet.Header.Resent = msg_res; - this.Packet.Header.Reliable = msg_rel; - this.Packet.Header.Zerocoded = msg_zer; - this.Packet.Header.AppendedAcks = msg_ack; - - this.Name = this.Packet.Type.ToString(); - } - catch (IndexOutOfRangeException ex) - { - this.Name = ex.Message; - } - catch (MalformedDataException ex) - { - this.Name = ex.Message; - //throw; - } - catch (NullReferenceException ex) - { - this.Name = ex.Message; - } - + this.Packet = Packet.BuildPacket(packetData, ref packetEnd, null); + this.Name = this.Packet.Type.ToString(); return this; } } @@ -220,11 +186,12 @@ namespace WinGridProxy byte[] ResponseBytes { get; set; } WebHeaderCollection RequestHeaders { get; set; } WebHeaderCollection ResponseHeaders { get; set; } + string FullUri { get; set; } public SessionCaps() : base() { /*this.Protocol = "Caps";*/ } public SessionCaps(byte[] requestBytes, byte[] responseBytes, WebHeaderCollection requestHeaders, WebHeaderCollection responseHeaders, - Direction direction, string uri, string capsKey, String proto) + Direction direction, string uri, string capsKey, String proto, string fullUri) : base() { if (requestBytes != null) @@ -239,6 +206,7 @@ namespace WinGridProxy this.RequestHeaders = requestHeaders; this.ResponseHeaders = responseHeaders; this.Protocol = proto; + this.FullUri = fullUri; this.Name = capsKey; this.Direction = direction; @@ -250,107 +218,122 @@ namespace WinGridProxy public override string ToPrettyString(Direction direction) { - if (direction == Direction.Incoming) + try { - if (this.ResponseBytes != null && this.ResponseBytes.Length > 0) + if (direction == Direction.Incoming) { - IMessage message = null; - OSD osd = OSDParser.Deserialize(this.ResponseBytes); - - OSDMap data = (OSDMap)osd; - - if (data.ContainsKey("body")) - message = OpenMetaverse.Messages.MessageUtils.DecodeEvent(this.Name, (OSDMap)data["body"]); - else - message = OpenMetaverse.Messages.MessageUtils.DecodeEvent(this.Name, data); - - if (message != null) - return PacketDecoder.MessageToString(message, 0); - else - return "No Decoder for " + this.Name + Environment.NewLine + data.ToString() + Environment.NewLine + - "Please report this at http://jira.openmv.org Be sure to include the entire message."; - } - } - else - { - if (this.RequestBytes != null && this.RequestBytes.Length > 0) - { - if (this.RequestBytes[0] == 60) + if (this.ResponseBytes != null && this.ResponseBytes.Length > 0) { - OSD osd = OSDParser.Deserialize(this.RequestBytes); + IMessage message = null; + OSD osd = OSDParser.Deserialize(this.ResponseBytes); + if (osd is OSDMap) { - IMessage message = null; OSDMap data = (OSDMap)osd; if (data.ContainsKey("body")) - message = MessageUtils.DecodeEvent(this.Name, (OSDMap)data["body"]); + message = OpenMetaverse.Messages.MessageUtils.DecodeEvent(this.Name, (OSDMap)data["body"]); else - message = MessageUtils.DecodeEvent(this.Name, data); + message = OpenMetaverse.Messages.MessageUtils.DecodeEvent(this.Name, data); if (message != null) return PacketDecoder.MessageToString(message, 0); else - return "No Decoder for " + this.Name + Environment.NewLine + data.ToString() + Environment.NewLine + - "Please report this at http://jira.openmv.org Be sure to include the entire message."; + return "No Decoder for " + this.Name + Environment.NewLine + + OSDParser.SerializeLLSDNotationFormatted(data) + Environment.NewLine + + "Please report this at http://jira.openmetaverse.org Be sure to include the entire message."; } - else - { - return osd.ToString(); - } - } - else - { - // this means its probably a script or asset using the uploader capability - // so we'll just return the raw bytes as a string - //if (this.RequestBytes[0] == 100) - //{ - return Utils.BytesToString(this.RequestBytes); - //} } } else { - return String.Empty; + if (this.RequestBytes != null && this.RequestBytes.Length > 0) + { + if (this.RequestBytes[0] == 60) + { + OSD osd = OSDParser.Deserialize(this.RequestBytes); + if (osd is OSDMap) + { + IMessage message = null; + OSDMap data = (OSDMap)osd; + + if (data.ContainsKey("body")) + message = MessageUtils.DecodeEvent(this.Name, (OSDMap)data["body"]); + else + message = MessageUtils.DecodeEvent(this.Name, data); + + if (message != null) + return PacketDecoder.MessageToString(message, 0); + else + return "No Decoder for " + this.Name + Environment.NewLine + + OSDParser.SerializeLLSDNotationFormatted(data) + Environment.NewLine + + "Please report this at http://jira.openmetaverse.org Be sure to include the entire message."; + } + else + { + return osd.ToString(); + } + } + else + { + // this means its probably a script or asset using the uploader capability + // so we'll just return the raw bytes as a string + //if (this.RequestBytes[0] == 100) + //{ + return Utils.BytesToString(this.RequestBytes); + //} + } + } + else + { + return String.Empty; + } } } + catch { } return String.Empty; } public override string ToRawString(Direction direction) { - if (direction == Direction.Incoming) + try { - if (this.ResponseBytes != null) + if (direction == Direction.Incoming) { - StringBuilder result = new StringBuilder(); - foreach (String key in ResponseHeaders.Keys) + if (this.ResponseBytes != null) { - result.AppendFormat("{0} {1}" + Environment.NewLine, key, ResponseHeaders[key]); + StringBuilder result = new StringBuilder(); + foreach (String key in ResponseHeaders.Keys) + { + result.AppendFormat("{0} {1}" + Environment.NewLine, key, ResponseHeaders[key]); + } + result.AppendLine(); + result.AppendLine(OpenMetaverse.Utils.BytesToString(this.ResponseBytes)); + return result.ToString(); } - result.AppendLine(); - result.AppendLine(OpenMetaverse.Utils.BytesToString(this.ResponseBytes)); - return result.ToString(); + else + return String.Empty; } else - return String.Empty; - } - else - { - if (this.RequestBytes != null) { - StringBuilder result = new StringBuilder(); - foreach (String key in RequestHeaders.Keys) + if (this.RequestBytes != null) { - result.AppendFormat("{0} {1}" + Environment.NewLine, key, RequestHeaders[key]); + StringBuilder result = new StringBuilder(); + result.AppendFormat("Request URI: {0}{1}", FullUri, Environment.NewLine); + foreach (String key in RequestHeaders.Keys) + { + result.AppendFormat("{0}: {1}" + Environment.NewLine, key, RequestHeaders[key]); + } + result.AppendLine(); + result.AppendLine(OpenMetaverse.Utils.BytesToString(this.RequestBytes)); + return result.ToString(); } - result.AppendLine(); - result.AppendLine(OpenMetaverse.Utils.BytesToString(this.RequestBytes)); - return result.ToString(); + else + return String.Empty; } - else - return String.Empty; } + catch { } + return string.Empty; } public override byte[] ToBytes(Direction direction) @@ -373,41 +356,51 @@ namespace WinGridProxy public override string ToStringNotation(Direction direction) { - if (direction == Direction.Incoming) + try { - if (this.ResponseBytes != null) - return BytesToOsd(this.ResponseBytes); - //return this.ResponseBytes; - else - return base.ToStringNotation(direction); - } - else - { - if (this.RequestBytes != null) + if (direction == Direction.Incoming) { - return BytesToOsd(this.RequestBytes); + if (this.ResponseBytes != null) + return BytesToOsd(this.ResponseBytes); + //return this.ResponseBytes; + else + return base.ToStringNotation(direction); } else - return base.ToStringNotation(direction); + { + if (this.RequestBytes != null) + { + return BytesToOsd(this.RequestBytes); + } + else + return base.ToStringNotation(direction); + } } + catch { } + return string.Empty; } public override string ToXml(Direction direction) { - if (direction == Direction.Incoming) + try { - if (this.ResponseBytes != null) - return BytesToXml(this.ResponseBytes); + if (direction == Direction.Incoming) + { + if (this.ResponseBytes != null) + return BytesToXml(this.ResponseBytes); + else + return base.ToXml(direction); + } else - return base.ToXml(direction); - } - else - { - if (this.RequestBytes != null) - return BytesToXml(this.RequestBytes); - else - return base.ToXml(direction); + { + if (this.RequestBytes != null) + return BytesToXml(this.RequestBytes); + else + return base.ToXml(direction); + } } + catch { } + return string.Empty; } // Sanity check the bytes are infact OSD @@ -416,7 +409,7 @@ namespace WinGridProxy try { OSD osd = OSDParser.Deserialize(bytes); - return osd.ToString(); + return OSDParser.SerializeLLSDNotationFormatted(osd); } catch (LitJson.JsonException) { @@ -441,7 +434,7 @@ namespace WinGridProxy OSDMap map = new OSDMap(5); map["Name"] = OSD.FromString(this.Name); map["Host"] = OSD.FromString(this.Host); - map["RequestBytes"] = OSD.FromBinary(this.RequestBytes); + map["RequestBytes"] = OSD.FromBinary(this.RequestBytes); map["ResponseBytes"] = OSD.FromBinary(this.ResponseBytes); map["Direction"] = OSD.FromInteger((int)this.Direction); map["ContentType"] = OSD.FromString(this.ContentType); @@ -472,10 +465,8 @@ namespace WinGridProxy public override Session Deserialize(byte[] bytes) { - var s = OpenMetaverse.Utils.BytesToString(bytes); - - //OSDMap map = (OSDMap)OSDParser.Deserialize(bytes); OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(OpenMetaverse.Utils.BytesToString(bytes)); + this.Name = map["Name"].AsString(); this.Host = map["Host"].AsString(); this.RequestBytes = map["RequestBytes"].AsBinary(); @@ -559,17 +550,18 @@ namespace WinGridProxy return String.Empty; } } - public override string ToXml(Direction direction) { - if (direction == this.Direction) - { - return this.Data.ToString(); - } - else - { - return base.ToXml(direction); - } + return base.ToXml(direction); + + //if (direction == this.Direction) + //{ + // return this.Data.ToString(); + //} + //else + //{ + // return base.ToXml(direction); + //} } public override byte[] ToBytes(Direction direction)