Commits

Mathias Kluba committed 14c384b

better array handling

  • Participants
  • Parent commits d02f525

Comments (0)

Files changed (2)

FormMain.Designer.cs

             this.helpOnlineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.timerFilter = new System.Windows.Forms.Timer(this.components);
             this.timerTypeFilter = new System.Windows.Forms.Timer(this.components);
+            this.labelObjectDumpAddress = new System.Windows.Forms.Label();
+            this.textBoxObjectDumpAddress = new System.Windows.Forms.TextBox();
             this.tabControlMain.SuspendLayout();
             this.tabPageProcesses.SuspendLayout();
             this.panelSearchProcesses.SuspendLayout();
             // 
             this.splitContainerObjectDumpDetails.Dock = System.Windows.Forms.DockStyle.Fill;
             this.splitContainerObjectDumpDetails.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
-            this.splitContainerObjectDumpDetails.Location = new System.Drawing.Point(0, 134);
+            this.splitContainerObjectDumpDetails.Location = new System.Drawing.Point(0, 158);
             this.splitContainerObjectDumpDetails.Name = "splitContainerObjectDumpDetails";
             this.splitContainerObjectDumpDetails.Orientation = System.Windows.Forms.Orientation.Horizontal;
             // 
             // 
             this.splitContainerObjectDumpDetails.Panel2.Controls.Add(this.listViewFieldArray);
             this.splitContainerObjectDumpDetails.Panel2Collapsed = true;
-            this.splitContainerObjectDumpDetails.Size = new System.Drawing.Size(723, 469);
+            this.splitContainerObjectDumpDetails.Size = new System.Drawing.Size(723, 445);
             this.splitContainerObjectDumpDetails.SplitterDistance = 311;
             this.splitContainerObjectDumpDetails.TabIndex = 7;
             // 
             this.listViewObjectDump.HideSelection = false;
             this.listViewObjectDump.Location = new System.Drawing.Point(0, 0);
             this.listViewObjectDump.Name = "listViewObjectDump";
-            this.listViewObjectDump.Size = new System.Drawing.Size(723, 469);
+            this.listViewObjectDump.Size = new System.Drawing.Size(723, 445);
             this.listViewObjectDump.TabIndex = 4;
             this.listViewObjectDump.UseCompatibleStateImageBehavior = false;
             this.listViewObjectDump.View = System.Windows.Forms.View.Details;
             // 
             this.panelObjectDumpDetails.Controls.Add(this.textBoxObjectDumpToString);
             this.panelObjectDumpDetails.Controls.Add(this.textBoxObjectDumpSize);
+            this.panelObjectDumpDetails.Controls.Add(this.textBoxObjectDumpAddress);
             this.panelObjectDumpDetails.Controls.Add(this.textBoxObjectDumpType);
             this.panelObjectDumpDetails.Controls.Add(this.labelObjectDumpToString);
+            this.panelObjectDumpDetails.Controls.Add(this.labelObjectDumpAddress);
             this.panelObjectDumpDetails.Controls.Add(this.labelObjectDumpTrueSize);
             this.panelObjectDumpDetails.Controls.Add(this.labelObjectDumpTypeName);
             this.panelObjectDumpDetails.Dock = System.Windows.Forms.DockStyle.Top;
             this.panelObjectDumpDetails.Location = new System.Drawing.Point(0, 48);
             this.panelObjectDumpDetails.Name = "panelObjectDumpDetails";
-            this.panelObjectDumpDetails.Size = new System.Drawing.Size(723, 86);
+            this.panelObjectDumpDetails.Size = new System.Drawing.Size(723, 110);
             this.panelObjectDumpDetails.TabIndex = 5;
             // 
             // textBoxObjectDumpToString
             // 
-            this.textBoxObjectDumpToString.Location = new System.Drawing.Point(100, 58);
+            this.textBoxObjectDumpToString.Location = new System.Drawing.Point(102, 84);
             this.textBoxObjectDumpToString.Name = "textBoxObjectDumpToString";
             this.textBoxObjectDumpToString.ReadOnly = true;
             this.textBoxObjectDumpToString.Size = new System.Drawing.Size(428, 20);
             // 
             // textBoxObjectDumpSize
             // 
-            this.textBoxObjectDumpSize.Location = new System.Drawing.Point(100, 32);
+            this.textBoxObjectDumpSize.Location = new System.Drawing.Point(102, 58);
             this.textBoxObjectDumpSize.Name = "textBoxObjectDumpSize";
             this.textBoxObjectDumpSize.ReadOnly = true;
-            this.textBoxObjectDumpSize.Size = new System.Drawing.Size(107, 20);
+            this.textBoxObjectDumpSize.Size = new System.Drawing.Size(180, 20);
             this.textBoxObjectDumpSize.TabIndex = 2;
             // 
             // textBoxObjectDumpType
             // 
-            this.textBoxObjectDumpType.Location = new System.Drawing.Point(100, 6);
+            this.textBoxObjectDumpType.Location = new System.Drawing.Point(102, 32);
             this.textBoxObjectDumpType.Name = "textBoxObjectDumpType";
             this.textBoxObjectDumpType.ReadOnly = true;
             this.textBoxObjectDumpType.Size = new System.Drawing.Size(428, 20);
             // labelObjectDumpToString
             // 
             this.labelObjectDumpToString.AutoSize = true;
-            this.labelObjectDumpToString.Location = new System.Drawing.Point(5, 61);
+            this.labelObjectDumpToString.Location = new System.Drawing.Point(7, 87);
             this.labelObjectDumpToString.Name = "labelObjectDumpToString";
             this.labelObjectDumpToString.Size = new System.Drawing.Size(53, 13);
             this.labelObjectDumpToString.TabIndex = 0;
             // labelObjectDumpTrueSize
             // 
             this.labelObjectDumpTrueSize.AutoSize = true;
-            this.labelObjectDumpTrueSize.Location = new System.Drawing.Point(5, 35);
+            this.labelObjectDumpTrueSize.Location = new System.Drawing.Point(7, 61);
             this.labelObjectDumpTrueSize.Name = "labelObjectDumpTrueSize";
             this.labelObjectDumpTrueSize.Size = new System.Drawing.Size(89, 13);
             this.labelObjectDumpTrueSize.TabIndex = 0;
             // labelObjectDumpTypeName
             // 
             this.labelObjectDumpTypeName.AutoSize = true;
-            this.labelObjectDumpTypeName.Location = new System.Drawing.Point(5, 9);
+            this.labelObjectDumpTypeName.Location = new System.Drawing.Point(7, 35);
             this.labelObjectDumpTypeName.Name = "labelObjectDumpTypeName";
             this.labelObjectDumpTypeName.Size = new System.Drawing.Size(34, 13);
             this.labelObjectDumpTypeName.TabIndex = 0;
             this.timerTypeFilter.Interval = 500;
             this.timerTypeFilter.Tick += new System.EventHandler(this.timerTypeFilter_Tick);
             // 
+            // labelObjectDumpAddress
+            // 
+            this.labelObjectDumpAddress.AutoSize = true;
+            this.labelObjectDumpAddress.Location = new System.Drawing.Point(7, 9);
+            this.labelObjectDumpAddress.Name = "labelObjectDumpAddress";
+            this.labelObjectDumpAddress.Size = new System.Drawing.Size(48, 13);
+            this.labelObjectDumpAddress.TabIndex = 0;
+            this.labelObjectDumpAddress.Text = "Address:";
+            // 
+            // textBoxObjectDumpAddress
+            // 
+            this.textBoxObjectDumpAddress.Location = new System.Drawing.Point(102, 6);
+            this.textBoxObjectDumpAddress.Name = "textBoxObjectDumpAddress";
+            this.textBoxObjectDumpAddress.ReadOnly = true;
+            this.textBoxObjectDumpAddress.Size = new System.Drawing.Size(180, 20);
+            this.textBoxObjectDumpAddress.TabIndex = 1;
+            // 
             // FormMain
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
         private System.Windows.Forms.Panel panelHelpSOSEX;
         private System.Windows.Forms.TableLayoutPanel tableLayoutPanelHELPSOSEX;
         private System.Windows.Forms.PictureBox pictureBoxHelpSOSEX;
+        private System.Windows.Forms.TextBox textBoxObjectDumpAddress;
+        private System.Windows.Forms.Label labelObjectDumpAddress;
     }
 }
 
             button.Font = new Font(button.Font, FontStyle.Bold);
             string address = ((ObjectInfo)button.Tag).Address;
             string index = ((ObjectInfo)button.Tag).Index;
+            string type = ((ObjectInfo) button.Tag).Name;
 
             if (string.IsNullOrEmpty(index))
             {
                 this.textBoxObjectDumpType.Text = instanceInfo.Name;
                 this.textBoxObjectDumpToString.Text = instanceInfo.String;
                 this.textBoxObjectDumpSize.Text = instanceInfo.TrueSize;
+                this.textBoxObjectDumpAddress.Text = instanceInfo.Address;
             }
             else
             {
                 this.textBoxObjectDumpType.Text = instanceInfo.Name;
                 this.textBoxObjectDumpToString.Text = instanceInfo.String;
                 this.textBoxObjectDumpSize.Text = instanceInfo.TrueSize;
+                this.textBoxObjectDumpAddress.Text = instanceInfo.Address;
             }
+
+            if (type.EndsWith("[]") || type.Equals("SZARRAY"))
+            {
+                // the type is an array, display the collection
+                this.splitContainerObjectDumpDetails.Panel2Collapsed = false;
+                this.listViewFieldArray.BeginUpdate();
+                this.listViewFieldArray.Items.Clear();
+                this.listViewFieldArray.Items.AddRange(this.controller.GetArrayInstances(address));
+                this.listViewFieldArray.EndUpdate();
+            }
+            else
+            {
+                this.splitContainerObjectDumpDetails.Panel2Collapsed = true;
+            }
+
             currentInstance = ((ObjectInfo)button.Tag);
         }
 
             {
                 var selected = this.listViewFieldArray.Items[this.listViewFieldArray.SelectedIndices[0]];
 
-                var selectedField = this.listViewObjectDump.Items[this.listViewObjectDump.SelectedIndices[0]];
+                string address;
+                if (textBoxObjectDumpType.Text.EndsWith("[]") || textBoxObjectDumpType.Text.Equals("SZARRAY"))
+                {
+                    address = this.textBoxObjectDumpAddress.Text;
+                }
+                else
+                {
+                    var selectedField = this.listViewObjectDump.Items[this.listViewObjectDump.SelectedIndices[0]];
+                    address = selectedField.SubItems[3].Text;
+                }                
 
                 this.splitContainerObjectDumpDetails.Panel2Collapsed = true;
-                Button newInstance = CreateInstanceButton(selectedField.SubItems[3].Text, selected.SubItems[0].Text);
+                Button newInstance = CreateInstanceButton(address, selected.SubItems[0].Text);
                 this.DisplayInstanceDetails(newInstance);
             }
         }