Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4909 for branches


Ignore:
Timestamp:
11/23/10 15:03:01 (14 years ago)
Author:
epitzer
Message:

Several GUI improvements (#47)

  • add icons and tool tips
  • add support for suspending the operator trace view
  • faster skipping of stack-only operations
  • remove log view and execution time view
Location:
branches/HeuristicLab.DebugEngine
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DebugEngine/DebugEngine.cs

    r4904 r4909  
    162162    }
    163163
    164     public virtual void Step() {
     164    public virtual void Step(bool skipStackOperations) {
    165165      OnStarted();
    166166      lastUpdateTime = DateTime.Now;
     
    168168      timer.Start();
    169169      ProcessNextOperation();
     170      while (skipStackOperations && !(CurrentOperation is IAtomicOperation) && CanContinue)
     171        ProcessNextOperation();
    170172      timer.Stop();
    171173      ExecutionTime += DateTime.Now - lastUpdateTime;
  • branches/HeuristicLab.DebugEngine/DebugEngineView.Designer.cs

    r4904 r4909  
    4747      this.components = new System.ComponentModel.Container();
    4848      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DebugEngineView));
    49       this.label1 = new System.Windows.Forms.Label();
    50       this.executionTimeTextBox = new System.Windows.Forms.TextBox();
    51       this.operationContentView = new OperationContentView();
    52       this.logView = new HeuristicLab.Core.Views.LogView();
    53       this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     49      this.operationContentView = new HeuristicLab.DebugEngine.OperationContentView();
     50      this.executionStackView = new HeuristicLab.DebugEngine.ExecutionStackView();
    5451      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
     52      this.refreshButton = new System.Windows.Forms.Button();
     53      this.skipStackOpsCheckBox = new System.Windows.Forms.CheckBox();
    5554      this.stepButton = new System.Windows.Forms.Button();
    5655      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    57       this.refreshButton = new System.Windows.Forms.Button();
    58       this.skipStackOpsCheckBox = new System.Windows.Forms.CheckBox();
    5956      this.splitContainer3 = new System.Windows.Forms.SplitContainer();
    60       this.executionStackView = new HeuristicLab.DebugEngine.ExecutionStackView();
    61       this.operatorTraceView = new OperatorTraceView();
    62       this.splitContainer1.Panel1.SuspendLayout();
    63       this.splitContainer1.Panel2.SuspendLayout();
    64       this.splitContainer1.SuspendLayout();
     57      this.operatorTraceView = new HeuristicLab.DebugEngine.OperatorTraceView();
    6558      this.splitContainer2.Panel1.SuspendLayout();
    6659      this.splitContainer2.Panel2.SuspendLayout();
    6760      this.splitContainer2.SuspendLayout();
    6861      this.splitContainer3.Panel1.SuspendLayout();
     62      this.splitContainer3.Panel2.SuspendLayout();
    6963      this.splitContainer3.SuspendLayout();
    7064      this.SuspendLayout();
    7165      //
    72       // label1
    73       //
    74       this.label1.AutoSize = true;
    75       this.label1.Location = new System.Drawing.Point(3, 9);
    76       this.label1.Name = "label1";
    77       this.label1.Size = new System.Drawing.Size(83, 13);
    78       this.label1.TabIndex = 0;
    79       this.label1.Text = "Execution Time:";
    80       //
    81       // executionTimeTextBox
    82       //
    83       this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     66      // operationContentView
     67      //
     68      this.operationContentView.Caption = "Operation Content View";
     69      this.operationContentView.Content = null;
     70      this.operationContentView.Dock = System.Windows.Forms.DockStyle.Fill;
     71      this.operationContentView.Location = new System.Drawing.Point(0, 0);
     72      this.operationContentView.Name = "operationContentView";
     73      this.operationContentView.ReadOnly = false;
     74      this.operationContentView.Size = new System.Drawing.Size(484, 538);
     75      this.operationContentView.TabIndex = 0;
     76      //
     77      // executionStackView
     78      //
     79      this.executionStackView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     80                  | System.Windows.Forms.AnchorStyles.Left)
    8481                  | System.Windows.Forms.AnchorStyles.Right)));
    85       this.executionTimeTextBox.Location = new System.Drawing.Point(92, 6);
    86       this.executionTimeTextBox.Name = "executionTimeTextBox";
    87       this.executionTimeTextBox.ReadOnly = true;
    88       this.executionTimeTextBox.Size = new System.Drawing.Size(611, 20);
    89       this.executionTimeTextBox.TabIndex = 1;
    90       //
    91       // logView
    92       //
    93       this.logView.Caption = "Log View";
    94       this.logView.Content = null;
    95       this.logView.Dock = System.Windows.Forms.DockStyle.Fill;
    96       this.logView.Location = new System.Drawing.Point(0, 0);
    97       this.logView.Name = "logView";
    98       this.logView.ReadOnly = false;
    99       this.logView.Size = new System.Drawing.Size(198, 237);
    100       this.logView.TabIndex = 2;
    101       //
    102       // splitContainer1
    103       //
    104       this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
    105       this.splitContainer1.Location = new System.Drawing.Point(0, 0);
    106       this.splitContainer1.Name = "splitContainer1";
    107       this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
    108       //
    109       // splitContainer1.Panel1
    110       //
    111       this.splitContainer1.Panel1.Controls.Add(this.executionStackView);
    112       //
    113       // splitContainer1.Panel2
    114       //
    115       this.splitContainer1.Panel2.Controls.Add(this.logView);
    116       this.splitContainer1.Size = new System.Drawing.Size(198, 502);
    117       this.splitContainer1.SplitterDistance = 261;
    118       this.splitContainer1.TabIndex = 3;
     82      this.executionStackView.Caption = "Execution Stack View";
     83      this.executionStackView.Content = null;
     84      this.executionStackView.Location = new System.Drawing.Point(0, 0);
     85      this.executionStackView.Name = "executionStackView";
     86      this.executionStackView.ReadOnly = false;
     87      this.executionStackView.Size = new System.Drawing.Size(197, 505);
     88      this.executionStackView.TabIndex = 0;
    11989      //
    12090      // splitContainer2
     
    12696      // splitContainer2.Panel1
    12797      //
    128       this.splitContainer2.Panel1.Controls.Add(this.splitContainer1);
     98      this.splitContainer2.Panel1.Controls.Add(this.executionStackView);
     99      this.splitContainer2.Panel1.Controls.Add(this.refreshButton);
     100      this.splitContainer2.Panel1.Controls.Add(this.skipStackOpsCheckBox);
     101      this.splitContainer2.Panel1.Controls.Add(this.stepButton);
    129102      //
    130103      // splitContainer2.Panel2
    131104      //
    132105      this.splitContainer2.Panel2.Controls.Add(this.operationContentView);
    133       this.splitContainer2.Size = new System.Drawing.Size(683, 502);
    134       this.splitContainer2.SplitterDistance = 198;
     106      this.splitContainer2.Size = new System.Drawing.Size(687, 538);
     107      this.splitContainer2.SplitterDistance = 199;
    135108      this.splitContainer2.TabIndex = 0;
    136109      //
     110      // refreshButton
     111      //
     112      this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     113      this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image")));
     114      this.refreshButton.Location = new System.Drawing.Point(3, 511);
     115      this.refreshButton.Name = "refreshButton";
     116      this.refreshButton.Size = new System.Drawing.Size(24, 24);
     117      this.refreshButton.TabIndex = 5;
     118      this.toolTip.SetToolTip(this.refreshButton, "Refresh View");
     119      this.refreshButton.UseVisualStyleBackColor = true;
     120      this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
     121      //
     122      // skipStackOpsCheckBox
     123      //
     124      this.skipStackOpsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     125      this.skipStackOpsCheckBox.AutoSize = true;
     126      this.skipStackOpsCheckBox.Location = new System.Drawing.Point(63, 516);
     127      this.skipStackOpsCheckBox.Name = "skipStackOpsCheckBox";
     128      this.skipStackOpsCheckBox.Size = new System.Drawing.Size(78, 17);
     129      this.skipStackOpsCheckBox.TabIndex = 6;
     130      this.skipStackOpsCheckBox.Text = "Skip Stack";
     131      this.toolTip.SetToolTip(this.skipStackOpsCheckBox, "Automatically step over steps that manipulate only the execution stack");
     132      this.skipStackOpsCheckBox.UseVisualStyleBackColor = true;
     133      //
    137134      // stepButton
    138135      //
    139       this.stepButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     136      this.stepButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    140137      this.stepButton.Image = ((System.Drawing.Image)(resources.GetObject("stepButton.Image")));
    141       this.stepButton.Location = new System.Drawing.Point(815, 3);
     138      this.stepButton.Location = new System.Drawing.Point(33, 511);
    142139      this.stepButton.Name = "stepButton";
    143140      this.stepButton.Size = new System.Drawing.Size(24, 24);
     
    147144      this.stepButton.Click += new System.EventHandler(this.stepButton_Click);
    148145      //
    149       // refreshButton
    150       //
    151       this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    152       this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image")));
    153       this.refreshButton.Location = new System.Drawing.Point(845, 3);
    154       this.refreshButton.Name = "refreshButton";
    155       this.refreshButton.Size = new System.Drawing.Size(24, 24);
    156       this.refreshButton.TabIndex = 5;
    157       this.refreshButton.UseVisualStyleBackColor = true;
    158       this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
    159       //
    160       // skipStackOpsCheckBox
    161       //
    162       this.skipStackOpsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    163       this.skipStackOpsCheckBox.AutoSize = true;
    164       this.skipStackOpsCheckBox.Location = new System.Drawing.Point(709, 8);
    165       this.skipStackOpsCheckBox.Name = "skipStackOpsCheckBox";
    166       this.skipStackOpsCheckBox.Size = new System.Drawing.Size(100, 17);
    167       this.skipStackOpsCheckBox.TabIndex = 6;
    168       this.skipStackOpsCheckBox.Text = "Skip Stack Ops";
    169       this.skipStackOpsCheckBox.UseVisualStyleBackColor = true;
    170       //
    171146      // splitContainer3
    172147      //
     
    174149                  | System.Windows.Forms.AnchorStyles.Left)
    175150                  | System.Windows.Forms.AnchorStyles.Right)));
    176       this.splitContainer3.Location = new System.Drawing.Point(3, 33);
     151      this.splitContainer3.Location = new System.Drawing.Point(0, 0);
    177152      this.splitContainer3.Name = "splitContainer3";
    178153      //
     
    180155      //
    181156      this.splitContainer3.Panel1.Controls.Add(this.splitContainer2);
     157      //
     158      // splitContainer3.Panel2
     159      //
    182160      this.splitContainer3.Panel2.Controls.Add(this.operatorTraceView);
    183       this.splitContainer3.Size = new System.Drawing.Size(866, 502);
    184       this.splitContainer3.SplitterDistance = 683;
     161      this.splitContainer3.Size = new System.Drawing.Size(872, 538);
     162      this.splitContainer3.SplitterDistance = 687;
    185163      this.splitContainer3.TabIndex = 7;
     164      //
     165      // operatorTraceView
     166      //
     167      this.operatorTraceView.Caption = "Operator Trace View";
     168      this.operatorTraceView.Content = null;
    186169      this.operatorTraceView.Dock = System.Windows.Forms.DockStyle.Fill;
    187       //
    188       // executionStackView
    189       //
    190       this.executionStackView.Caption = "Execution Stack View";
    191       this.executionStackView.Content = null;
    192       this.executionStackView.Dock = System.Windows.Forms.DockStyle.Fill;
    193       this.executionStackView.Location = new System.Drawing.Point(0, 0);
    194       this.executionStackView.Name = "executionStackView";
    195       this.executionStackView.ReadOnly = false;
    196       this.executionStackView.Size = new System.Drawing.Size(198, 261);
    197       this.executionStackView.TabIndex = 0;
    198       //
    199       // operationContentView
    200       //
    201       this.operationContentView.Caption = "Operation Content View";
    202       this.operationContentView.Content = null;
    203       this.operationContentView.Dock = System.Windows.Forms.DockStyle.Fill;
    204       this.operationContentView.Location = new System.Drawing.Point(0, 0);
    205       this.operationContentView.Name = "operationContentView";
    206       this.operationContentView.ReadOnly = false;
    207       this.operationContentView.Size = new System.Drawing.Size(481, 502);
    208       this.operationContentView.TabIndex = 0;
     170      this.operatorTraceView.Location = new System.Drawing.Point(0, 0);
     171      this.operatorTraceView.Name = "operatorTraceView";
     172      this.operatorTraceView.ReadOnly = false;
     173      this.operatorTraceView.Size = new System.Drawing.Size(181, 538);
     174      this.operatorTraceView.TabIndex = 0;
    209175      //
    210176      // DebugEngineView
     
    212178      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    213179      this.Controls.Add(this.splitContainer3);
    214       this.Controls.Add(this.skipStackOpsCheckBox);
    215       this.Controls.Add(this.refreshButton);
    216       this.Controls.Add(this.stepButton);
    217       this.Controls.Add(this.executionTimeTextBox);
    218       this.Controls.Add(this.label1);
    219180      this.Name = "DebugEngineView";
    220181      this.Size = new System.Drawing.Size(872, 538);
    221       this.splitContainer1.Panel1.ResumeLayout(false);
    222       this.splitContainer1.Panel2.ResumeLayout(false);
    223       this.splitContainer1.ResumeLayout(false);
    224182      this.splitContainer2.Panel1.ResumeLayout(false);
     183      this.splitContainer2.Panel1.PerformLayout();
    225184      this.splitContainer2.Panel2.ResumeLayout(false);
    226185      this.splitContainer2.ResumeLayout(false);
    227186      this.splitContainer3.Panel1.ResumeLayout(false);
     187      this.splitContainer3.Panel2.ResumeLayout(false);
    228188      this.splitContainer3.ResumeLayout(false);
    229189      this.ResumeLayout(false);
    230       this.PerformLayout();
    231190
    232191    }
     
    234193    #endregion
    235194
    236     private System.Windows.Forms.Label label1;
    237     private System.Windows.Forms.TextBox executionTimeTextBox;
    238     private Core.Views.LogView logView;
    239     private System.Windows.Forms.SplitContainer splitContainer1;
    240195    private System.Windows.Forms.SplitContainer splitContainer2;
    241196    private System.Windows.Forms.Button stepButton;
  • branches/HeuristicLab.DebugEngine/DebugEngineView.cs

    r4904 r4909  
    5858    protected override void DeregisterContentEvents() {
    5959      Content.CurrentOperationChanged -= new EventHandler<OperationChangedEventArgs>(Content_CurrentOperationChanged);
    60       Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);
    6160      Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
    6261      base.DeregisterContentEvents();
     
    6968    protected override void RegisterContentEvents() {
    7069      base.RegisterContentEvents();
    71       Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
    7270      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
    7371      Content.CurrentOperationChanged += new EventHandler<OperationChangedEventArgs>(Content_CurrentOperationChanged);
     
    8179      base.OnContentChanged();
    8280      if (Content == null) {
    83         logView.Content = null;
    84         executionTimeTextBox.Text = "-";
    8581        executionStackView.Content = null;
     82        operatorTraceView.Content = null;
    8683        operationContentView.Content = null;
    8784      } else {
    88         logView.Content = Content.Log;
    89         executionTimeTextBox.Text = Content.ExecutionTime.ToString();
    9085        executionStackView.Content = Content.ExecutionStack;
     86        operatorTraceView.Content = Content.OperatorTrace;
    9187        operationContentView.Content = new OperationContent(Content.CurrentOperation);
    9288      }
     
    9692      base.SetEnabledStateOfControls();
    9793      if (Content == null) {
    98         logView.Enabled = false;
    99         executionTimeTextBox.Enabled = false;
    10094        stepButton.Enabled = false;
     95        refreshButton.Enabled = false;
    10196      } else {
    102         logView.Enabled = true;
    103         executionTimeTextBox.Enabled = true;
    10497        stepButton.Enabled = Content.CanContinue;
     98        refreshButton.Enabled = Content.CurrentAtomicOperation != null;
    10599      }
    106100    }
     
    108102    #endregion
    109103
    110     protected virtual void Content_ExecutionTimeChanged(object sender, EventArgs e) {
    111       if (InvokeRequired)
    112         Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);
    113       else
    114         executionTimeTextBox.Text = Content == null ? "-" : Content.ExecutionTime.ToString();
    115     }
    116 
    117104    void Content_ExecutionStateChanged(object sender, EventArgs e) {
    118       if (InvokeRequired)
     105      if (InvokeRequired) {
    119106        Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);
    120       else {
     107      } else {
    121108        switch (Content.ExecutionState) {
    122109          case ExecutionState.Started:
    123110            executionStackView.SuspendUpdate();
    124             logView.Content = null;
    125             operatorTraceView.Content = null;
     111            operatorTraceView.SuspendUpdate();
    126112            break;
    127113          default:
    128             logView.Content = Content.Log;
    129114            executionStackView.ResumeUpdate();
    130115            operationContentView.Content = new OperationContent(Content.CurrentOperation);
    131             operatorTraceView.Content = Content.OperatorTrace;
     116            operatorTraceView.ResumeUpdate();
    132117            break;
    133118        }
     
    140125        Invoke(new EventHandler<OperationChangedEventArgs>(Content_CurrentOperationChanged), sender, e);
    141126      } else {
     127
    142128      }
    143129    }
    144130
    145131    private void stepButton_Click(object sender, EventArgs e) {
    146       Content.Step();
    147       while (skipStackOpsCheckBox.Checked && !(Content.CurrentOperation is IAtomicOperation) && Content.CanContinue)
    148         Content.Step();
     132      Content.Step(skipStackOpsCheckBox.Checked);
    149133    }
    150134
  • branches/HeuristicLab.DebugEngine/DebugEngineView.resx

    r4904 r4909  
    119119  </resheader>
    120120  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    121   <data name="stepButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    122     <value>
    123         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
    124         YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/gAA
    125         Cv4B5iV4ZgAAARBJREFUOE9j+P//PwM6Tuh5woxNHJsYhmaQIqABMkDMRIwhWA0onPX8f/zkt0rEGILV
    126         gNyZz/4ndN/7HzfhtQYh72A1IGPK0//z9v/+H9Rw8zXQAFt8huAKg/+z9/3637n173+30sv/gQbY4zIE
    127         qwGRXY/+T9n263/J0r//E6b//W+TexanIVgNCGx++L917XuwZuOSL/+lo6/9N45c9t+h6Gw8ukuwGuBR
    128         df9/ydx3cM2KLj3/pX1WBxKdDuxL7/4PbHkGthmieaUXrjSB1QUWeXf+2xRcgWm2wZegsBpgmHUbrFnK
    129         a7krodSI1QCdtBtAZ6/xJaQZJI/VACnvtX7S3iuIylBYDSDGZpgaig0AAOHY1PSKOymCAAAAAElFTkSu
    130         QmCC
    131 </value>
    132   </data>
    133   <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    134     <value>17, 17</value>
    135   </metadata>
    136121  <data name="refreshButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    137122    <value>
    138123        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
    139         YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALBAAA
    140         CwQBG8oqrQAAAmFJREFUOE+dk21IU1EYx3cVVzkhaLCy+UaY0xwlZkYRmiGR7oMEUlAGfRGKvkRFVOQ0
     124        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAgAA
     125        CwIBm8luNgAAAmFJREFUOE+dk21IU1EYx3cVVzkhaLCy+UaY0xwlZkYRmiGR7oMEUlAGfRGKvkRFVOQ0
    141126        DddsVmtbvpQWhCFBSvaCUcRAk0gGm8SGM7JtrU1nzYFvu3P33znDRcLpSxceDvdefr/zv+d5Lidaufjg
    142127        QKKIWwNSUo4Tz4u4RAl5xYsgJIuEcADCYlS8oQKLvvvKdam1n+PcqjUyN5ox7PyIVrMB1U9PoKxThZI7
     
    151136</value>
    152137  </data>
     138  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     139    <value>17, 17</value>
     140  </metadata>
     141  <data name="stepButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     142    <value>
     143        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
     144        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/AAA
     145        CvwBmdu77wAAARBJREFUOE9j+P//PwM6Tuh5woxNHJsYhmaQIqABMkDMRIwhWA0onPX8f/zkt0rEGILV
     146        gNyZz/4ndN/7HzfhtQYh72A1IGPK0//z9v/+H9Rw8zXQAFt8huAKg/+z9/3637n173+30sv/gQbY4zIE
     147        qwGRXY/+T9n263/J0r//E6b//W+TexanIVgNCGx++L917XuwZuOSL/+lo6/9N45c9t+h6Gw8ukuwGuBR
     148        df9/ydx3cM2KLj3/pX1WBxKdDuxL7/4PbHkGthmieaUXrjSB1QUWeXf+2xRcgWm2wZegsBpgmHUbrFnK
     149        a7krodSI1QCdtBtAZ6/xJaQZJI/VACnvtX7S3iuIylBYDSDGZpgaig0AAOHY1PSKOymCAAAAAElFTkSu
     150        QmCC
     151</value>
     152  </data>
    153153</root>
  • branches/HeuristicLab.DebugEngine/ExecutionStackView.Designer.cs

    r4904 r4909  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      this.components = new System.ComponentModel.Container();
    2627      this.treeView = new System.Windows.Forms.TreeView();
    2728      this.groupBox = new System.Windows.Forms.GroupBox();
     29      this.imageList = new System.Windows.Forms.ImageList(this.components);
    2830      this.groupBox.SuspendLayout();
    2931      this.SuspendLayout();
     
    3234      //
    3335      this.treeView.Dock = System.Windows.Forms.DockStyle.Fill;
     36      this.treeView.ImageIndex = 0;
     37      this.treeView.ImageList = this.imageList;
    3438      this.treeView.Location = new System.Drawing.Point(3, 16);
    3539      this.treeView.Name = "treeView";
     40      this.treeView.SelectedImageIndex = 0;
     41      this.treeView.ShowNodeToolTips = true;
    3642      this.treeView.Size = new System.Drawing.Size(303, 261);
    3743      this.treeView.TabIndex = 0;
     
    4854      this.groupBox.TabStop = false;
    4955      this.groupBox.Text = "Execution Stack";
     56      //
     57      // imageList
     58      //
     59      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     60      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
     61      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
    5062      //
    5163      // ExecutionStackView
     
    6577    private System.Windows.Forms.TreeView treeView;
    6678    private System.Windows.Forms.GroupBox groupBox;
     79    private System.Windows.Forms.ImageList imageList;
    6780
    6881  }
  • branches/HeuristicLab.DebugEngine/ExecutionStackView.cs

    r4903 r4909  
    55using System.Windows.Forms;
    66using HeuristicLab.Collections;
     7using HeuristicLab.Common.Resources;
    78using HeuristicLab.Core;
    89using HeuristicLab.MainForm;
     
    5152
    5253    private void UpdateExecutionStack() {
    53       if (!suspended) {
     54      if (suspended) {
     55        groupBox.Text = string.Format("Execution Stack ({0})", CountOperations(Content));
     56      } else {
    5457        treeView.BeginUpdate();
    5558        treeView.Nodes.Clear();
     59        treeView.ImageList.Images.Clear();
     60        treeView.ImageList.Images.Add(VS2008ImageLibrary.Method);
     61        treeView.ImageList.Images.Add(VS2008ImageLibrary.Module);
    5662        int totalNodes = AddStackOperations(treeView.Nodes, ((IEnumerable<IOperation>)Content).Reverse());
    5763        if (treeView.Nodes.Count > 0)
     
    6066        treeView.EndUpdate();
    6167        groupBox.Text = string.Format("Execution Stack ({0})", totalNodes);
    62       } else {
    63         groupBox.Text = string.Format("Execution Stack ({0})", CountOperations(Content));
    6468      }
    6569    }
     
    8185        if (op is IAtomicOperation) {
    8286          IAtomicOperation atom = op as IAtomicOperation;
    83           TreeNode node = nodes.Add(atom.Operator.Name);
     87          TreeNode node = nodes.Add(atom.Operator.Name ?? atom.Operator.ItemName);
    8488          node.Tag = atom;
    85           node.ToolTipText = Utils.TypeName(atom.Operator);
    86           node.ImageKey = "AtomicOperation";
     89          node.ToolTipText = string.Format("{0}{1}{1}{2}",
     90            Utils.TypeName(atom.Operator), Environment.NewLine,
     91            Utils.Wrap(atom.Operator.Description ?? atom.Operator.ItemDescription, 60));
     92          node.ImageIndex = 0;
     93          node.SelectedImageIndex = 0;
    8794          if (atom.Operator.Breakpoint)
    8895            node.ForeColor = Color.Red;
     
    94101          node.Tag = op;
    95102          node.ToolTipText = Utils.TypeName(ops);
    96           node.ImageKey = "OperationCollection";
     103          node.ImageIndex = 1;
     104          node.SelectedImageIndex = 1;
    97105          count += AddStackOperations(node.Nodes, ops);
    98106        }
     
    116124    }
    117125
    118 
    119 
    120126    #region Event Handlers (child controls)
    121127    private void treeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) {
     
    137143    public virtual void ResumeUpdate() {
    138144      suspended = false;
    139       UpdateExecutionStack();
     145      if (Content != null)
     146        UpdateExecutionStack();
    140147    }
    141148    #endregion
  • branches/HeuristicLab.DebugEngine/ExecutionStackView.resx

    r4871 r4909  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>17, 17</value>
     122  </metadata>
    120123</root>
  • branches/HeuristicLab.DebugEngine/HeuristicLab.DebugEngine.csproj

    r4904 r4909  
    102102      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
    103103    </Reference>
     104    <Reference Include="HeuristicLab.Operators-3.3">
     105      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath>
     106    </Reference>
    104107    <Reference Include="HeuristicLab.Persistence-3.3">
    105108      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
     
    166169    <EmbeddedResource Include="OperatorTraceView.resx">
    167170      <DependentUpon>OperatorTraceView.cs</DependentUpon>
     171      <SubType>Designer</SubType>
    168172    </EmbeddedResource>
    169173    <EmbeddedResource Include="Properties\Resources.resx">
  • branches/HeuristicLab.DebugEngine/OperationContentView.Designer.cs

    r4903 r4909  
    3939      this.collectionLabel = new System.Windows.Forms.Label();
    4040      this.timer = new System.Windows.Forms.Timer(this.components);
     41      this.executionContextImageList = new System.Windows.Forms.ImageList(this.components);
     42      this.parametersImageList = new System.Windows.Forms.ImageList(this.components);
     43      this.scopeImageList = new System.Windows.Forms.ImageList(this.components);
     44      this.parameterColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    4145      this.groupBox.SuspendLayout();
    4246      this.splitContainer1.Panel1.SuspendLayout();
     
    117121      //
    118122      this.executionContextTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
     123      this.executionContextTreeView.ImageIndex = 0;
     124      this.executionContextTreeView.ImageList = this.executionContextImageList;
    119125      this.executionContextTreeView.Location = new System.Drawing.Point(3, 16);
    120126      this.executionContextTreeView.Name = "executionContextTreeView";
     127      this.executionContextTreeView.SelectedImageIndex = 0;
     128      this.executionContextTreeView.ShowNodeToolTips = true;
    121129      this.executionContextTreeView.Size = new System.Drawing.Size(236, 161);
    122130      this.executionContextTreeView.TabIndex = 0;
     
    137145      // parameterListView
    138146      //
     147      this.parameterListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     148            this.parameterColumn});
    139149      this.parameterListView.Dock = System.Windows.Forms.DockStyle.Fill;
    140       this.parameterListView.FullRowSelect = true;
     150      this.parameterListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
     151      this.parameterListView.HideSelection = false;
    141152      this.parameterListView.Location = new System.Drawing.Point(3, 16);
    142153      this.parameterListView.Name = "parameterListView";
     154      this.parameterListView.ShowItemToolTips = true;
    143155      this.parameterListView.Size = new System.Drawing.Size(236, 158);
     156      this.parameterListView.SmallImageList = this.parametersImageList;
    144157      this.parameterListView.TabIndex = 0;
    145158      this.parameterListView.UseCompatibleStateImageBehavior = false;
    146       this.parameterListView.View = System.Windows.Forms.View.List;
     159      this.parameterListView.View = System.Windows.Forms.View.Details;
    147160      this.parameterListView.ItemActivate += new System.EventHandler(this.parameterListView_ItemActivate);
    148161      //
     
    161174      //
    162175      this.scopeTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
     176      this.scopeTreeView.ImageIndex = 0;
     177      this.scopeTreeView.ImageList = this.scopeImageList;
    163178      this.scopeTreeView.Location = new System.Drawing.Point(3, 16);
    164179      this.scopeTreeView.Name = "scopeTreeView";
     180      this.scopeTreeView.SelectedImageIndex = 0;
     181      this.scopeTreeView.ShowNodeToolTips = true;
    165182      this.scopeTreeView.Size = new System.Drawing.Size(299, 342);
    166183      this.scopeTreeView.TabIndex = 0;
     184      this.scopeTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.scopeTreeView_NodeMouseDoubleClick);
    167185      //
    168186      // nameTextBox
     
    215233      this.timer.Interval = 500;
    216234      this.timer.Tick += new System.EventHandler(this.timer_Tick);
     235      //
     236      // executionContextImageList
     237      //
     238      this.executionContextImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     239      this.executionContextImageList.ImageSize = new System.Drawing.Size(16, 16);
     240      this.executionContextImageList.TransparentColor = System.Drawing.Color.Transparent;
     241      //
     242      // parametersImageList
     243      //
     244      this.parametersImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     245      this.parametersImageList.ImageSize = new System.Drawing.Size(16, 16);
     246      this.parametersImageList.TransparentColor = System.Drawing.Color.Transparent;
     247      //
     248      // scopeImageList
     249      //
     250      this.scopeImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     251      this.scopeImageList.ImageSize = new System.Drawing.Size(16, 16);
     252      this.scopeImageList.TransparentColor = System.Drawing.Color.Transparent;
    217253      //
    218254      // OperationContentView
     
    254290    private System.Windows.Forms.GroupBox scopeGroupBox;
    255291    private System.Windows.Forms.Timer timer;
     292    private System.Windows.Forms.ImageList executionContextImageList;
     293    private System.Windows.Forms.ImageList parametersImageList;
     294    private System.Windows.Forms.ImageList scopeImageList;
     295    private System.Windows.Forms.ColumnHeader parameterColumn;
    256296  }
    257297}
  • branches/HeuristicLab.DebugEngine/OperationContentView.cs

    r4904 r4909  
    55using System.Windows.Forms;
    66using HeuristicLab.Common;
     7using HeuristicLab.Common.Resources;
    78using HeuristicLab.Core;
    89using HeuristicLab.MainForm;
     
    4748      parameterListView.BeginUpdate();
    4849      parameterListView.Items.Clear();
     50      parameterListView.SmallImageList.Images.Clear();
    4951      if (Content.IsAtomic) {
    5052        foreach (var param in Content.AtomicOperation.Operator.Parameters) {
     
    5254            string.Format("{0} = {1}", param.Name, GetParameterValue(param, Content.ExecutionContext)));
    5355          item.Tag = param;
    54         }
     56          parameterListView.SmallImageList.Images.Add(param.ItemImage ?? VS2008ImageLibrary.Nothing);
     57          item.ImageIndex = parameterListView.SmallImageList.Images.Count - 1;
     58          item.ToolTipText = string.Format("{0}{1}{1}{2}",
     59            Utils.TypeName(param), Environment.NewLine,
     60            Utils.Wrap(param.Description ?? param.ItemDescription, 60));
     61        }
     62      }
     63      if (parameterListView.Items.Count > 0) {
     64        for (int i = 0; i < parameterListView.Columns.Count; i++)
     65          parameterListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
    5566      }
    5667      parameterListView.EndUpdate();
     
    7283      scopeTreeView.BeginUpdate();
    7384      scopeTreeView.Nodes.Clear();
     85      scopeTreeView.ImageList.Images.Clear();
     86      scopeTreeView.ImageList.Images.Add(VS2008ImageLibrary.Namespace);
     87      scopeTreeView.ImageList.Images.Add(VS2008ImageLibrary.Field);
    7488      if (Content.IsContext) {
    7589        var scope = Content.ExecutionContext.Scope;
     
    88102
    89103    private void AddScope(TreeNodeCollection nodes, IScope scope) {
    90       TreeNode node = nodes.Add(string.Format("{0} ({1}+{2})", scope.Name, scope.Variables.Count, scope.SubScopes.Count));
     104      TreeNode node = nodes.Add(string.Format("{0} ({1}+{2})",
     105        scope.Name, scope.Variables.Count, scope.SubScopes.Count));
    91106      node.Tag = scope;
     107      node.ImageIndex = 0;
     108      node.SelectedImageIndex = 0;
    92109      if (Content.IsAtomic && Content.AtomicOperation.Scope == scope) {
    93110        node.ForeColor = Color.Red;
     
    97114        TreeNode varNode = node.Nodes.Add(string.Format("{0}={1}", var.Name, var.Value));
    98115        varNode.Tag = var.Value;
    99         varNode.ToolTipText = Utils.TypeName(var.Value);
     116        varNode.ToolTipText = string.Format("{0}{1}{1}{2}",
     117          Utils.TypeName(var.Value), Environment.NewLine,
     118          Utils.Wrap(var.Description ?? var.ItemDescription, 60));
     119        varNode.ImageIndex = 1;
     120        varNode.SelectedImageIndex = 1;
    100121      }
    101122      foreach (var subScope in scope.SubScopes) {
     
    107128      executionContextTreeView.BeginUpdate();
    108129      executionContextTreeView.Nodes.Clear();
     130      executionContextTreeView.ImageList.Images.Clear();
     131      executionContextTreeView.ImageList.Images.Add(VS2008ImageLibrary.Namespace);
    109132      if (Content.IsContext) {
    110133        AddExecutionContext(Content.ExecutionContext, executionContextTreeView.Nodes);
     
    120143      StringBuilder name = new StringBuilder();
    121144      if (context != null && context.Operator != null)
    122         name.Append("Op ").Append(context.Operator.Name);
     145        name.Append(context.Operator.Name);
    123146      else
    124147        name.Append("<Context>");
     
    126149      TreeNode node = nodes.Add(name.ToString());
    127150      node.Tag = executionContext;
     151      node.ImageIndex = 0;
     152      node.SelectedImageIndex = 0;
    128153      foreach (var param in executionContext.Parameters) {
    129         TreeNode paramNode = node.Nodes.Add(string.Format("Param {0}={1}", param.Name, GetParameterValue(param, executionContext)));
     154        TreeNode paramNode = node.Nodes.Add(string.Format("{0}={1}",
     155          param.Name, GetParameterValue(param, executionContext)));
    130156        paramNode.Tag = param;
     157        executionContextTreeView.ImageList.Images.Add(param.ItemImage ?? VS2008ImageLibrary.Nothing);
     158        paramNode.ImageIndex = executionContextTreeView.ImageList.Images.Count - 1;
     159        paramNode.SelectedImageIndex = paramNode.ImageIndex;
     160        paramNode.ToolTipText = string.Format("{0}{1}{1}{2}",
     161          Utils.TypeName(param), Environment.NewLine,
     162          Utils.Wrap(param.Description ?? param.ItemDescription, 60));
    131163      }
    132164      if (executionContext.Parent != null)
     
    150182        if (param != null)
    151183          MainFormManager.MainForm.ShowContent(param);
     184      }
     185    }
     186
     187    private void scopeTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) {
     188      if (e.Node != null) {
     189        IItem item = e.Node.Tag as IItem;
     190        if (item != null)
     191          MainFormManager.MainForm.ShowContent(item);
    152192      }
    153193    }
  • branches/HeuristicLab.DebugEngine/OperationContentView.resx

    r4876 r4909  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="executionContextImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>97, 17</value>
     122  </metadata>
     123  <metadata name="parametersImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     124    <value>296, 17</value>
     125  </metadata>
     126  <metadata name="scopeImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     127    <value>461, 17</value>
     128  </metadata>
    120129  <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    121130    <value>17, 17</value>
  • branches/HeuristicLab.DebugEngine/OperatorTraceView.Designer.cs

    r4904 r4909  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      this.components = new System.ComponentModel.Container();
    2627      this.operatorTraceGroupBox = new System.Windows.Forms.GroupBox();
    2728      this.listView = new System.Windows.Forms.ListView();
     29      this.listViewColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     30      this.imageList = new System.Windows.Forms.ImageList(this.components);
    2831      this.operatorTraceGroupBox.SuspendLayout();
    2932      this.SuspendLayout();
     
    3538      this.operatorTraceGroupBox.Location = new System.Drawing.Point(0, 0);
    3639      this.operatorTraceGroupBox.Name = "operatorTraceGroupBox";
    37       this.operatorTraceGroupBox.Size = new System.Drawing.Size(515, 405);
     40      this.operatorTraceGroupBox.Size = new System.Drawing.Size(152, 489);
    3841      this.operatorTraceGroupBox.TabIndex = 0;
    3942      this.operatorTraceGroupBox.TabStop = false;
     
    4245      // listView
    4346      //
     47      this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     48            this.listViewColumnHeader});
    4449      this.listView.Dock = System.Windows.Forms.DockStyle.Fill;
    45       this.listView.FullRowSelect = true;
     50      this.listView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
     51      this.listView.HideSelection = false;
    4652      this.listView.Location = new System.Drawing.Point(3, 16);
    4753      this.listView.Name = "listView";
    48       this.listView.Size = new System.Drawing.Size(509, 386);
     54      this.listView.ShowItemToolTips = true;
     55      this.listView.Size = new System.Drawing.Size(146, 470);
     56      this.listView.SmallImageList = this.imageList;
    4957      this.listView.TabIndex = 0;
    5058      this.listView.UseCompatibleStateImageBehavior = false;
    51       this.listView.View = System.Windows.Forms.View.List;
     59      this.listView.View = System.Windows.Forms.View.Details;
    5260      this.listView.ItemActivate += new System.EventHandler(this.listView_ItemActivate);
     61      //
     62      // imageList
     63      //
     64      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     65      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
     66      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
    5367      //
    5468      // OperatorTraceView
     
    5872      this.Controls.Add(this.operatorTraceGroupBox);
    5973      this.Name = "OperatorTraceView";
    60       this.Size = new System.Drawing.Size(515, 405);
     74      this.Size = new System.Drawing.Size(152, 489);
    6175      this.operatorTraceGroupBox.ResumeLayout(false);
    6276      this.ResumeLayout(false);
     
    6882    private System.Windows.Forms.GroupBox operatorTraceGroupBox;
    6983    private System.Windows.Forms.ListView listView;
     84    private System.Windows.Forms.ImageList imageList;
     85    private System.Windows.Forms.ColumnHeader listViewColumnHeader;
    7086  }
    7187}
  • branches/HeuristicLab.DebugEngine/OperatorTraceView.cs

    r4904 r4909  
    22using System.Windows.Forms;
    33using HeuristicLab.Collections;
     4using HeuristicLab.Common.Resources;
    45using HeuristicLab.Core;
    56using HeuristicLab.Core.Views;
    67using HeuristicLab.MainForm;
     8using HeuristicLab.Operators;
    79
    810namespace HeuristicLab.DebugEngine {
     
    4951
    5052    private void UpdateOperatorTrace() {
     53      if (suspended)
     54        return;
    5155      listView.BeginUpdate();
    5256      listView.Items.Clear();
     57      listView.SmallImageList.Images.Clear();
     58      listView.SmallImageList.Images.Add(VS2008ImageLibrary.Method);
     59      listView.SmallImageList.Images.Add(VS2008ImageLibrary.Module);
    5360      foreach (var item in Content) {
    5461        var viewItem = listView.Items.Add(item.Name ?? item.ItemName);
     62        viewItem.ToolTipText = string.Format("{0}{1}{1}{2}",
     63          Utils.TypeName(item), Environment.NewLine,
     64          Utils.Wrap(item.Description, 60));
    5565        viewItem.Tag = item;
     66        viewItem.ImageIndex = item is CombinedOperator ? 1 : 0;
     67      }
     68      if (listView.Items.Count > 0) {
     69        for (int i = 0; i < listView.Columns.Count; i++)
     70          listView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
    5671      }
    5772      listView.EndUpdate();
     
    7792    }
    7893    #endregion
     94
     95    private bool suspended = false;
     96    public void SuspendUpdate() {
     97      suspended = true;
     98    }
     99    public void ResumeUpdate() {
     100      suspended = false;
     101      UpdateOperatorTrace();
     102    }
    79103  }
    80104
  • branches/HeuristicLab.DebugEngine/OperatorTraceView.resx

    r4904 r4909  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>17, 17</value>
     122  </metadata>
    120123</root>
  • branches/HeuristicLab.DebugEngine/Utils.cs

    r4871 r4909  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    42using System.Text;
     3using System.Text.RegularExpressions;
    54using HeuristicLab.Persistence.Auxiliary;
    65
     
    1211      return TypeNameParser.Parse(obj.GetType().ToString()).GetTypeNameInCode(true);
    1312    }
     13    public static string Wrap(string text, int columns) {
     14      StringBuilder sb = new StringBuilder();
     15      Regex whitespace = new Regex("\\s");
     16      int lineLength = 0;
     17      foreach (var word in whitespace.Split(text)) {
     18        if (lineLength + word.Length < columns) {
     19          if (lineLength > 0) {
     20            sb.Append(' ');
     21            lineLength++;
     22          }
     23          sb.Append(word);
     24          lineLength += word.Length;
     25        } else {
     26          sb.Append(Environment.NewLine).Append(word);
     27          lineLength = word.Length;
     28        }
     29      }
     30      return sb.ToString();
     31    }
    1432  }
    1533}
Note: See TracChangeset for help on using the changeset viewer.