annotate Implab/IPromise.cs @ 9:c82e0dfbb4dd promises

sync
author cin
date Sat, 02 Nov 2013 00:55:47 +0400
parents 7ea9363fef6c
children aa33d0bb8c0c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
1 using System;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
2 using System.Collections.Generic;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
3 using System.Linq;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
4 using System.Text;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
5
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
6 namespace Implab
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
7 {
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
8 public interface IPromise
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
9 {
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
10 /// <summary>
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
11 /// Check whereather the promise has no more than one dependent promise.
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
12 /// </summary>
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
13 bool IsExclusive
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
14 {
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
15 get;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
16 }
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
17
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
18 /// <summary>
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
19 /// The current state of the promise.
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
20 /// </summary>
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
21 PromiseState State
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
22 {
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
23 get;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
24 }
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
25
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
26 /// <summary>
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
27 /// Tries to cancel the promise or the complete chain.
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
28 /// </summary>
9
cin
parents: 7
diff changeset
29 /// <param name="dependencies">Try to cancel the whole promise chain, the parent promise will be cancelled only if it has only one promise</param>
7
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
30 /// <returns></returns>
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
31 bool Cancel(bool dependencies);
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
32 }
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
33 }