1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.ActiveRecord
.Generator
.Parts
19 using System
.Collections
;
20 using System
.ComponentModel
;
21 using System
.Windows
.Forms
;
22 using WeifenLuo
.WinFormsUI
;
23 using Castle
.ActiveRecord
.Generator
.Components
;
27 /// Summary description for OutputView.
29 public class OutputView
: DockContent
, ILogger
, ISubWorkspace
31 private System
.Windows
.Forms
.TextBox textBox1
;
36 /// Required designer variable.
38 private System
.ComponentModel
.Container components
= null;
40 private IWorkspace _parentWs
;
45 // Required for Windows Form Designer support
47 InitializeComponent();
49 ServiceRegistry
.Instance
.Kernel
.AddComponentInstance("logger", typeof (ILogger
), this);
52 public OutputView(Model model
) : this()
57 /// Clean up any resources being used.
59 protected override void Dispose(bool disposing
)
63 if (components
!= null)
68 base.Dispose(disposing
);
71 #region Windows Form Designer generated code
74 /// Required method for Designer support - do not modify
75 /// the contents of this method with the code editor.
77 private void InitializeComponent()
79 this.textBox1
= new System
.Windows
.Forms
.TextBox();
84 this.textBox1
.BackColor
= System
.Drawing
.Color
.White
;
85 this.textBox1
.Dock
= System
.Windows
.Forms
.DockStyle
.Fill
;
86 this.textBox1
.Location
= new System
.Drawing
.Point(0, 2);
87 this.textBox1
.Multiline
= true;
88 this.textBox1
.Name
= "textBox1";
89 this.textBox1
.ReadOnly
= true;
90 this.textBox1
.ScrollBars
= System
.Windows
.Forms
.ScrollBars
.Both
;
91 this.textBox1
.Size
= new System
.Drawing
.Size(255, 361);
92 this.textBox1
.TabIndex
= 1;
93 this.textBox1
.Text
= "";
94 this.textBox1
.WordWrap
= false;
98 this.AutoScaleBaseSize
= new System
.Drawing
.Size(5, 13);
99 this.ClientSize
= new System
.Drawing
.Size(255, 365);
100 this.Controls
.Add(this.textBox1
);
101 this.DockableAreas
= ((WeifenLuo
.WinFormsUI
.DockAreas
)(((((WeifenLuo
.WinFormsUI
.DockAreas
.Float
| WeifenLuo
.WinFormsUI
.DockAreas
.DockLeft
)
102 | WeifenLuo
.WinFormsUI
.DockAreas
.DockRight
)
103 | WeifenLuo
.WinFormsUI
.DockAreas
.DockTop
)
104 | WeifenLuo
.WinFormsUI
.DockAreas
.DockBottom
)));
105 this.DockPadding
.Bottom
= 2;
106 this.DockPadding
.Top
= 2;
107 this.HideOnClose
= true;
108 this.Name
= "OutputView";
109 this.ShowHint
= WeifenLuo
.WinFormsUI
.DockState
.DockBottomAutoHide
;
110 this.Text
= "OutputView";
111 this.ResumeLayout(false);
117 public void Info(String message
)
121 textBox1
.Text
+= message
+ "\r\n";
126 textBox1
.Text
= "--------------------- Starting ---------------------\r\n\r\n";
127 _start
= DateTime
.Now
.Ticks
;
132 textBox1
.Text
+= "\r\n--------------------- Finished ---------------------";
133 _end
= DateTime
.Now
.Ticks
;
135 TimeSpan diff
= new TimeSpan(_end
- _start
);
137 textBox1
.Text
+= "\r\n\r\nCompleted in " + diff
.TotalSeconds
+ " seconds";
140 private void EnsureVisible()
142 this.Show( _parentWs
.MainDockManager
);
145 #region ISubWorkspace Members
147 public IWorkspace ParentWorkspace
149 get { return _parentWs; }
150 set { _parentWs = value; }
155 #region IWorkspace Members
157 public IWin32Window ActiveWindow
162 public MainMenu MainMenu
167 public ToolBar MainToolBar
172 public StatusBar MainStatusBar
177 public DockPanel MainDockManager