public static ConceptNodeViewModel Indent(this ConceptNodeViewModel @this)
        {
            ICodeLineViewModel codeLine = @this.BottomCodeLine();

            codeLine.Nodes.Add(new IndentNodeViewModel(@this));
            return(@this);
        }
        public static ConceptNodeViewModel Literal(this ConceptNodeViewModel @this, string literal)
        {
            if (string.IsNullOrWhiteSpace(literal))
            {
                throw new ArgumentNullException(nameof(literal));
            }

            ISyntaxNodeViewModel syntaxNode = @this.LastSyntaxNode();

            if (syntaxNode is PropertyViewModel property)
            {
                property.Nodes.Add(new LiteralNodeViewModel(property)
                {
                    Literal         = literal,
                    PropertyBinding = property.PropertyBinding
                });
            }
            else
            {
                ICodeLineViewModel codeLine = @this.BottomCodeLine();
                codeLine.Nodes.Add(new LiteralNodeViewModel(@this)
                {
                    Literal = literal
                });
            }
            return(@this);

            //ICodeLineViewModel codeLine = @this.BottomCodeLine();
            //codeLine.Nodes.Add(new LiteralNodeViewModel(@this) { Literal = literal });
        }
        public static ConceptNodeViewModel Keyword(this ConceptNodeViewModel @this, string keyword)
        {
            if (string.IsNullOrWhiteSpace(keyword))
            {
                throw new ArgumentNullException(nameof(keyword));
            }

            ISyntaxNodeViewModel syntaxNode = @this.LastSyntaxNode();

            if (syntaxNode is PropertyViewModel property)
            {
                property.Nodes.Add(new KeywordNodeViewModel(property)
                {
                    Keyword         = keyword,
                    PropertyBinding = property.PropertyBinding
                });
            }
            else
            {
                ICodeLineViewModel codeLine = @this.BottomCodeLine();
                codeLine.Nodes.Add(new KeywordNodeViewModel(@this)
                {
                    Keyword = keyword
                });
            }
            return(@this);
            //ICodeLineViewModel codeLine = @this.BottomCodeLine();
            //codeLine.Nodes.Add(new KeywordNodeViewModel(@this) { Keyword = keyword });
        }
        public static ConceptNodeViewModel Identifier(this ConceptNodeViewModel @this)
        {
            ICodeLineViewModel codeLine = @this.BottomCodeLine();

            codeLine.Nodes.Add(new IdentifierNodeViewModel(@this, @this.SyntaxNode));
            return(@this);
        }
        public static ConceptNodeViewModel Repeatable(this ConceptNodeViewModel @this)
        {
            ICodeLineViewModel codeLine = @this
                                          .NewLine()
                                          .BottomCodeLine();

            codeLine.Nodes.Add(new RepeatableViewModel(@this));
            return(@this);
        }
        public static ISyntaxNodeViewModel LastSyntaxNode(this ISyntaxNodeViewModel @this)
        {
            ICodeLineViewModel codeLine = @this.BottomCodeLine();
            int count = codeLine.Nodes.Count;

            if (count == 0)
            {
                return(null);
            }
            return(codeLine.Nodes[count - 1]);
        }
        public static ConceptNodeViewModel Property(this ConceptNodeViewModel @this, string propertyName)
        {
            if (string.IsNullOrWhiteSpace(propertyName))
            {
                throw new ArgumentNullException(nameof(propertyName));
            }

            ICodeLineViewModel codeLine = @this.BottomCodeLine();

            codeLine.Nodes.Add(new PropertyViewModel(@this)
            {
                PropertyBinding = propertyName
            });
            return(@this);
        }
        public static ConceptNodeViewModel Selector(this ConceptNodeViewModel @this)
        {
            ISyntaxNodeViewModel syntaxNode = @this.LastSyntaxNode();

            if (syntaxNode is PropertyViewModel property)
            {
                property.Nodes.Add(new SelectorViewModel(property)
                {
                    PropertyBinding = property.PropertyBinding
                });
            }
            else
            {
                ICodeLineViewModel codeLine = @this.BottomCodeLine();
                codeLine.Nodes.Add(new SelectorViewModel(@this));
            }
            return(@this);

            //ICodeLineViewModel codeLine = @this.BottomCodeLine();
            //codeLine.Nodes.Add(new SelectorViewModel(@this));
        }