- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 7 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.Designer.cs
r12012 r14029 20 20 #endregion 21 21 22 using System.Windows.Forms;23 22 24 23 namespace HeuristicLab.Scripting.Views { … … 47 46 /// </summary> 48 47 private void InitializeComponent() { 49 this.components = new System.ComponentModel.Container();50 this.startStopButton = new System.Windows.Forms.Button();51 48 this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 52 49 this.variableStoreView = new HeuristicLab.Scripting.Views.VariableStoreView(); 53 50 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 51 this.infoTabControl.SuspendLayout(); 52 this.outputTabPage.SuspendLayout(); 53 this.errorListTabPage.SuspendLayout(); 54 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 55 this.splitContainer1.Panel1.SuspendLayout(); 56 this.splitContainer1.Panel2.SuspendLayout(); 57 this.splitContainer1.SuspendLayout(); 54 58 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 55 59 ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); … … 59 63 this.SuspendLayout(); 60 64 // 61 // nameTextBox65 // executionTimeLabel 62 66 // 63 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 64 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 65 this.nameTextBox.Location = new System.Drawing.Point(60, 0); 66 this.nameTextBox.Size = new System.Drawing.Size(750, 20); 67 this.executionTimeLabel.Location = new System.Drawing.Point(409, 3); 67 68 // 68 // infoLabel69 // executionTimeTextBox 69 70 // 70 this. infoLabel.Location = new System.Drawing.Point(816, 4);71 this.executionTimeTextBox.Location = new System.Drawing.Point(498, 0); 71 72 // 72 // startStopButton73 // infoTabControl 73 74 // 74 this. startStopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play;75 this.startStopButton.Location = new System.Drawing.Point(36, 26);76 this.startStopButton.Name = "startStopButton";77 this.startStopButton.Size = new System.Drawing.Size(24, 24);78 this.s tartStopButton.TabIndex = 1;79 this.s tartStopButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;80 this. toolTip.SetToolTip(this.startStopButton, "Run (F5)");81 this.s tartStopButton.UseVisualStyleBackColor = true;82 this.s tartStopButton.Click += new System.EventHandler(this.StartStopButtonOnClick);75 this.infoTabControl.Size = new System.Drawing.Size(637, 110); 76 // 77 // splitContainer1 78 // 79 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); 80 this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 81 this.splitContainer1.Location = new System.Drawing.Point(0, 0); 82 this.splitContainer1.Size = new System.Drawing.Size(637, 543); 83 this.splitContainer1.SplitterDistance = 427; 83 84 // 84 85 // splitContainer2 … … 101 102 this.splitContainer2.SplitterDistance = 637; 102 103 this.splitContainer2.TabIndex = 7; 103 //104 // splitContainer1105 //106 this.splitContainer1.Location = new System.Drawing.Point(0, 0);107 this.splitContainer1.Dock = DockStyle.Fill;108 104 // 109 105 // variableStoreView … … 132 128 this.viewHost.ViewType = null; 133 129 // 134 // ScriptView130 // CSharpScriptView 135 131 // 136 132 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 137 133 this.Controls.Add(this.splitContainer2); 138 this. Controls.Add(this.startStopButton);139 this. Name = "ScriptView";140 this. Size = new System.Drawing.Size(835, 602);134 this.Name = "CSharpScriptView"; 135 this.Controls.SetChildIndex(this.infoTextLabel, 0); 136 this.Controls.SetChildIndex(this.compileButton, 0); 141 137 this.Controls.SetChildIndex(this.startStopButton, 0); 142 138 this.Controls.SetChildIndex(this.splitContainer2, 0); … … 144 140 this.Controls.SetChildIndex(this.nameTextBox, 0); 145 141 this.Controls.SetChildIndex(this.infoLabel, 0); 142 this.infoTabControl.ResumeLayout(false); 143 this.outputTabPage.ResumeLayout(false); 144 this.outputTabPage.PerformLayout(); 145 this.errorListTabPage.ResumeLayout(false); 146 this.splitContainer1.Panel1.ResumeLayout(false); 147 this.splitContainer1.Panel2.ResumeLayout(false); 148 this.splitContainer1.Panel2.PerformLayout(); 149 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 150 this.splitContainer1.ResumeLayout(false); 151 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 146 152 this.splitContainer2.Panel1.ResumeLayout(false); 147 153 this.splitContainer2.Panel2.ResumeLayout(false); … … 155 161 #endregion 156 162 157 protected System.Windows.Forms.Button startStopButton;158 163 protected System.Windows.Forms.SplitContainer splitContainer2; 159 164 protected MainForm.WindowsForms.ViewHost viewHost; -
branches/crossvalidation-2434/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.cs
r12012 r14029 21 21 22 22 using System; 23 using System.Drawing;24 using System.Threading;25 23 using System.Windows.Forms; 26 24 using HeuristicLab.Common; 27 using HeuristicLab.Common.Resources;28 25 using HeuristicLab.MainForm; 29 26 … … 32 29 [View("C# Script View")] 33 30 [Content(typeof(CSharpScript), true)] 34 public partial class CSharpScriptView : ScriptView { 35 private const string ScriptExecutionStartedMessage = "Script execution started"; 36 private const string ScriptExecutionCanceledMessage = "Script execution canceled"; 37 private const string ScriptExecutionSuccessfulMessage = "Script execution successful"; 38 private const string ScriptExecutionFailedMessage = "Script execution failed"; 39 40 protected bool Running { get; set; } 31 public partial class CSharpScriptView : ExecutableScriptView { 41 32 42 33 public new CSharpScript Content { … … 51 42 protected override void RegisterContentEvents() { 52 43 base.RegisterContentEvents(); 53 Content.ScriptExecutionStarted += ContentOnScriptExecutionStarted;54 Content.ScriptExecutionFinished += ContentOnScriptExecutionFinished;55 44 Content.ConsoleOutputChanged += ContentOnConsoleOutputChanged; 56 45 } 57 46 58 47 protected override void DeregisterContentEvents() { 59 Content.ScriptExecutionStarted -= ContentOnScriptExecutionStarted;60 Content.ScriptExecutionFinished -= ContentOnScriptExecutionFinished;61 48 Content.ConsoleOutputChanged -= ContentOnConsoleOutputChanged; 62 49 base.DeregisterContentEvents(); … … 64 51 65 52 #region Content event handlers 66 protected virtual void ContentOnScriptExecutionStarted(object sender, EventArgs e) {67 if (InvokeRequired)68 Invoke((Action<object, EventArgs>)ContentOnScriptExecutionStarted, sender, e);69 else {70 Locked = true;71 ReadOnly = true;72 startStopButton.Image = VSImageLibrary.Stop;73 toolTip.SetToolTip(startStopButton, "Stop (Shift+F5)");74 UpdateInfoTextLabel(ScriptExecutionStartedMessage, SystemColors.ControlText);75 infoTabControl.SelectedTab = outputTabPage;76 }77 }78 protected virtual void ContentOnScriptExecutionFinished(object sender, EventArgs<Exception> e) {79 if (InvokeRequired)80 Invoke((Action<object, EventArgs<Exception>>)ContentOnScriptExecutionFinished, sender, e);81 else {82 Locked = false;83 ReadOnly = false;84 startStopButton.Image = VSImageLibrary.Play;85 toolTip.SetToolTip(startStopButton, "Run (F5)");86 87 var ex = e.Value;88 if (ex == null) {89 UpdateInfoTextLabel(ScriptExecutionSuccessfulMessage, Color.DarkGreen);90 } else if (ex is ThreadAbortException) {91 // the execution was canceled by the user92 UpdateInfoTextLabel(ScriptExecutionCanceledMessage, Color.DarkOrange);93 } else {94 UpdateInfoTextLabel(ScriptExecutionFailedMessage, Color.DarkRed);95 PluginInfrastructure.ErrorHandling.ShowErrorDialog(this, ex);96 }97 98 Running = false;99 }100 }101 53 protected virtual void ContentOnConsoleOutputChanged(object sender, EventArgs<string> e) { 102 54 if (InvokeRequired) … … 116 68 } 117 69 } 118 119 protected override void SetEnabledStateOfControls() {120 base.SetEnabledStateOfControls();121 startStopButton.Enabled = Content != null && (!Locked || Running);122 }123 124 protected virtual void StartStopButtonOnClick(object sender, EventArgs e) {125 if (Running) {126 Content.Kill();127 } else128 if (Compile()) {129 outputTextBox.Clear();130 Running = true;131 Content.ExecuteAsync();132 }133 }134 135 #region global HotKeys136 protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {137 switch (keyData) {138 case Keys.F5:139 if (Content != null && !Locked && !Running) {140 if (Compile()) {141 outputTextBox.Clear();142 Content.ExecuteAsync();143 Running = true;144 }145 }146 return true;147 case Keys.F5 | Keys.Shift:148 if (Running) Content.Kill();149 return true;150 case Keys.F6:151 if (!Running) base.ProcessCmdKey(ref msg, keyData);152 return true;153 }154 return base.ProcessCmdKey(ref msg, keyData);155 }156 #endregion157 70 } 158 71 } -
branches/crossvalidation-2434/HeuristicLab.Scripting.Views/3.3/HeuristicLab.Scripting.Views-3.3.csproj
r11807 r14029 97 97 <Compile Include="CSharpScriptView.Designer.cs"> 98 98 <DependentUpon>CSharpScriptView.cs</DependentUpon> 99 </Compile> 100 <Compile Include="ExecutableScriptView.cs"> 101 <SubType>UserControl</SubType> 102 </Compile> 103 <Compile Include="ExecutableScriptView.Designer.cs"> 104 <DependentUpon>ExecutableScriptView.cs</DependentUpon> 99 105 </Compile> 100 106 <Compile Include="ScriptView.cs"> -
branches/crossvalidation-2434/HeuristicLab.Scripting.Views/3.3/Plugin.cs.frame
r12753 r14029 23 23 24 24 namespace HeuristicLab.Scripting.Views { 25 [Plugin("HeuristicLab.Scripting.Views", "3.3.1 2.$WCREV$")]25 [Plugin("HeuristicLab.Scripting.Views", "3.3.13.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Scripting.Views-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.CodeEditor", "3.4")] -
branches/crossvalidation-2434/HeuristicLab.Scripting.Views/3.3/Properties/AssemblyInfo.cs.frame
r12753 r14029 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3.1 2.$WCREV$")]57 [assembly: AssemblyFileVersion("3.3.13.$WCREV$")] -
branches/crossvalidation-2434/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs
r12473 r14029 118 118 // infoTabControl 119 119 // 120 this.infoTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 121 | System.Windows.Forms.AnchorStyles.Left) 122 | System.Windows.Forms.AnchorStyles.Right))); 120 123 this.infoTabControl.Controls.Add(this.outputTabPage); 121 124 this.infoTabControl.Controls.Add(this.errorListTabPage); 122 this.infoTabControl.Dock = System.Windows.Forms.DockStyle.Fill; 123 this.infoTabControl.Location = new System.Drawing.Point(0, 0); 125 this.infoTabControl.Location = new System.Drawing.Point(0, 2); 124 126 this.infoTabControl.Name = "infoTabControl"; 125 127 this.infoTabControl.SelectedIndex = 0; 126 this.infoTabControl.Size = new System.Drawing.Size(832, 11 2);128 this.infoTabControl.Size = new System.Drawing.Size(832, 110); 127 129 this.infoTabControl.TabIndex = 1; 128 130 // … … 133 135 this.outputTabPage.Name = "outputTabPage"; 134 136 this.outputTabPage.Padding = new System.Windows.Forms.Padding(3); 135 this.outputTabPage.Size = new System.Drawing.Size(824, 8 6);137 this.outputTabPage.Size = new System.Drawing.Size(824, 84); 136 138 this.outputTabPage.TabIndex = 1; 137 139 this.outputTabPage.Text = "Output"; … … 147 149 this.outputTextBox.ReadOnly = true; 148 150 this.outputTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; 149 this.outputTextBox.Size = new System.Drawing.Size(818, 80);151 this.outputTextBox.Size = new System.Drawing.Size(818, 78); 150 152 this.outputTextBox.TabIndex = 0; 151 153 this.outputTextBox.WordWrap = false;
Note: See TracChangeset
for help on using the changeset viewer.