##// END OF EJS Templates
Implemented PollingRunnableComponent
cin -
r202:2651cb9a4250 v2
parent child
Show More
@@ -0,0 +1,98
1 using System;
2 using System.Threading;
3 using Implab.Diagnostics;
4
5 namespace Implab.Components {
6 public class PollingRunnableComponent : RunnableComponent {
7 readonly Timer m_timer;
8 readonly Func<Func<IPromise>, IPromise> m_dispatcher;
9 readonly TimeSpan m_interval;
10
11 int m_processing;
12 Promise m_pending;
13
14 protected PollingRunnableComponent(TimeSpan interval, Func<Func<IPromise>, IPromise> dispatcher, bool initialized) : base(initialized) {
15 m_timer = new Timer(OnInternalTick);
16
17 m_interval = interval;
18 m_dispatcher = dispatcher;
19 }
20
21 protected override IPromise OnStart() {
22 m_timer.Change(TimeSpan.Zero, m_interval);
23
24 return base.OnStart();
25 }
26
27 void OnInternalTick(object state) {
28 if (StartTick()) {
29 try {
30 AwaitTick(m_dispatcher != null ? m_dispatcher(OnTick) : OnTick());
31 } catch (Exception error) {
32 HandleTickError(error);
33 }
34 }
35 }
36
37 /// <summary>
38 /// Starts the tick handler.
39 /// </summary>
40 /// <returns>boolean value, true - the new tick handler may be invoked, false - a tick handler is already running or a component isn't running.</returns>
41 /// <remarks>
42 /// If the component is stopping no new handlers can be run. Every successful call to this method must be completed with either AwaitTick or HandleTickError handlers.
43 /// </remarks>
44 protected virtual bool StartTick() {
45 if (State == ExecutionState.Running && Interlocked.CompareExchange(ref m_processing, 1, 0) == 0) {
46 m_pending = new Promise();
47 m_pending
48 .On(() => m_processing = 0, PromiseEventType.All)
49 .On(null, LogTickError);
50 return true;
51 }
52 return false;
53 }
54
55 protected virtual void AwaitTick(IPromise tick) {
56 if (tick == null) {
57 m_pending.Resolve();
58 } else {
59 tick.On(
60 m_pending.Resolve,
61 m_pending.Reject,
62 m_pending.CancelOperation
63 );
64 m_pending.CancellationRequested(tick.Cancel);
65 }
66 }
67
68 protected virtual void HandleTickError(Exception error) {
69 m_pending.Reject(error);
70 }
71
72 protected virtual void LogTickError(Exception error) {
73 }
74
75 protected virtual IPromise OnTick() {
76 return Promise.SUCCESS;
77 }
78
79 protected override IPromise OnStop() {
80 m_timer.Change(-1, -1);
81
82 if (m_pending != null) {
83 m_pending.Cancel();
84 return m_pending.Then(base.OnStop);
85 }
86
87 return base.OnStop();
88 }
89
90 protected override void Dispose(bool disposing, Exception lastError) {
91 if (disposing)
92 Safe.Dispose(m_timer);
93
94 base.Dispose(disposing, lastError);
95 }
96 }
97 }
98
@@ -1,264 +1,265
1 1 using System;
2 2
3 3 namespace Implab.Components {
4 4 public abstract class RunnableComponent : IDisposable, IRunnable, IInitializable {
5 5 enum Commands {
6 6 Ok = 0,
7 7 Fail,
8 8 Init,
9 9 Start,
10 10 Stop,
11 11 Dispose,
12 12 Last = Dispose
13 13 }
14 14
15 15 class StateMachine {
16 16 static readonly ExecutionState[,] _transitions;
17 17
18 18 static StateMachine() {
19 19 _transitions = new ExecutionState[(int)ExecutionState.Last + 1, (int)Commands.Last + 1];
20 20
21 21 Edge(ExecutionState.Created, ExecutionState.Initializing, Commands.Init);
22 22 Edge(ExecutionState.Created, ExecutionState.Disposed, Commands.Dispose);
23 23
24 24 Edge(ExecutionState.Initializing, ExecutionState.Ready, Commands.Ok);
25 25 Edge(ExecutionState.Initializing, ExecutionState.Failed, Commands.Fail);
26 26
27 27 Edge(ExecutionState.Ready, ExecutionState.Starting, Commands.Start);
28 28 Edge(ExecutionState.Ready, ExecutionState.Disposed, Commands.Dispose);
29 29
30 30 Edge(ExecutionState.Starting, ExecutionState.Running, Commands.Ok);
31 31 Edge(ExecutionState.Starting, ExecutionState.Failed, Commands.Fail);
32 32 Edge(ExecutionState.Starting, ExecutionState.Stopping, Commands.Stop);
33 33 Edge(ExecutionState.Starting, ExecutionState.Disposed, Commands.Dispose);
34 34
35 35 Edge(ExecutionState.Running, ExecutionState.Failed, Commands.Fail);
36 36 Edge(ExecutionState.Running, ExecutionState.Stopping, Commands.Stop);
37 37 Edge(ExecutionState.Running, ExecutionState.Disposed, Commands.Dispose);
38 38
39 39 Edge(ExecutionState.Stopping, ExecutionState.Failed, Commands.Fail);
40 40 Edge(ExecutionState.Stopping, ExecutionState.Disposed, Commands.Ok);
41 41
42 42 Edge(ExecutionState.Failed, ExecutionState.Disposed, Commands.Dispose);
43 43 }
44 44
45 45 static void Edge(ExecutionState s1, ExecutionState s2, Commands cmd) {
46 46 _transitions[(int)s1, (int)cmd] = s2;
47 47 }
48 48
49 49 public ExecutionState State {
50 50 get;
51 51 private set;
52 52 }
53 53
54 54 public StateMachine(ExecutionState initial) {
55 55 State = initial;
56 56 }
57 57
58 58 public bool Move(Commands cmd) {
59 59 var next = _transitions[(int)State, (int)cmd];
60 60 if (next == ExecutionState.Undefined)
61 61 return false;
62 62 State = next;
63 63 return true;
64 64 }
65 65 }
66 66
67 67 IPromise m_pending;
68 68 Exception m_lastError;
69 69
70 70 readonly StateMachine m_stateMachine;
71 71
72 72 protected RunnableComponent(bool initialized) {
73 73 m_stateMachine = new StateMachine(initialized ? ExecutionState.Ready : ExecutionState.Created);
74 74 }
75 75
76 76 protected virtual int DisposeTimeout {
77 77 get {
78 78 return 10000;
79 79 }
80 80 }
81 81
82 82 void ThrowInvalidCommand(Commands cmd) {
83 83 if (m_stateMachine.State == ExecutionState.Disposed)
84 84 throw new ObjectDisposedException(ToString());
85 85
86 86 throw new InvalidOperationException(String.Format("Commnd {0} is not allowed in the state {1}", cmd, m_stateMachine.State));
87 87 }
88 88
89 89 void Move(Commands cmd) {
90 90 if (!m_stateMachine.Move(cmd))
91 91 ThrowInvalidCommand(cmd);
92 92 }
93 93
94 94 void Invoke(Commands cmd, Action action) {
95 95 lock (m_stateMachine)
96 96 Move(cmd);
97 97
98 98 try {
99 99 action();
100 100 lock(m_stateMachine)
101 101 Move(Commands.Ok);
102 102
103 103 } catch (Exception err) {
104 104 lock (m_stateMachine) {
105 105 Move(Commands.Fail);
106 106 m_lastError = err;
107 107 }
108 108 throw;
109 109 }
110 110 }
111 111
112 112 IPromise InvokeAsync(Commands cmd, Func<IPromise> action, Action<IPromise, IDeferred> chain) {
113 113 IPromise promise = null;
114 114 IPromise prev;
115 115
116 116 var task = new ActionChainTask(action, null, null, true);
117 117
118 118 lock (m_stateMachine) {
119 119 Move(cmd);
120 120
121 121 prev = m_pending;
122 122
123 123 Action<Exception> errorOrCancel = e => {
124 124 if (e == null)
125 125 e = new OperationCanceledException();
126 126
127 127 lock (m_stateMachine) {
128 128 if (m_pending == promise) {
129 129 Move(Commands.Fail);
130 130 m_pending = null;
131 131 m_lastError = e;
132 132 }
133 133 }
134 134 throw new PromiseTransientException(e);
135 135 };
136 136
137 137 promise = task.Then(
138 138 () => {
139 139 lock(m_stateMachine) {
140 140 if (m_pending == promise) {
141 141 Move(Commands.Ok);
142 142 m_pending = null;
143 143 }
144 144 }
145 145 },
146 146 errorOrCancel,
147 147 errorOrCancel
148 148 );
149 149
150 150 m_pending = promise;
151 151 }
152 152
153 153 if (prev == null)
154 154 task.Resolve();
155 155 else
156 156 chain(prev, task);
157 157
158 158 return promise;
159 159 }
160 160
161 161
162 162 #region IInitializable implementation
163 163
164 164 public void Init() {
165 165 Invoke(Commands.Init, OnInitialize);
166 166 }
167 167
168 168 protected virtual void OnInitialize() {
169 169 }
170 170
171 171 #endregion
172 172
173 173 #region IRunnable implementation
174 174
175 175 public IPromise Start() {
176 176 return InvokeAsync(Commands.Start, OnStart, null);
177 177 }
178 178
179 179 protected virtual IPromise OnStart() {
180 180 return Promise.SUCCESS;
181 181 }
182 182
183 183 public IPromise Stop() {
184 184 return InvokeAsync(Commands.Stop, OnStop, StopPending).Then(Dispose);
185 185 }
186 186
187 187 protected virtual IPromise OnStop() {
188 188 return Promise.SUCCESS;
189 189 }
190 190
191 191 /// <summary>
192 192 /// Stops the current operation if one exists.
193 193 /// </summary>
194 194 /// <param name="current">Current.</param>
195 195 /// <param name="stop">Stop.</param>
196 196 protected virtual void StopPending(IPromise current, IDeferred stop) {
197 197 if (current == null) {
198 198 stop.Resolve();
199 199 } else {
200 200 // связваСм Ρ‚Π΅ΠΊΡƒΡ‰ΡƒΡŽ ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΡŽ с ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠ΅ΠΉ остановки
201 201 current.On(
202 202 stop.Resolve, // Ссли тСкущая опСрация Π·Π°Π²Π΅Ρ€Ρ‰ΠΈΠ»Π°ΡΡŒ, Ρ‚ΠΎ ΠΌΠΎΠΆΠ½ΠΎ Π½Π°Ρ‡ΠΈΠ½Π°Ρ‚ΡŒ остановку
203 203 stop.Reject, // Ссли тСкущая опСрация Π΄Π°Π»Π° ΠΎΡˆΠΈΠ±ΠΊΡƒ - Ρ‚ΠΎ всС ΠΏΠ»ΠΎΡ…ΠΎ, нСльзя ΠΏΡ€ΠΎΠ΄ΠΎΠ»ΠΆΠ°Ρ‚ΡŒ
204 204 e => stop.Resolve() // Ссли тСкущая ΠΎΡ‚ΠΌΠ΅Π½ΠΈΠ»Π°ΡΡŒ, Ρ‚ΠΎ ΠΌΠΎΠΆΠ½ΠΎ Π½Π°Ρ‡ΠΈΠ½Π°Ρ‚ΡŒ остановку
205 205 );
206 206 // посылаСм Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ сигнал остановки
207 207 current.Cancel();
208 208 }
209 209 }
210 210
211 211 public ExecutionState State {
212 212 get {
213 return m_stateMachine.State;
213 lock (m_stateMachine)
214 return m_stateMachine.State;
214 215 }
215 216 }
216 217
217 218 public Exception LastError {
218 219 get {
219 220 return m_lastError;
220 221 }
221 222 }
222 223
223 224 #endregion
224 225
225 226 #region IDisposable implementation
226 227
227 228 public void Dispose() {
228 229 IPromise pending;
229 230 lock (m_stateMachine) {
230 231 if (m_stateMachine.State == ExecutionState.Disposed)
231 232 return;
232 233
233 234 Move(Commands.Dispose);
234 235
235 236 GC.SuppressFinalize(this);
236 237
237 238 pending = m_pending;
238 239 m_pending = null;
239 240 }
240 241 if (pending != null) {
241 242 pending.Cancel();
242 243 pending.Timeout(DisposeTimeout).On(
243 244 () => Dispose(true, null),
244 245 err => Dispose(true, err),
245 246 reason => Dispose(true, new OperationCanceledException("The operation is cancelled", reason))
246 247 );
247 248 } else {
248 249 Dispose(true, m_lastError);
249 250 }
250 251 }
251 252
252 253 ~RunnableComponent() {
253 254 Dispose(false, null);
254 255 }
255 256
256 257 #endregion
257 258
258 259 protected virtual void Dispose(bool disposing, Exception lastError) {
259 260
260 261 }
261 262
262 263 }
263 264 }
264 265
@@ -1,275 +1,276
1 1 ο»Ώ<?xml version="1.0" encoding="utf-8"?>
2 2 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 3 <PropertyGroup>
4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5 5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6 6 <ProjectGuid>{F550F1F8-8746-4AD0-9614-855F4C4B7F05}</ProjectGuid>
7 7 <OutputType>Library</OutputType>
8 8 <RootNamespace>Implab</RootNamespace>
9 9 <AssemblyName>Implab</AssemblyName>
10 10 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
11 11 <ReleaseVersion>0.2</ReleaseVersion>
12 12 <ProductVersion>8.0.30703</ProductVersion>
13 13 <SchemaVersion>2.0</SchemaVersion>
14 14 </PropertyGroup>
15 15 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16 16 <DebugSymbols>true</DebugSymbols>
17 17 <DebugType>full</DebugType>
18 18 <Optimize>false</Optimize>
19 19 <OutputPath>bin\Debug</OutputPath>
20 20 <DefineConstants>TRACE;DEBUG;</DefineConstants>
21 21 <ErrorReport>prompt</ErrorReport>
22 22 <WarningLevel>4</WarningLevel>
23 23 <ConsolePause>false</ConsolePause>
24 24 <RunCodeAnalysis>true</RunCodeAnalysis>
25 25 </PropertyGroup>
26 26 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27 27 <DebugType>full</DebugType>
28 28 <Optimize>true</Optimize>
29 29 <OutputPath>bin\Release</OutputPath>
30 30 <ErrorReport>prompt</ErrorReport>
31 31 <WarningLevel>4</WarningLevel>
32 32 <ConsolePause>false</ConsolePause>
33 33 </PropertyGroup>
34 34 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug 4.5|AnyCPU' ">
35 35 <DebugSymbols>true</DebugSymbols>
36 36 <DebugType>full</DebugType>
37 37 <Optimize>false</Optimize>
38 38 <OutputPath>bin\Debug</OutputPath>
39 39 <DefineConstants>TRACE;DEBUG;NET_4_5</DefineConstants>
40 40 <ErrorReport>prompt</ErrorReport>
41 41 <WarningLevel>4</WarningLevel>
42 42 <RunCodeAnalysis>true</RunCodeAnalysis>
43 43 <ConsolePause>false</ConsolePause>
44 44 </PropertyGroup>
45 45 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release 4.5|AnyCPU' ">
46 46 <Optimize>true</Optimize>
47 47 <OutputPath>bin\Release</OutputPath>
48 48 <ErrorReport>prompt</ErrorReport>
49 49 <WarningLevel>4</WarningLevel>
50 50 <ConsolePause>false</ConsolePause>
51 51 <DefineConstants>NET_4_5</DefineConstants>
52 52 </PropertyGroup>
53 53 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugMono|AnyCPU' ">
54 54 <DebugSymbols>true</DebugSymbols>
55 55 <DebugType>full</DebugType>
56 56 <Optimize>false</Optimize>
57 57 <OutputPath>bin\Debug</OutputPath>
58 58 <DefineConstants>TRACE;DEBUG;NET_4_5;MONO</DefineConstants>
59 59 <ErrorReport>prompt</ErrorReport>
60 60 <WarningLevel>4</WarningLevel>
61 61 <RunCodeAnalysis>true</RunCodeAnalysis>
62 62 <ConsolePause>false</ConsolePause>
63 63 </PropertyGroup>
64 64 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseMono|AnyCPU' ">
65 65 <Optimize>true</Optimize>
66 66 <OutputPath>bin\Release</OutputPath>
67 67 <DefineConstants>NET_4_5;MONO;</DefineConstants>
68 68 <ErrorReport>prompt</ErrorReport>
69 69 <WarningLevel>4</WarningLevel>
70 70 <ConsolePause>false</ConsolePause>
71 71 </PropertyGroup>
72 72 <ItemGroup>
73 73 <Reference Include="System" />
74 74 <Reference Include="System.Xml" />
75 75 <Reference Include="mscorlib" />
76 76 </ItemGroup>
77 77 <ItemGroup>
78 78 <Compile Include="CustomEqualityComparer.cs" />
79 79 <Compile Include="Diagnostics\ConsoleTraceListener.cs" />
80 80 <Compile Include="Diagnostics\LogChannel.cs" />
81 81 <Compile Include="Diagnostics\LogicalOperation.cs" />
82 82 <Compile Include="Diagnostics\TextFileListener.cs" />
83 83 <Compile Include="Diagnostics\TraceLog.cs" />
84 84 <Compile Include="Diagnostics\TraceEvent.cs" />
85 85 <Compile Include="Diagnostics\TraceEventType.cs" />
86 86 <Compile Include="ICancellable.cs" />
87 87 <Compile Include="IProgressHandler.cs" />
88 88 <Compile Include="IProgressNotifier.cs" />
89 89 <Compile Include="IPromiseT.cs" />
90 90 <Compile Include="IPromise.cs" />
91 91 <Compile Include="IServiceLocator.cs" />
92 92 <Compile Include="ITaskController.cs" />
93 93 <Compile Include="Parallels\DispatchPool.cs" />
94 94 <Compile Include="Parallels\ArrayTraits.cs" />
95 95 <Compile Include="Parallels\MTQueue.cs" />
96 96 <Compile Include="Parallels\WorkerPool.cs" />
97 97 <Compile Include="ProgressInitEventArgs.cs" />
98 98 <Compile Include="Properties\AssemblyInfo.cs" />
99 99 <Compile Include="Parallels\AsyncPool.cs" />
100 100 <Compile Include="Safe.cs" />
101 101 <Compile Include="ValueEventArgs.cs" />
102 102 <Compile Include="PromiseExtensions.cs" />
103 103 <Compile Include="SyncContextPromise.cs" />
104 104 <Compile Include="Diagnostics\OperationContext.cs" />
105 105 <Compile Include="Diagnostics\TraceContext.cs" />
106 106 <Compile Include="Diagnostics\LogEventArgs.cs" />
107 107 <Compile Include="Diagnostics\LogEventArgsT.cs" />
108 108 <Compile Include="Diagnostics\Extensions.cs" />
109 109 <Compile Include="PromiseEventType.cs" />
110 110 <Compile Include="Parallels\AsyncQueue.cs" />
111 111 <Compile Include="PromiseT.cs" />
112 112 <Compile Include="IDeferred.cs" />
113 113 <Compile Include="IDeferredT.cs" />
114 114 <Compile Include="Promise.cs" />
115 115 <Compile Include="PromiseTransientException.cs" />
116 116 <Compile Include="Parallels\Signal.cs" />
117 117 <Compile Include="Parallels\SharedLock.cs" />
118 118 <Compile Include="Diagnostics\ILogWriter.cs" />
119 119 <Compile Include="Diagnostics\ListenerBase.cs" />
120 120 <Compile Include="Parallels\BlockingQueue.cs" />
121 121 <Compile Include="AbstractEvent.cs" />
122 122 <Compile Include="AbstractPromise.cs" />
123 123 <Compile Include="AbstractPromiseT.cs" />
124 124 <Compile Include="FuncTask.cs" />
125 125 <Compile Include="FuncTaskBase.cs" />
126 126 <Compile Include="FuncTaskT.cs" />
127 127 <Compile Include="ActionChainTaskBase.cs" />
128 128 <Compile Include="ActionChainTask.cs" />
129 129 <Compile Include="ActionChainTaskT.cs" />
130 130 <Compile Include="FuncChainTaskBase.cs" />
131 131 <Compile Include="FuncChainTask.cs" />
132 132 <Compile Include="FuncChainTaskT.cs" />
133 133 <Compile Include="ActionTaskBase.cs" />
134 134 <Compile Include="ActionTask.cs" />
135 135 <Compile Include="ActionTaskT.cs" />
136 136 <Compile Include="ICancellationToken.cs" />
137 137 <Compile Include="SuccessPromise.cs" />
138 138 <Compile Include="SuccessPromiseT.cs" />
139 139 <Compile Include="PromiseAwaiterT.cs" />
140 140 <Compile Include="PromiseAwaiter.cs" />
141 141 <Compile Include="Components\ComponentContainer.cs" />
142 142 <Compile Include="Components\Disposable.cs" />
143 143 <Compile Include="Components\DisposablePool.cs" />
144 144 <Compile Include="Components\ObjectPool.cs" />
145 145 <Compile Include="Components\ServiceLocator.cs" />
146 146 <Compile Include="Components\IInitializable.cs" />
147 147 <Compile Include="TaskController.cs" />
148 148 <Compile Include="Components\App.cs" />
149 149 <Compile Include="Components\IRunnable.cs" />
150 150 <Compile Include="Components\ExecutionState.cs" />
151 151 <Compile Include="Components\RunnableComponent.cs" />
152 152 <Compile Include="Components\IFactory.cs" />
153 153 <Compile Include="Automaton\IAlphabet.cs" />
154 154 <Compile Include="Automaton\ParserException.cs" />
155 155 <Compile Include="Automaton\IndexedAlphabetBase.cs" />
156 156 <Compile Include="Automaton\IAlphabetBuilder.cs" />
157 157 <Compile Include="Automaton\RegularExpressions\AltToken.cs" />
158 158 <Compile Include="Automaton\RegularExpressions\BinaryToken.cs" />
159 159 <Compile Include="Automaton\RegularExpressions\CatToken.cs" />
160 160 <Compile Include="Automaton\RegularExpressions\StarToken.cs" />
161 161 <Compile Include="Automaton\RegularExpressions\SymbolToken.cs" />
162 162 <Compile Include="Automaton\RegularExpressions\EmptyToken.cs" />
163 163 <Compile Include="Automaton\RegularExpressions\Token.cs" />
164 164 <Compile Include="Automaton\RegularExpressions\IVisitor.cs" />
165 165 <Compile Include="Automaton\AutomatonTransition.cs" />
166 166 <Compile Include="Formats\JSON\JSONElementContext.cs" />
167 167 <Compile Include="Formats\JSON\JSONElementType.cs" />
168 168 <Compile Include="Formats\JSON\JSONGrammar.cs" />
169 169 <Compile Include="Formats\JSON\JSONParser.cs" />
170 170 <Compile Include="Formats\JSON\JSONScanner.cs" />
171 171 <Compile Include="Formats\JSON\JsonTokenType.cs" />
172 172 <Compile Include="Formats\JSON\JSONWriter.cs" />
173 173 <Compile Include="Formats\JSON\JSONXmlReader.cs" />
174 174 <Compile Include="Formats\JSON\JSONXmlReaderOptions.cs" />
175 175 <Compile Include="Formats\JSON\StringTranslator.cs" />
176 176 <Compile Include="Automaton\MapAlphabet.cs" />
177 177 <Compile Include="Formats\CharAlphabet.cs" />
178 178 <Compile Include="Formats\ByteAlphabet.cs" />
179 179 <Compile Include="Automaton\IDFATable.cs" />
180 180 <Compile Include="Automaton\IDFATableBuilder.cs" />
181 181 <Compile Include="Automaton\DFATable.cs" />
182 182 <Compile Include="Automaton\RegularExpressions\RegularExpressionVisitor.cs" />
183 183 <Compile Include="Automaton\RegularExpressions\ITaggedDFABuilder.cs" />
184 184 <Compile Include="Formats\TextScanner.cs" />
185 185 <Compile Include="Formats\StringScanner.cs" />
186 186 <Compile Include="Formats\ReaderScanner.cs" />
187 187 <Compile Include="Formats\ScannerContext.cs" />
188 188 <Compile Include="Formats\Grammar.cs" />
189 189 <Compile Include="Automaton\RegularExpressions\EndTokenT.cs" />
190 190 <Compile Include="Automaton\RegularExpressions\EndToken.cs" />
191 191 <Compile Include="Automaton\RegularExpressions\RegularExpressionVisitorT.cs" />
192 192 <Compile Include="Automaton\AutomatonConst.cs" />
193 193 <Compile Include="Automaton\RegularExpressions\RegularDFA.cs" />
194 194 <Compile Include="Components\LazyAndWeak.cs" />
195 195 <Compile Include="AbstractTask.cs" />
196 196 <Compile Include="AbstractTaskT.cs" />
197 <Compile Include="Components\PollingRunnableComponent.cs" />
197 198 </ItemGroup>
198 199 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
199 200 <ItemGroup />
200 201 <ProjectExtensions>
201 202 <MonoDevelop>
202 203 <Properties>
203 204 <Policies>
204 205 <CSharpFormattingPolicy IndentSwitchBody="True" NamespaceBraceStyle="EndOfLine" ClassBraceStyle="EndOfLine" InterfaceBraceStyle="EndOfLine" StructBraceStyle="EndOfLine" EnumBraceStyle="EndOfLine" MethodBraceStyle="EndOfLine" ConstructorBraceStyle="EndOfLine" DestructorBraceStyle="EndOfLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" NewLineBeforeConstructorInitializerColon="NewLine" NewLineAfterConstructorInitializerColon="SameLine" BeforeIndexerDeclarationBracket="False" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" SpacesBeforeBrackets="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
205 206 <TextStylePolicy FileWidth="120" EolMarker="Unix" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
206 207 <DotNetNamingPolicy DirectoryNamespaceAssociation="PrefixedHierarchical" ResourceNamePolicy="MSBuild" />
207 208 <TextStylePolicy FileWidth="120" TabsToSpaces="False" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="application/xml" />
208 209 <XmlFormattingPolicy inheritsSet="Mono" inheritsScope="application/xml" scope="application/xml" />
209 210 <TextStylePolicy FileWidth="120" TabsToSpaces="False" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/plain" />
210 211 <NameConventionPolicy>
211 212 <Rules>
212 213 <NamingRule Name="Namespaces" AffectedEntity="Namespace" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
213 214 <NamingRule Name="Types" AffectedEntity="Class, Struct, Enum, Delegate" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
214 215 <NamingRule Name="Interfaces" AffectedEntity="Interface" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True">
215 216 <RequiredPrefixes>
216 217 <String>I</String>
217 218 </RequiredPrefixes>
218 219 </NamingRule>
219 220 <NamingRule Name="Attributes" AffectedEntity="CustomAttributes" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True">
220 221 <RequiredSuffixes>
221 222 <String>Attribute</String>
222 223 </RequiredSuffixes>
223 224 </NamingRule>
224 225 <NamingRule Name="Event Arguments" AffectedEntity="CustomEventArgs" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True">
225 226 <RequiredSuffixes>
226 227 <String>EventArgs</String>
227 228 </RequiredSuffixes>
228 229 </NamingRule>
229 230 <NamingRule Name="Exceptions" AffectedEntity="CustomExceptions" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True">
230 231 <RequiredSuffixes>
231 232 <String>Exception</String>
232 233 </RequiredSuffixes>
233 234 </NamingRule>
234 235 <NamingRule Name="Methods" AffectedEntity="Methods" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
235 236 <NamingRule Name="Static Readonly Fields" AffectedEntity="ReadonlyField" VisibilityMask="Internal, Protected, Public" NamingStyle="CamelCase" IncludeInstanceMembers="False" IncludeStaticEntities="True" />
236 237 <NamingRule Name="Fields (Non Private)" AffectedEntity="Field" VisibilityMask="Internal, Public" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
237 238 <NamingRule Name="ReadOnly Fields (Non Private)" AffectedEntity="ReadonlyField" VisibilityMask="Internal, Public" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="False" />
238 239 <NamingRule Name="Fields (Private)" AffectedEntity="Field, ReadonlyField" VisibilityMask="Private, Protected" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="False">
239 240 <RequiredPrefixes>
240 241 <String>m_</String>
241 242 </RequiredPrefixes>
242 243 </NamingRule>
243 244 <NamingRule Name="Static Fields (Private)" AffectedEntity="Field" VisibilityMask="Private" NamingStyle="CamelCase" IncludeInstanceMembers="False" IncludeStaticEntities="True">
244 245 <RequiredPrefixes>
245 246 <String>_</String>
246 247 </RequiredPrefixes>
247 248 </NamingRule>
248 249 <NamingRule Name="ReadOnly Fields (Private)" AffectedEntity="ReadonlyField" VisibilityMask="Private, Protected" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="False">
249 250 <RequiredPrefixes>
250 251 <String>m_</String>
251 252 </RequiredPrefixes>
252 253 </NamingRule>
253 254 <NamingRule Name="Constant Fields" AffectedEntity="ConstantField" VisibilityMask="VisibilityMask" NamingStyle="AllUpper" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
254 255 <NamingRule Name="Properties" AffectedEntity="Property" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
255 256 <NamingRule Name="Events" AffectedEntity="Event" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
256 257 <NamingRule Name="Enum Members" AffectedEntity="EnumMember" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
257 258 <NamingRule Name="Parameters" AffectedEntity="Parameter, LocalVariable" VisibilityMask="VisibilityMask" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
258 259 <NamingRule Name="Type Parameters" AffectedEntity="TypeParameter" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True">
259 260 <RequiredPrefixes>
260 261 <String>T</String>
261 262 </RequiredPrefixes>
262 263 </NamingRule>
263 264 </Rules>
264 265 </NameConventionPolicy>
265 266 </Policies>
266 267 </Properties>
267 268 </MonoDevelop>
268 269 </ProjectExtensions>
269 270 <ItemGroup>
270 271 <Folder Include="Components\" />
271 272 <Folder Include="Automaton\RegularExpressions\" />
272 273 <Folder Include="Formats\" />
273 274 <Folder Include="Formats\JSON\" />
274 275 </ItemGroup>
275 276 </Project> No newline at end of file
General Comments 3
Under Review
author

Auto status change to "Under Review"

Approved
author

ok, latest stable version should be in default

You need to be logged in to leave comments. Login now