source: trunk/Include/Classes/System/Console.ab@ 473

Last change on this file since 473 was 473, checked in by イグトランス (egtra), 16 years ago

実験として書いていたControlクラスを追加(せめてコミット前に既存のContorolに混ぜようとしたがコンパイルできなかった)。
ほかForms, Drawing及びGDI+の修正。

File size: 1.3 KB
Line 
1'Classes/System/Console.ab
2
3Namespace System
4
5/*
6@brief コンソール入出力・ウィンドウなどのクラス
7@date 2008/02/26
8@auther Egtra
9*/
10Class Console
11Public
12 /*
13 @brief 標準入力を設定する
14 @date 2008/02/26
15 @auther Egtra
16 */
17 Static Sub SetIn(newIn As IO.TextReader)
18 If ActiveBasic.IsNothing(newIn) Then
19 Throw New ArgumentNullException("newIn")
20 End If
21 in = newIn
22 End Sub
23 /*
24 @brief 標準入力を取得する
25 @date 2008/02/26
26 @auther Egtra
27 */
28 Static Function In() As IO.TextReader
29 In = in
30 End Function
31
32 /*
33 @brief 標準入力から1行読み込む
34 @date 2008/02/26
35 @auther Egtra
36 */
37 Static Function ReadLine() As String
38 ReadLine = in.ReadLine()
39 End Function
40
41 /*
42 @brief 標準入力から1行読み込む
43 @date 2008/02/26
44 @auther Egtra
45 */
46 Static Function Read() As Long
47 Read = in.Read()
48 End Function
49Private
50 Function enter() As ActiveBasic.Windows.CriticalSectionLock
51 Imports ActiveBasic.Windows
52 If ActiveBasic.IsNothing(cs) Then
53 Dim lock = New CriticalSectionLock(_System_CriticalSection)
54 Try
55 If ActiveBasic.IsNothing(cs) Then
56 cs = New CriticalSection
57 End If
58 Finally
59 lock.Dispose()
60 End Try
61 End If
62 enter = cs.Enter
63 End Function
64
65 Static in = Nothing As IO.TextReader
66 Static cs = Nothing As ActiveBasic.Windows.CriticalSection
67End Class
68
69End Namespace 'System
Note: See TracBrowser for help on using the repository browser.