コード例 #1
0
        internal override void AssertTagRulesViolation(NodeList rootNodeList)
        {
            rootNodeList.GetItems().ForEach(n =>
            {
                var b1 = n as Block;

                if (b1 != null)
                {
                    var found = rootNodeList.FindAll(o =>
                    {
                        var b2 = o as Block;
                        return(b2 != null && b1.BlockName == b2.BlockName);
                    });

                    if (found != null && found.Count > 1)
                    {
                        throw new SyntaxException(Liquid.ResourceManager.GetString("BlockTagAlreadyDefinedException"), b1.BlockName);
                    }
                }
            });
        }