OSDN Git Service

行を生成するメソッドをLineToIndexTableに移動した
[fooeditengine/FooEditEngine.git] / Metro / Test / AppSettings.cs
1 /*\r
2  * Copyright (C) 2013 FooProject\r
3  * * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by\r
4  * the Free Software Foundation; either version 3 of the License, or (at your option) any later version.\r
5 \r
6  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of \r
7  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r
8 \r
9 You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.\r
10  */\r
11 using System;\r
12 using System.Collections.Generic;\r
13 using System.Collections.ObjectModel;\r
14 using System.Linq;\r
15 using System.Text;\r
16 using System.Threading.Tasks;\r
17 using FooEditEngine;\r
18 \r
19 namespace Test\r
20 {\r
21     public class AppSettings\r
22     {\r
23         public static AppSettings _thisInstance = new AppSettings();\r
24         public static AppSettings Current\r
25         {\r
26             get\r
27             {\r
28                 if (_thisInstance._LineBreakMethodList == null)\r
29                 {\r
30                     _thisInstance._LineBreakMethodList = new ObservableCollection<LineBreakMethodItem>();\r
31                     _thisInstance._LineBreakMethodList.Add(new LineBreakMethodItem("折りたたまない", LineBreakMethod.None));\r
32                     _thisInstance._LineBreakMethodList.Add(new LineBreakMethodItem("右端で折りたたむ", LineBreakMethod.PageBound));\r
33                     _thisInstance._LineBreakMethodList.Add(new LineBreakMethodItem("50字で折りたたむ", LineBreakMethod.CharUnit));\r
34                     _thisInstance._CurrentLineBreakMethod = _thisInstance._LineBreakMethodList[0];\r
35                 }\r
36                 return _thisInstance;\r
37             }\r
38         }\r
39 \r
40         bool _IsRTL, _ShowRuler, _ShowLineNumber, _ShowLineMarker, _HilightXML, _IsVisible = true;\r
41         ObservableCollection<LineBreakMethodItem> _LineBreakMethodList;\r
42         LineBreakMethodItem _CurrentLineBreakMethod;\r
43 \r
44         public ObservableCollection<LineBreakMethodItem> LineBreakMethodList\r
45         {\r
46             get\r
47             {\r
48                 return _LineBreakMethodList;\r
49             }\r
50         }\r
51 \r
52         public LineBreakMethodItem CurrentLineBreakMethod\r
53         {\r
54             get\r
55             {\r
56                 return _CurrentLineBreakMethod;\r
57             }\r
58             set\r
59             {\r
60                 this._CurrentLineBreakMethod = value;\r
61                 if (ChangedSetting != null)\r
62                     ChangedSetting(this, null);\r
63             }\r
64         }\r
65 \r
66         public bool IsVisible\r
67         {\r
68             get\r
69             {\r
70                 return this._IsVisible;\r
71             }\r
72             set\r
73             {\r
74                 this._IsVisible = value;\r
75                 if (ChangedSetting != null)\r
76                     ChangedSetting(this, null);\r
77             }\r
78         }\r
79 \r
80         public bool IsRTL\r
81         {\r
82             get\r
83             {\r
84                 return _IsRTL;\r
85             }\r
86             set\r
87             {\r
88                 _IsRTL = value;\r
89                 if (ChangedSetting != null)\r
90                     ChangedSetting(this, null);\r
91             }\r
92         }\r
93 \r
94         public bool ShowRuler\r
95         {\r
96             get\r
97             {\r
98                 return _ShowRuler;\r
99             }\r
100             set\r
101             {\r
102                 _ShowRuler = value;\r
103                 if(ChangedSetting != null)\r
104                     ChangedSetting(this, null);\r
105             }\r
106         }\r
107 \r
108         public bool ShowLineNumber\r
109         {\r
110             get\r
111             {\r
112                 return _ShowLineNumber;\r
113             }\r
114             set\r
115             {\r
116                 _ShowLineNumber = value;\r
117                 if (ChangedSetting != null)\r
118                     ChangedSetting(this, null);\r
119             }\r
120         }\r
121 \r
122         public bool ShowLineMarker\r
123         {\r
124             get\r
125             {\r
126                 return _ShowLineMarker;\r
127             }\r
128             set\r
129             {\r
130                 _ShowLineMarker = value;\r
131                 if (ChangedSetting != null)\r
132                     ChangedSetting(this, null);\r
133             }\r
134         }\r
135 \r
136         public bool HilightXML\r
137         {\r
138             get\r
139             {\r
140                 return _HilightXML;\r
141             }\r
142             set\r
143             {\r
144                 _HilightXML = value;\r
145                 if (ChangedSetting != null)\r
146                     ChangedSetting(this, null);\r
147             }\r
148         }\r
149 \r
150         public event EventHandler ChangedSetting;\r
151     }\r
152     public struct LineBreakMethodItem\r
153     {\r
154         string _Title;\r
155         LineBreakMethod _Method;\r
156         public string Title\r
157         {\r
158             get\r
159             {\r
160                 return this._Title;\r
161             }\r
162         }\r
163         public LineBreakMethod Method\r
164         {\r
165             get\r
166             {\r
167                 return this._Method;\r
168             }\r
169         }\r
170         public LineBreakMethodItem(string title, LineBreakMethod method)\r
171         {\r
172             this._Title = title;\r
173             this._Method = method;\r
174         }\r
175     }\r
176 }\r