Beispiel #1
0
 public MarkupBlock(
     BlockType blockType,
     IParentChunkGenerator chunkGenerator,
     IEnumerable <SyntaxTreeNode> children)
     : base(blockType, children, chunkGenerator)
 {
 }
Beispiel #2
0
 public MarkupBlock(
     BlockKindInternal BlockKind,
     IParentChunkGenerator chunkGenerator,
     IReadOnlyList <SyntaxTreeNode> children)
     : base(BlockKind, children, chunkGenerator)
 {
 }
Beispiel #3
0
 public MarkupBlock(
     BlockType blockType,
     IParentChunkGenerator chunkGenerator,
     IReadOnlyList <SyntaxTreeNode> children)
     : base(blockType, children, chunkGenerator)
 {
 }
Beispiel #4
0
        public void Equals_False_WhenExpected(IParentChunkGenerator leftObject, object rightObject)
        {
            // Arrange & Act
            var result = leftObject.Equals(rightObject);

            // Assert
            Assert.False(result);
        }
Beispiel #5
0
        public void Equals_True_WhenExpected(RazorCommentChunkGenerator leftObject, IParentChunkGenerator rightObject)
        {
            // Arrange & Act
            var result = leftObject.Equals(rightObject);

            // Assert
            Assert.True(result);
        }
Beispiel #6
0
        public void Equals_False_WhenExpected(IParentChunkGenerator leftObject, object rightObject)
        {
            // Arrange & Act
            var result = leftObject.Equals(rightObject);

            // Assert
            Assert.False(result);
        }
Beispiel #7
0
        public void Equals_True_WhenExpected(RazorCommentChunkGenerator leftObject, IParentChunkGenerator rightObject)
        {
            // Arrange & Act
            var result = leftObject.Equals(rightObject);

            // Assert
            Assert.True(result);
        }
Beispiel #8
0
        public void GetHashCode_ReturnsSameValue_WhenEqual(
            RazorCommentChunkGenerator leftObject,
            IParentChunkGenerator rightObject)
        {
            // Arrange & Act
            var leftResult  = leftObject.GetHashCode();
            var rightResult = rightObject.GetHashCode();

            // Assert
            Assert.Equal(leftResult, rightResult);
        }
        public void GetHashCode_ReturnsSameValue_WhenEqual(
            RazorCommentChunkGenerator leftObject,
            IParentChunkGenerator rightObject)
        {
            // Arrange & Act
            var leftResult = leftObject.GetHashCode();
            var rightResult = rightObject.GetHashCode();

            // Assert
            Assert.Equal(leftResult, rightResult);
        }
Beispiel #10
0
        protected Block(BlockType?type, IEnumerable <SyntaxTreeNode> contents, IParentChunkGenerator generator)
        {
            if (type == null)
            {
                throw new InvalidOperationException(RazorResources.Block_Type_Not_Specified);
            }

            Type           = type.Value;
            Children       = contents;
            ChunkGenerator = generator;

            foreach (SyntaxTreeNode node in Children)
            {
                node.Parent = this;
            }
        }
Beispiel #11
0
        protected Block(BlockType? type, IEnumerable<SyntaxTreeNode> contents, IParentChunkGenerator generator)
        {
            if (type == null)
            {
                throw new InvalidOperationException(RazorResources.Block_Type_Not_Specified);
            }

            Type = type.Value;
            Children = contents;
            ChunkGenerator = generator;

            foreach (SyntaxTreeNode node in Children)
            {
                node.Parent = this;
            }
        }
Beispiel #12
0
        protected Block(BlockKindInternal?type, IReadOnlyList <SyntaxTreeNode> children, IParentChunkGenerator generator)
        {
            if (type == null)
            {
                throw new InvalidOperationException(Resources.Block_Type_Not_Specified);
            }

            Type           = type.Value;
            Children       = children;
            ChunkGenerator = generator;

            // Perf: Avoid allocating an enumerator.
            for (var i = 0; i < Children.Count; i++)
            {
                Children[i].Parent = this;
            }
        }
Beispiel #13
0
        protected Block(BlockType? type, IReadOnlyList<SyntaxTreeNode> contents, IParentChunkGenerator generator)
        {
            if (type == null)
            {
                throw new InvalidOperationException(RazorResources.Block_Type_Not_Specified);
            }

            Type = type.Value;
            Children = contents;
            ChunkGenerator = generator;

            // Perf: Avoid allocating an enumerator.
            for (var i = 0; i < Children.Count; i++)
            {
                Children[i].Parent = this;
            }
        }
Beispiel #14
0
 public DirectiveBlock(IParentChunkGenerator chunkGenerator, IReadOnlyList <SyntaxTreeNode> children)
     : base(ThisBlockKind, children, chunkGenerator)
 {
 }
Beispiel #15
0
 public ExpressionBlock(IParentChunkGenerator chunkGenerator, params SyntaxTreeNode[] children)
     : this(chunkGenerator, (IEnumerable <SyntaxTreeNode>)children)
 {
 }
Beispiel #16
0
 public ExpressionBlock(IParentChunkGenerator chunkGenerator, IEnumerable <SyntaxTreeNode> children)
     : base(ThisBlockType, children, chunkGenerator)
 {
 }
Beispiel #17
0
 public DirectiveBlock(IParentChunkGenerator chunkGenerator, params SyntaxTreeNode[] children)
     : this(chunkGenerator, (IEnumerable <SyntaxTreeNode>)children)
 {
 }
Beispiel #18
0
 public DirectiveBlock(IParentChunkGenerator chunkGenerator, IEnumerable <SyntaxTreeNode> children)
     : base(ThisBlockType, children, chunkGenerator)
 {
 }
Beispiel #19
0
 public MarkupBlock(IParentChunkGenerator chunkGenerator, IEnumerable <SyntaxTreeNode> children)
     : this(ThisBlockType, chunkGenerator, children)
 {
 }
Beispiel #20
0
 public DirectiveBlock(IParentChunkGenerator chunkGenerator, IEnumerable<SyntaxTreeNode> children)
     : base(ThisBlockType, children, chunkGenerator)
 {
 }
Beispiel #21
0
 // A Test constructor
 internal Block(BlockType type, IReadOnlyList <SyntaxTreeNode> contents, IParentChunkGenerator generator)
 {
     Type           = type;
     ChunkGenerator = generator;
     Children       = contents;
 }
Beispiel #22
0
 // A Test constructor
 internal Block(BlockType type, IEnumerable <SyntaxTreeNode> contents, IParentChunkGenerator generator)
 {
     Type           = type;
     ChunkGenerator = generator;
     Children       = contents;
 }
Beispiel #23
0
 public MarkupBlock(
     BlockType blockType,
     IParentChunkGenerator chunkGenerator,
     IEnumerable<SyntaxTreeNode> children)
     : base(blockType, children, chunkGenerator)
 {
 }
Beispiel #24
0
 public ExpressionBlock(IParentChunkGenerator chunkGenerator, params SyntaxTreeNode[] children)
     : this(chunkGenerator, (IReadOnlyList <SyntaxTreeNode>)children)
 {
 }
Beispiel #25
0
 public MarkupBlock(IParentChunkGenerator chunkGenerator, IReadOnlyList <SyntaxTreeNode> children)
     : this(ThisBlockType, chunkGenerator, children)
 {
 }
Beispiel #26
0
 public DirectiveBlock(IParentChunkGenerator chunkGenerator, params SyntaxTreeNode[] children)
     : this(chunkGenerator, (IEnumerable<SyntaxTreeNode>)children)
 {
 }
Beispiel #27
0
 public virtual void Reset()
 {
     Type = null;
     Children = new List<SyntaxTreeNode>();
     ChunkGenerator = ParentChunkGenerator.Null;
 }
Beispiel #28
0
 // A Test constructor
 internal Block(BlockType type, IEnumerable<SyntaxTreeNode> contents, IParentChunkGenerator generator)
 {
     Type = type;
     ChunkGenerator = generator;
     Children = contents;
 }
Beispiel #29
0
 public ExpressionBlock(IParentChunkGenerator chunkGenerator, IEnumerable<SyntaxTreeNode> children)
     : base(ThisBlockType, children, chunkGenerator)
 {
 }
Beispiel #30
0
 public MarkupBlock(IParentChunkGenerator chunkGenerator, IEnumerable<SyntaxTreeNode> children)
     : this(ThisBlockType, chunkGenerator, children)
 {
 }
Beispiel #31
0
 public ExpressionBlock(IParentChunkGenerator chunkGenerator, IReadOnlyList <SyntaxTreeNode> children)
     : base(ThisBlockType, children, chunkGenerator)
 {
 }
Beispiel #32
0
 public ExpressionBlock(IParentChunkGenerator chunkGenerator, params SyntaxTreeNode[] children)
     : this(chunkGenerator, (IEnumerable<SyntaxTreeNode>)children)
 {
 }
Beispiel #33
0
 public virtual void Reset()
 {
     Type           = null;
     Children       = new List <SyntaxTreeNode>();
     ChunkGenerator = ParentChunkGenerator.Null;
 }
Beispiel #34
0
 // A Test constructor
 internal Block(BlockType type, IReadOnlyList<SyntaxTreeNode> contents, IParentChunkGenerator generator)
 {
     Type = type;
     ChunkGenerator = generator;
     Children = contents;
 }