コード例 #1
0
 /// <summary>
 /// Throws if disposed instance.
 /// </summary>
 /// <param name="parsedContextStreamParent">The parsed context stream parent.</param>
 /// <exception cref="ObjectDisposedException">Thrown if specified object is <see cref="Instance"/>.</exception>
 public static void ThrowIfDisposedInstance(IParsingContextStreamParent parsedContextStreamParent)
 {
     if (ReferenceEquals(Instance, parsedContextStreamParent))
     {
         throw new ObjectDisposedException(DisposedObjectName);
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes the new instance of the <see cref="ISourceCodeFragment" /> type.
 /// </summary>
 /// <param name="parent">The source code parent.</param>
 /// <param name="offset">The absolute source code offset, where the fragment starts.</param>
 /// <param name="length">The length of the source code fragment.</param>
 public SourceCodeFragment(IParsingContextStreamParent parent, int offset, int length)
 {
     _cachedValue   = null;
     _parent        = parent;
     SourcePosition = offset;
     Count          = length;
 }
コード例 #3
0
        /// <inheritdoc />
        public ISourceCodeFragment Create(IParsingContextStreamParent parent, int offset, int length)
        {
            if (length <= 0)
            {
                return(ParserExtensions.EmptyFragment);
            }

            return(new SourceCodeFragment(parent, offset, length));
        }
コード例 #4
0
 /// <inheritdoc />
 public IParsingContextStream Create(IParsingContextStreamParent parent, int offset, int maxDeep, ICacheParsingResults cache)
 {
     return(new ParsingContextStream(_productFactory, parent, offset, maxDeep, cache));
 }