Welcome to mirror list, hosted at ThFree Co, Russian Federation.

StreamingContext.cs « System.Runtime.Serialization « corlib « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c1b5a530fde756335c44f3fe4f44819f07fe097f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// System.Runtime.Serialization.StreamingContext.cs
//
// Author:
//   Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc.  http://www.ximian.com
//

namespace System.Runtime.Serialization {

	[Serializable]
	public struct StreamingContext {
		StreamingContextStates state;
		object additional;
		
		public StreamingContext (StreamingContextStates state)
		{
			this.state = state;
			additional = null;
		}

		public StreamingContext (StreamingContextStates state, object additional)
		{
			this.state = state;
			this.additional = additional;
		}

		public object Context {
			get {
				return additional;
			}
		}

		public StreamingContextStates State {
			get {
				return state;
			}
		}

		override public bool Equals (Object o)
		{
			StreamingContext other;
			
			if (!(o is StreamingContext))
				return false;

			other = (StreamingContext) o;

			return (other.state == this.state) && (other.additional == this.additional);
		}

		override public int GetHashCode ()
		{
			return (int) state;
		}
	}
}