YamlSequenceNode

We found 10 examples in language CSharp for this search. You will see 26 fragments of code.

Other methods


        private void VisitYamlSequenceNode(YamlSequenceNode yamlNode)
        {
            foreach (var entry in yamlNode.Children)
            {
                if (entry is YamlMappingNode)
                    VisitYamlMappingNode((YamlMappingNode)entry);
            }
        }

        private void VisitYamlSequenceNode(YamlScalarNode yamlNodeKey, YamlSequenceNode yamlNodeValue)
        {
            EnterContext(yamlNodeKey.Value);
            VisitYamlSequenceNode(yamlNodeValue);
            ExitContext();
        }


        private YamlNode BuildSqsEvent(string queueRefName)
        {
            return new YamlMappingNode
            {
                { "sqs", new YamlMappingNode
                    {
                        { "arn", new YamlMappingNode { { "Fn::GetAtt", new YamlSequenceNode(queueRefName, "Arn") } } },
                    }
                },
            };
        }

        public static T?[]? ArrayProp<T>(this YamlNode yamlNode, string propertyName) where T : class
        {
            YamlMappingNode? mappingNode = yamlNode as YamlMappingNode;
            IEnumerable<string?>? result =
                (mappingNode?[propertyName] as YamlSequenceNode)?.Children.Select(i => (i as YamlScalarNode)?.Value);
            return result?.Select(i => i is null ? null : (T) Convert.ChangeType(i, typeof(T))).ToArray();
        }

        public static T?[]? ArrayProp<T>(this YamlNode yamlNode, string propertyName,
            Func<YamlSequenceNode?, T> converter) where T : class
        {
            YamlMappingNode? mappingNode = yamlNode as YamlMappingNode;
            T[]? result = (mappingNode?[propertyName] as YamlSequenceNode)?.Children
                .Select(i => converter(i as YamlSequenceNode)).ToArray();
            return result;
        }


        private void VisitYamlSequenceNode(YamlSequenceNode yamlNode)
        {
            foreach (var entry in yamlNode.Children)
            {
                if (entry is YamlMappingNode)
                    VisitYamlMappingNode((YamlMappingNode)entry);
            }
        }

        private void VisitYamlSequenceNode(YamlScalarNode yamlNodeKey, YamlSequenceNode yamlNodeValue)
        {
            EnterContext(yamlNodeKey.Value);
            VisitYamlSequenceNode(yamlNodeValue);
            ExitContext();
        }


        /// <summary>
        /// Called when this object is visiting a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that is being visited.
        /// </param>
        protected virtual void Visit(YamlSequenceNode sequence)
        {
            // Do nothing.
        }

        /// <summary>
        /// Called after this object finishes visiting a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that has been visited.
        /// </param>
        protected virtual void Visited(YamlSequenceNode sequence)
        {
            // Do nothing.
        }

        /// <summary>
        /// Visits every child of a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that is being visited.
        /// </param>
        protected virtual void VisitChildren(YamlSequenceNode sequence)
        {
            foreach (var node in sequence.Children)
            {
                node.Accept(this);
            }
        }

        void IYamlVisitor.Visit(YamlSequenceNode sequence)
        {
            Visit(sequence);
            VisitChildren(sequence);
            Visited(sequence);
        }


        public static float YamlSequencesHeuristic(YamlSequenceNode a, YamlSequenceNode b)
        {
            if (a.Children.Count != b.Children.Count)
                return 0.0f;
            if (a.Children.Count == 0)
                return 1.0f;
            var total = 0.0f;
            for (var i = 0; i < a.Children.Count; i++)
                total += YamlNodesHeuristic(a.Children[i], b.Children[i]);
            return total / a.Children.Count;
        }


        /// <summary>
        /// Called when this object is visiting a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that is being visited.
        /// </param>
        protected virtual void Visit(YamlSequenceNode sequence)
        {
            // Do nothing.
        }

        /// <summary>
        /// Called after this object finishes visiting a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that has been visited.
        /// </param>
        protected virtual void Visited(YamlSequenceNode sequence)
        {
            // Do nothing.
        }

        /// <summary>
        /// Visits every child of a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that is being visited.
        /// </param>
        protected virtual void VisitChildren(YamlSequenceNode sequence)
        {
            foreach (var node in sequence.Children)
            {
                node.Accept(this);
            }
        }

        void IYamlVisitor.Visit(YamlSequenceNode sequence)
        {
            Visit(sequence);
            VisitChildren(sequence);
            Visited(sequence);
        }


		/// <summary>
		/// Called when this object is visiting a <see cref="YamlSequenceNode"/>.
		/// </summary>
		/// <param name="sequence">
		/// The <see cref="YamlSequenceNode"/> that is being visited.
		/// </param>
		protected virtual void Visit (YamlSequenceNode sequence)
		{
			// Do nothing.
		}

		/// <summary>
		/// Called after this object finishes visiting a <see cref="YamlSequenceNode"/>.
		/// </summary>
		/// <param name="sequence">
		/// The <see cref="YamlSequenceNode"/> that has been visited.
		/// </param>
		protected virtual void Visited (YamlSequenceNode sequence)
		{
			// Do nothing.
		}

		/// <summary>
		/// Visits every child of a <see cref="YamlSequenceNode"/>.
		/// </summary>
		/// <param name="sequence">
		/// The <see cref="YamlSequenceNode"/> that is being visited.
		/// </param>
		protected virtual void VisitChildren(YamlSequenceNode sequence) {
			foreach (var node in sequence.Children) {
				node.Accept(this);
			}
		}

		void IYamlVisitor.Visit (YamlSequenceNode sequence)
		{
			Visit(sequence);
			VisitChildren(sequence);
			Visited(sequence);
		}


        /// <summary>
        /// Called when this object is visiting a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that is being visited.
        /// </param>
        protected virtual void Visit(YamlSequenceNode sequence)
        {
            // Do nothing.
        }

        /// <summary>
        /// Called after this object finishes visiting a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that has been visited.
        /// </param>
        protected virtual void Visited(YamlSequenceNode sequence)
        {
            // Do nothing.
        }

        /// <summary>
        /// Visits every child of a <see cref="YamlSequenceNode"/>.
        /// </summary>
        /// <param name="sequence">
        /// The <see cref="YamlSequenceNode"/> that is being visited.
        /// </param>
        protected virtual void VisitChildren(YamlSequenceNode sequence)
        {
            foreach (var node in sequence.Children)
            {
                node.Accept(this);
            }
        }

        void IYamlVisitor.Visit(YamlSequenceNode sequence)
        {
            Visit(sequence);
            VisitChildren(sequence);
            Visited(sequence);
        }


        private void VisitYamlSequenceNode(YamlSequenceNode yamlNode)
        {
            foreach (var entry in yamlNode.Children)
            {
                if (entry is YamlMappingNode)
                    VisitYamlMappingNode((YamlMappingNode)entry);
            }
        }

        private void VisitYamlSequenceNode(YamlScalarNode yamlNodeKey, YamlSequenceNode yamlNodeValue)
        {
            EnterContext(yamlNodeKey.Value);
            VisitYamlSequenceNode(yamlNodeValue);
            ExitContext();
        }

YamlDotNet.RepresentationModel.YamlSequenceNode : IEnumerable

Constructors :

public YamlSequenceNode()
public YamlSequenceNode(YamlNode[] children = )
public YamlSequenceNode(IEnumerable<YamlNode> children = )

Methods :

public IList<YamlNode> get_Children()
public SequenceStyle get_Style()
public Void set_Style(SequenceStyle value = )
public Void Add(YamlNode child = )
public Void Add(String child = )
public Void Accept(IYamlVisitor visitor = )
public Boolean Equals(Object obj = )
public Int32 GetHashCode()
public IEnumerable<YamlNode> get_AllNodes()
public YamlNodeType get_NodeType()
public String ToString()
public IEnumerator<YamlNode> GetEnumerator()
public String get_Anchor()
public Void set_Anchor(String value = )
public String get_Tag()
public Void set_Tag(String value = )
public Mark get_Start()
public Mark get_End()
public YamlNode get_Item(Int32 index = )
public YamlNode get_Item(YamlNode key = )
public Type GetType()