OSDN Git Service

初コミット
[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;\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 IsRTL\r
67         {\r
68             get\r
69             {\r
70                 return _IsRTL;\r
71             }\r
72             set\r
73             {\r
74                 _IsRTL = value;\r
75                 if (ChangedSetting != null)\r
76                     ChangedSetting(this, null);\r
77             }\r
78         }\r
79         public bool ShowRuler\r
80         {\r
81             get\r
82             {\r
83                 return _ShowRuler;\r
84             }\r
85             set\r
86             {\r
87                 _ShowRuler = value;\r
88                 if(ChangedSetting != null)\r
89                     ChangedSetting(this, null);\r
90             }\r
91         }\r
92 \r
93         public bool ShowLineNumber\r
94         {\r
95             get\r
96             {\r
97                 return _ShowLineNumber;\r
98             }\r
99             set\r
100             {\r
101                 _ShowLineNumber = value;\r
102                 if (ChangedSetting != null)\r
103                     ChangedSetting(this, null);\r
104             }\r
105         }\r
106 \r
107         public bool ShowLineMarker\r
108         {\r
109             get\r
110             {\r
111                 return _ShowLineMarker;\r
112             }\r
113             set\r
114             {\r
115                 _ShowLineMarker = value;\r
116                 if (ChangedSetting != null)\r
117                     ChangedSetting(this, null);\r
118             }\r
119         }\r
120 \r
121         public bool HilightXML\r
122         {\r
123             get\r
124             {\r
125                 return _HilightXML;\r
126             }\r
127             set\r
128             {\r
129                 _HilightXML = value;\r
130                 if (ChangedSetting != null)\r
131                     ChangedSetting(this, null);\r
132             }\r
133         }\r
134 \r
135         public event EventHandler ChangedSetting;\r
136     }\r
137     public struct LineBreakMethodItem\r
138     {\r
139         string _Title;\r
140         LineBreakMethod _Method;\r
141         public string Title\r
142         {\r
143             get\r
144             {\r
145                 return this._Title;\r
146             }\r
147         }\r
148         public LineBreakMethod Method\r
149         {\r
150             get\r
151             {\r
152                 return this._Method;\r
153             }\r
154         }\r
155         public LineBreakMethodItem(string title, LineBreakMethod method)\r
156         {\r
157             this._Title = title;\r
158             this._Method = method;\r
159         }\r
160     }\r
161 }\r