예제 #1
0
        public override IWriteResult WriteInPageFunctions(
            IJavascriptWriter writer,
            Func <IJavascriptWriter, IWriteResult, IWriteResult> childrenWriter)
        {
            var writeResult = WriteResult.Continue();

            if (!ReferenceEquals(_pageComponents, null))
            {
                for (var i = 0; i < _pageComponents.Length; i++)
                {
                    var pageComponent = _pageComponents[i];
                    if (writeResult.Add(pageComponent.WriteScripts(writer)).IsComplete)
                    {
                        return(writeResult);
                    }
                }
            }

            if (!ReferenceEquals(_layout, null))
            {
                writeResult.Add(_layout.WriteScripts(writer));
            }

            return(writeResult);
        }