using System;
using System.Runtime.InteropServices;
namespace System.Runtime.Serialization
{
/// Describes the source and destination of a given serialized stream, and provides an additional caller-defined context.
// Token: 0x02000497 RID: 1175
[ComVisible(true)]
[Serializable]
public struct StreamingContext
{
/// Initializes a new instance of the class with a given context state.
/// A bitwise combination of the values that specify the source or destination context for this .
// Token: 0x06002C88 RID: 11400 RVA: 0x000928EC File Offset: 0x00090AEC
public StreamingContext(StreamingContextStates state)
{
this.state = state;
this.additional = null;
}
/// Initializes a new instance of the class with a given context state, and some additional information.
/// A bitwise combination of the values that specify the source or destination context for this .
/// Any additional information to be associated with the . This information is available to any object that implements or any serialization surrogate. Most users do not need to set this parameter.
// Token: 0x06002C89 RID: 11401 RVA: 0x000928FC File Offset: 0x00090AFC
public StreamingContext(StreamingContextStates state, object additional)
{
this.state = state;
this.additional = additional;
}
/// Gets context specified as part of the additional context.
/// The context specified as part of the additional context.
// Token: 0x170008AF RID: 2223
// (get) Token: 0x06002C8A RID: 11402 RVA: 0x0009290C File Offset: 0x00090B0C
public object Context
{
get
{
return this.additional;
}
}
/// Gets the source or destination of the transmitted data.
/// During serialization, the destination of the transmitted data. During deserialization, the source of the data.
// Token: 0x170008B0 RID: 2224
// (get) Token: 0x06002C8B RID: 11403 RVA: 0x00092914 File Offset: 0x00090B14
public StreamingContextStates State
{
get
{
return this.state;
}
}
/// Determines whether two instances contain the same values.
/// true if the specified object is an instance of and equals the value of the current instance; otherwise, false.
/// An object to compare with the current instance.
// Token: 0x06002C8C RID: 11404 RVA: 0x0009291C File Offset: 0x00090B1C
public override bool Equals(object obj)
{
if (!(obj is StreamingContext))
{
return false;
}
StreamingContext streamingContext = (StreamingContext)obj;
return streamingContext.state == this.state && streamingContext.additional == this.additional;
}
/// Returns a hash code of this object.
/// The value that contains the source or destination of the serialization for this .
// Token: 0x06002C8D RID: 11405 RVA: 0x00092964 File Offset: 0x00090B64
public override int GetHashCode()
{
return (int)this.state;
}
// Token: 0x0400113A RID: 4410
private StreamingContextStates state;
// Token: 0x0400113B RID: 4411
private object additional;
}
}