3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 /*============================================================
8 ** ValueType: StreamingContext
11 ** Purpose: A value type indicating the source or destination of our streaming.
14 ===========================================================*/
15 namespace System
.Runtime
.Serialization
{
17 using System
.Runtime
.Remoting
;
20 [System
.Runtime
.InteropServices
.ComVisible(true)]
21 public struct StreamingContext
{
22 internal Object m_additionalContext
;
23 internal StreamingContextStates m_state
;
25 public StreamingContext(StreamingContextStates state
)
26 : this (state
, null) {
29 public StreamingContext(StreamingContextStates state
, Object additional
) {
31 m_additionalContext
= additional
;
34 public Object Context
{
35 get { return m_additionalContext; }
38 public override bool Equals(Object obj
) {
39 if (!(obj
is StreamingContext
)) {
42 if (((StreamingContext
)obj
).m_additionalContext
== m_additionalContext
&&
43 ((StreamingContext
)obj
).m_state
== m_state
) {
49 public override int GetHashCode() {
53 public StreamingContextStates State
{
54 get { return m_state; }
58 // **********************************************************
59 // Keep these in sync with the version in vm\runtimehandles.h
60 // **********************************************************
63 [System
.Runtime
.InteropServices
.ComVisible(true)]
64 public enum StreamingContextStates
{