Src/Newtonsoft.Json/StreamingContext.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

#if PocketPC
#pragma warning disable 1591

// This class is... borrowed from .NET and Microsoft for a short time.
// Hopefully Microsoft will add DateTimeOffset to the compact framework
// or I will rewrite a striped down version of this file myself

namespace System.Runtime.Serialization
{
  public enum StreamingContextStates
  {
    All = 255,
    Clone = 64,
    CrossAppDomain = 128,
    CrossMachine = 2,
    CrossProcess = 1,
    File = 4,
    Other = 32,
    Persistence = 8,
    Remoting = 16
  }

  public struct StreamingContext
  {
    internal object m_additionalContext;
    internal StreamingContextStates m_state;
    public StreamingContext(StreamingContextStates state)
      : this(state, null)
    {
    }

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

    public object Context
    {
      get
      {
        return this.m_additionalContext;
      }
    }
    public override bool Equals(object obj)
    {
      return ((obj is StreamingContext) && ((((StreamingContext)obj).m_additionalContext == this.m_additionalContext) && (((StreamingContext)obj).m_state == this.m_state)));
    }

    public override int GetHashCode()
    {
      return (int)this.m_state;
    }

    public StreamingContextStates State
    {
      get
      {
        return this.m_state;
      }
后面还有 4 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。