0
|
1 ???using System; |
|
2 using System.Collections.Generic; |
|
3 using System.Text; |
|
4 |
|
5 namespace UCIS.Pml { |
|
6 public class PmlCallReceivedEventArgs : EventArgs { |
|
7 private PmlElement _request; |
|
8 private PmlElement _reply; |
|
9 private UInt32 _sid; |
|
10 private bool _wantReply; |
|
11 |
|
12 internal PmlCallReceivedEventArgs(PmlElement request, bool wantReply, UInt32 sid) { |
|
13 _request = request; |
|
14 _wantReply = wantReply; |
|
15 _sid = sid; |
|
16 _reply = null; |
|
17 } |
|
18 public bool WantReply { |
|
19 get { return _wantReply; } |
|
20 } |
|
21 internal UInt32 SID { |
|
22 get { return _sid; } |
|
23 } |
|
24 public PmlElement Reply { |
|
25 get { return _reply; } |
|
26 set { _reply = value; } |
|
27 } |
|
28 public PmlElement Request { |
|
29 get { return _request; } |
|
30 } |
|
31 } |
|
32 public abstract class PmlChannelRequestReceivedEventArgs : EventArgs { |
|
33 public abstract IPmlChannel Accept(); |
|
34 public abstract void Reject(); |
|
35 public abstract PmlElement Data { get; } |
|
36 } |
|
37 public interface IPmlCommunicator { |
|
38 event EventHandler<PmlCallReceivedEventArgs> CallReceived; |
|
39 event EventHandler<PmlChannelRequestReceivedEventArgs> ChannelRequestReceived; |
|
40 |
|
41 void Call(PmlElement message); |
|
42 PmlElement Invoke(PmlElement message); |
|
43 |
|
44 IAsyncResult BeginInvoke(PmlElement message, AsyncCallback callback, Object state); |
|
45 PmlElement EndInvoke(IAsyncResult result); |
|
46 |
|
47 IPmlChannel CreateChannel(PmlElement data); |
|
48 IAsyncResult BeginCreateChannel(PmlElement data, AsyncCallback callback, Object state); |
|
49 IPmlChannel EndCreateChannel(IAsyncResult result); |
|
50 } |
|
51 } |