Files
2026-06-04 11:42:34 +02:00

84 lines
4.0 KiB
C#

using System;
using System.Runtime.InteropServices;
namespace System.Runtime.Serialization
{
/// <summary>Describes the source and destination of a given serialized stream, and provides an additional caller-defined context.</summary>
// Token: 0x02000497 RID: 1175
[ComVisible(true)]
[Serializable]
public struct StreamingContext
{
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Serialization.StreamingContext" /> class with a given context state.</summary>
/// <param name="state">A bitwise combination of the <see cref="T:System.Runtime.Serialization.StreamingContextStates" /> values that specify the source or destination context for this <see cref="T:System.Runtime.Serialization.StreamingContext" />. </param>
// Token: 0x06002C88 RID: 11400 RVA: 0x000928EC File Offset: 0x00090AEC
public StreamingContext(StreamingContextStates state)
{
this.state = state;
this.additional = null;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Serialization.StreamingContext" /> class with a given context state, and some additional information.</summary>
/// <param name="state">A bitwise combination of the <see cref="T:System.Runtime.Serialization.StreamingContextStates" /> values that specify the source or destination context for this <see cref="T:System.Runtime.Serialization.StreamingContext" />. </param>
/// <param name="additional">Any additional information to be associated with the <see cref="T:System.Runtime.Serialization.StreamingContext" />. This information is available to any object that implements <see cref="T:System.Runtime.Serialization.ISerializable" /> or any serialization surrogate. Most users do not need to set this parameter. </param>
// Token: 0x06002C89 RID: 11401 RVA: 0x000928FC File Offset: 0x00090AFC
public StreamingContext(StreamingContextStates state, object additional)
{
this.state = state;
this.additional = additional;
}
/// <summary>Gets context specified as part of the additional context.</summary>
/// <returns>The context specified as part of the additional context.</returns>
// Token: 0x170008AF RID: 2223
// (get) Token: 0x06002C8A RID: 11402 RVA: 0x0009290C File Offset: 0x00090B0C
public object Context
{
get
{
return this.additional;
}
}
/// <summary>Gets the source or destination of the transmitted data.</summary>
/// <returns>During serialization, the destination of the transmitted data. During deserialization, the source of the data.</returns>
// Token: 0x170008B0 RID: 2224
// (get) Token: 0x06002C8B RID: 11403 RVA: 0x00092914 File Offset: 0x00090B14
public StreamingContextStates State
{
get
{
return this.state;
}
}
/// <summary>Determines whether two <see cref="T:System.Runtime.Serialization.StreamingContext" /> instances contain the same values.</summary>
/// <returns>true if the specified object is an instance of <see cref="T:System.Runtime.Serialization.StreamingContext" /> and equals the value of the current instance; otherwise, false.</returns>
/// <param name="obj">An object to compare with the current instance. </param>
// 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;
}
/// <summary>Returns a hash code of this object.</summary>
/// <returns>The <see cref="T:System.Runtime.Serialization.StreamingContextStates" /> value that contains the source or destination of the serialization for this <see cref="T:System.Runtime.Serialization.StreamingContext" />.</returns>
// 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;
}
}