~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/Newtonsoft.Json/Src/Newtonsoft.Json/StreamingContext.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if PocketPC
 
2
#pragma warning disable 1591
 
3
 
 
4
// This class is... borrowed from .NET and Microsoft for a short time.
 
5
// Hopefully Microsoft will add DateTimeOffset to the compact framework
 
6
// or I will rewrite a striped down version of this file myself
 
7
 
 
8
namespace System.Runtime.Serialization
 
9
{
 
10
  public enum StreamingContextStates
 
11
  {
 
12
    All = 255,
 
13
    Clone = 64,
 
14
    CrossAppDomain = 128,
 
15
    CrossMachine = 2,
 
16
    CrossProcess = 1,
 
17
    File = 4,
 
18
    Other = 32,
 
19
    Persistence = 8,
 
20
    Remoting = 16
 
21
  }
 
22
 
 
23
  public struct StreamingContext
 
24
  {
 
25
    internal object m_additionalContext;
 
26
    internal StreamingContextStates m_state;
 
27
    public StreamingContext(StreamingContextStates state)
 
28
      : this(state, null)
 
29
    {
 
30
    }
 
31
 
 
32
    public StreamingContext(StreamingContextStates state, object additional)
 
33
    {
 
34
      this.m_state = state;
 
35
      this.m_additionalContext = additional;
 
36
    }
 
37
 
 
38
    public object Context
 
39
    {
 
40
      get
 
41
      {
 
42
        return this.m_additionalContext;
 
43
      }
 
44
    }
 
45
    public override bool Equals(object obj)
 
46
    {
 
47
      return ((obj is StreamingContext) && ((((StreamingContext)obj).m_additionalContext == this.m_additionalContext) && (((StreamingContext)obj).m_state == this.m_state)));
 
48
    }
 
49
 
 
50
    public override int GetHashCode()
 
51
    {
 
52
      return (int)this.m_state;
 
53
    }
 
54
 
 
55
    public StreamingContextStates State
 
56
    {
 
57
      get
 
58
      {
 
59
        return this.m_state;
 
60
      }
 
61
    }
 
62
  }
 
63
}
 
64
#endif
 
 
b'\\ No newline at end of file'