Esempio n. 1
0
        //public Token getByName( String tokenName ) {
        //    Token x;
        //    this.tokenMap.TryGetValue( tokenName, out x );
        //    return x;
        //}
        //private void addMap( List<Token> tokens ) {
        //    if (tokens == null) return;
        //    foreach (Token x in tokens) {
        //        if (x.getName() == null) continue;
        //        // 允许变量存在多次
        //        if (tokenMap.ContainsKey( x.getName() )) continue;
        //        tokenMap.Add( x.getName(), x );
        //    }
        //}
        public override void appendData( StringBuilder sb, ContentBlock block, BlockData blockdata )
        {
            ContentBlock subBlock = blockdata.getBlock( this.getName() );
            if (subBlock == null) return;

            List<BlockData> datalist = subBlock.getDataList();
            foreach (BlockData oneData in datalist) {
                subBlock.addResultOne( sb, oneData );
            }
        }
        /// <summary>
        /// Adds a control to page.
        /// </summary>
        public static void AddControlToPage()
        {
            //get a PageManager object
            PageManager pageManager = PageManager.GetManager();
            var pageData = pageManager.GetPageNode(Installer.pageId).GetPageData();

            var draftPage = pageManager.EditPage(pageData.Id);
            var contentBlock = new ContentBlock();
            contentBlock.Html = Installer.weekdayContent + Installer.instructionContent;

            var draftControl = pageManager.CreateControl<PageDraftControl>(contentBlock, "Body");
            draftControl.Caption = "Content block";
            draftPage.Controls.Add(draftControl);

            //Save the changes
            pageManager.PublishPageDraft(draftPage, CultureInfo.CurrentUICulture);
            pageManager.SaveChanges();
        }
Esempio n. 3
0
        public override void appendData( StringBuilder sb, ContentBlock block, BlockData blockdata )
        {
            Object dicValue;
            blockdata.getDic().TryGetValue( this.getName(), out dicValue );

            if (dicValue != null) {
                sb.Append( dicValue );
                return;
            }

            if (this.isObject() && blockdata.getDic().ContainsKey( this.getObjName() )) {

                Object obj = blockdata.getDic()[this.getObjName()];
                if (obj == null) throw new NullReferenceException( "view's data " + this.getObjName() + " is null" );

                Object pval = getPropertyValue( obj, _objAccessor );
                sb.Append( pval );

                return;
            }

            sb.Append( this.getRawLabelAndVar() );
        }
Esempio n. 4
0
 public override void appendData( StringBuilder sb, ContentBlock block, BlockData blockdata )
 {
     sb.Append( this.getValue() );
 }
Esempio n. 5
0
 //public String getVarString() {
 //    return TemplateUtil.getVarString( this.getName() );
 //}
 public abstract void appendData( StringBuilder sb, ContentBlock block, BlockData blockdata );
Esempio n. 6
0
 public void addBlock( ContentBlock block )
 {
     if (_blocks.ContainsKey( block.Name )) throw new TemplateException( "请勿重复绑定(getBlock)区块。区块名=" + block.Name + ",模板文件=" + block.getTemplatePath() );
     _blocks.Add( block.Name, block );
 }
Esempio n. 7
0
 public override void appendData( StringBuilder sb, ContentBlock block, BlockData blockdata )
 {
 }
Esempio n. 8
0
 public void addBlock( ContentBlock block )
 {
     _blocks.Add( block.Name, block );
 }
        private void CreatePreArrivalInformationPage()
        {
            var result = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), "Pre-arrival information", new Guid(SampleConstants.AdmissionsPageId), "en");

            if (result)
            {
                SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), new Guid(SampleConstants.EducationTemplateId), "en");

                ContentBlockBase titleBlock = new ContentBlockBase();
                titleBlock.Html = @"<h2>Pre-arrival Information</h2>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), titleBlock, "content", "Content block", "en");

                var mainLayoutControl = new LayoutControl();
                List<ColumnDetails> mainLayoutColumns = new List<ColumnDetails>();
                ColumnDetails mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 25,
                    PlaceholderId = "Left"
                };
                mainLayoutColumns.Add(mainLayoutColumn1);
                ColumnDetails mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 75,
                    PlaceholderId = "Right"
                };
                mainLayoutColumns.Add(mainLayoutColumn2);

                mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControl.ID = "Main";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), mainLayoutControl, "content", "25% + 75%", "en");

                var navigationControl = new NavigationControl();
                navigationControl.NavigationMode = NavigationModes.VerticalSimple;
                navigationControl.SelectionMode = PageSelectionModes.CurrentPageSiblings;
                navigationControl.Skin = "left";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), navigationControl, "Main_Left", "Navigation", "en");

                ContentBlock contentBlock = new ContentBlock();
                var prearrivalImageId = SampleUtilities.GetLocalizedImageId("prearrival", "en");

                contentBlock.Html = string.Format(@"<p><img alt="""" style=""float: left; margin-right: 15px; margin-bottom: 5px;"" src=""[images]{3}"" /></p> <h3>Pre-arrival</h3> <p>College is a step towards the beginning of your new life.&nbsp; We will try to make getting there as easy as possible for you.&nbsp; The information in this section of our website is intended to be used before you arrive on campus. Once you are on campus we will be here to meet and greet you and to make your experience here unforgettable and beneficial.&nbsp; If you have a specific question that is not answered here please feel free to contact us. We are very pleased that you are interested in studying at the Telerik International University.</p> <br /> <br style=""clear: left"" /> <p>Here are some helpful links on different topics:</p> <ul> <li><a href=""[pages]{0}"" >Contact us</a></li> <li><a href=""[pages]{1}"" >Housing opportunities</a></li> <li><a href=""[pages]{2}"" >Documents base</a></li> </ul>", SampleConstants.ContactUsPageId, SampleConstants.HousingOpportunitiesPageId, SampleConstants.DocumentsBasePageId, prearrivalImageId);
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), contentBlock, "Main_Right", "Content block", "en");
            }

            result = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), "Vor der Ankunft", "de");

            if (result)
            {
                SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), new Guid(SampleConstants.EducationTemplateId), "de");

                ContentBlock titleBlockDE = new ContentBlock();
                titleBlockDE.Html = @"<h2>Vor der Ankunft</h2>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), titleBlockDE, "content", "Content block", "de");

                var mainLayoutControlDE = new LayoutControl();
                List<ColumnDetails> mainLayoutColumns = new List<ColumnDetails>();
                ColumnDetails mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 25,
                    PlaceholderId = "Left"
                };
                mainLayoutColumns.Add(mainLayoutColumn1);
                ColumnDetails mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 75,
                    PlaceholderId = "Right"
                };
                mainLayoutColumns.Add(mainLayoutColumn2);

                mainLayoutControlDE.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControlDE.ID = "Main";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), mainLayoutControlDE, "content", "25% + 75%", "de");

                var navigationControlDE = new NavigationControl();
                navigationControlDE.NavigationMode = NavigationModes.VerticalSimple;
                navigationControlDE.SelectionMode = PageSelectionModes.CurrentPageSiblings;
                navigationControlDE.Skin = "left";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), navigationControlDE, "Main_Left", "Navigation", "de");

                ContentBlock contentBlockDE = new ContentBlock();
                var prearrivalImageIdDE = SampleUtilities.GetLocalizedImageId("prearrival", "de");

                contentBlockDE.Html = string.Format(@"<p><img alt="""" style=""float: left; margin-right: 15px; margin-bottom: 5px;"" src=""[images]{3}"" /></p> <h3>Vor der Ankunft</h3> <p>College ist ein Schritt in Richtung der Beginn Ihres neuen Lebens. Wir werden versuchen, dorthin zu gelangen so einfach wie m&ouml;glich f&uuml;r Sie. Die Informationen in diesem Bereich unserer Website soll verwendet werden, bevor Sie auf dem Campus zu gelangen. Sobald Sie sich auf dem Campus werden wir hier zu treffen und gr&uuml;&szlig;en Sie und machen Ihre Erfahrungen hier unvergessliche und n&uuml;tzlich. Wenn Sie eine spezifische Frage, die hier nicht beantwortet haben, z&ouml;gern Sie nicht uns zu kontaktieren.</p> <br /> <br style=""clear: left"" /> <p>Hier sind einige hilfreiche Links zu verschiedenen Themen:</p> <ul> <li><a href=""[pages]{0}"" >Kontakt</a></li> <li><a href=""[pages]{1}"" >Wohnmöglichkeiten</a></li> <li><a href=""[pages]{2}"" >Downloads</a></li> </ul>", SampleConstants.ContactUsPageId, SampleConstants.HousingOpportunitiesPageId, SampleConstants.DocumentsBasePageId, prearrivalImageIdDE);
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.PreArrivalInformationPageId), contentBlockDE, "Main_Right", "Content block", "de");
            }
        }
        private void CreateCampusMapPage()
        {
            var result = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.CampusMapPageId), "Campus map", new Guid(SampleConstants.CampusLifePageId), "en");

            if (result)
            {
                SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), new Guid(SampleConstants.EducationTemplateId), "en");

                ContentBlockBase campusMapBlock = new ContentBlockBase();
                campusMapBlock.Html = @"<h2>Campus map</h2>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), campusMapBlock, "content", "Content block", "en");

                var mainLayoutControl = new LayoutControl();
                List<ColumnDetails> mainLayoutColumns = new List<ColumnDetails>();
                ColumnDetails mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 25,
                    PlaceholderId = "Left"
                };
                mainLayoutColumns.Add(mainLayoutColumn1);
                ColumnDetails mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 75,
                    PlaceholderId = "Right"
                };
                mainLayoutColumns.Add(mainLayoutColumn2);

                mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControl.ID = "Main";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), mainLayoutControl, "content", "25% + 75%", "en");

                var navigationControl = new NavigationControl();
                navigationControl.NavigationMode = NavigationModes.VerticalSimple;
                navigationControl.SelectionMode = PageSelectionModes.CurrentPageSiblings;
                navigationControl.Skin = "left";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), navigationControl, "Main_Left", "Navigation", "en");

                ImageControl campusMapImage = new ImageControl();
                campusMapImage.ImageId = SampleUtilities.GetLocalizedImageId("campus", "en");
                campusMapImage.Width = 676;
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), campusMapImage, "Main_Right", "Image", "en");

                var legendHeaderLayoutControl = new LayoutControl();
                List<ColumnDetails> legendHeaderLayoutColumns = new List<ColumnDetails>();
                ColumnDetails legendHeaderLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 100,
                    PlaceholderId = "Center"
                };
                legendHeaderLayoutColumns.Add(legendHeaderLayoutColumn1);

                legendHeaderLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(legendHeaderLayoutColumns, string.Empty);
                legendHeaderLayoutControl.ID = "LegendHeader";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), legendHeaderLayoutControl, "Main_Right", "100%", "en");

                ContentBlock legendBlock = new ContentBlock();
                legendBlock.Html = @"<h3>Legend</h3>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), legendBlock, "LegendHeader_Center", "Content block", "en");

                var legendLayoutControl = new LayoutControl();
                List<ColumnDetails> legendLayoutColumns = new List<ColumnDetails>();
                ColumnDetails legendLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 33,
                    PlaceholderId = "Left33"
                };
                legendLayoutColumns.Add(legendLayoutColumn1);
                ColumnDetails legendLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 34,
                    PlaceholderId = "Middle34"
                };
                legendLayoutColumns.Add(legendLayoutColumn2);
                ColumnDetails legendLayoutColumn3 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 33,
                    PlaceholderId = "Right33"
                };
                legendLayoutColumns.Add(legendLayoutColumn3);

                legendLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(legendLayoutColumns, string.Empty);
                legendLayoutControl.ID = "Legend";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), legendLayoutControl, "Main_Right", "33% + 34% + 33%", "en");

                ContentBlockBase contentBlockLeft = new ContentBlockBase();
                contentBlockLeft.Html = @"1. Dorm A (Ryan Mcguire)<br /> 2. Fine Arts building<br /> 3. Computing center<br /> 4. Dorm B (Tomas Newman)";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), contentBlockLeft, "Legend_Left33", "Content block", "en");

                ContentBlockBase contentBlockMiddle = new ContentBlockBase();
                contentBlockMiddle.Html = @"5. Biology faculty<br /> 6. Chemistry building<br /> 7. Dorm C (Micheal Burgess)<br /> 8. Administration center";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), contentBlockMiddle, "Legend_Middle34", "Content block", "en");

                ContentBlockBase contentBlockRight = new ContentBlockBase();
                contentBlockRight.Html = @"9. Athletics facilities<br /> 10.Main Building<br /> 11.Liberal arts building<br /> 12. Dorm D (Melvin Richards)";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), contentBlockRight, "Legend_Right33", "Content block", "en");
            }

            result = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.CampusMapPageId), "Campus-Karte", "de");

            if (result)
            {
                SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), new Guid(SampleConstants.EducationTemplateId), "de");

                ContentBlockBase campusMapBlockDE = new ContentBlockBase();
                campusMapBlockDE.Html = @"<h2>Campus-Karte</h2>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), campusMapBlockDE, "content", "Content block", "de");

                var mainLayoutControlDE = new LayoutControl();
                List<ColumnDetails> mainLayoutColumns = new List<ColumnDetails>();
                ColumnDetails mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 25,
                    PlaceholderId = "Left"
                };
                mainLayoutColumns.Add(mainLayoutColumn1);
                ColumnDetails mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 75,
                    PlaceholderId = "Right"
                };
                mainLayoutColumns.Add(mainLayoutColumn2);

                mainLayoutControlDE.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControlDE.ID = "Main";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), mainLayoutControlDE, "content", "25% + 75%", "de");

                var navigationControlDE = new NavigationControl();
                navigationControlDE.NavigationMode = NavigationModes.VerticalSimple;
                navigationControlDE.SelectionMode = PageSelectionModes.CurrentPageSiblings;
                navigationControlDE.Skin = "left";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), navigationControlDE, "Main_Left", "Navigation", "de");

                ImageControl campusMapImageDE = new ImageControl();
                campusMapImageDE.ImageId = SampleUtilities.GetLocalizedImageId("campus", "de");
                campusMapImageDE.Width = 676;
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), campusMapImageDE, "Main_Right", "Image", "de");

                var legendHeaderLayoutControlDE = new LayoutControl();
                List<ColumnDetails> legendHeaderLayoutColumns = new List<ColumnDetails>();
                ColumnDetails legendHeaderLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 100,
                    PlaceholderId = "Center"
                };
                legendHeaderLayoutColumns.Add(legendHeaderLayoutColumn1);

                legendHeaderLayoutControlDE.Layout = SampleUtilities.GenerateLayoutTemplate(legendHeaderLayoutColumns, string.Empty);
                legendHeaderLayoutControlDE.ID = "LegendHeader";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), legendHeaderLayoutControlDE, "Main_Right", "100%", "de");

                ContentBlock legendBlockDE = new ContentBlock();
                legendBlockDE.Html = @"<h3>Legend</h3>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), legendBlockDE, "LegendHeader_Center", "Content block", "de");

                var legendLayoutControlDE = new LayoutControl();
                List<ColumnDetails> legendLayoutColumns = new List<ColumnDetails>();
                ColumnDetails legendLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 33,
                    PlaceholderId = "Left33"
                };
                legendLayoutColumns.Add(legendLayoutColumn1);
                ColumnDetails legendLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 34,
                    PlaceholderId = "Middle34"
                };
                legendLayoutColumns.Add(legendLayoutColumn2);
                ColumnDetails legendLayoutColumn3 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 33,
                    PlaceholderId = "Right33"
                };
                legendLayoutColumns.Add(legendLayoutColumn3);

                legendLayoutControlDE.Layout = SampleUtilities.GenerateLayoutTemplate(legendLayoutColumns, string.Empty);
                legendLayoutControlDE.ID = "Legend";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), legendLayoutControlDE, "Main_Right", "33% + 34% + 33%", "de");

                ContentBlockBase contentBlockLeftDE = new ContentBlockBase();
                contentBlockLeftDE.Html = @"1. Dorm A (Ryan Mcguire)<br /> 2. Fine Arts building<br /> 3. Computing center<br /> 4. Dorm B (Tomas Newman)";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), contentBlockLeftDE, "Legend_Left33", "Content block", "de");

                ContentBlockBase contentBlockMiddleDE = new ContentBlockBase();
                contentBlockMiddleDE.Html = @"5. Biology faculty<br /> 6. Chemistry building<br /> 7. Dorm C (Micheal Burgess)<br /> 8. Administration center";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), contentBlockMiddleDE, "Legend_Middle34", "Content block", "de");

                ContentBlockBase contentBlockRightDE = new ContentBlockBase();
                contentBlockRightDE.Html = @"9. Athletics facilities<br /> 10.Main Building<br /> 11.Liberal arts building<br /> 12. Dorm D (Melvin Richards)";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.CampusMapPageId), contentBlockRightDE, "Legend_Right33", "Content block", "de");
            }
        }
        private void CreateLoginPage()
        {
            Guid parentPageID = new Guid(SampleConstants.InternalResourcesGroupPageId);
            var hasCreatedPage = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.LoginPageId), "Login", parentPageID, false, false, "en");
            if (hasCreatedPage)
            {
                SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.LoginPageId), new Guid(SampleConstants.EducationTemplateId), "en");

                // Add layout control
                var mainLayoutControl = new LayoutControl();
                var mainLayoutColumns = new List<ColumnDetails>();

                var mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 15, 0, 0),
                    PlaceholderId = "Left",
                    ColumnWidthPercentage = 50
                };
                mainLayoutColumns.Add(mainLayoutColumn1);

                var mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 15),
                    PlaceholderId = "Right",
                    ColumnWidthPercentage = 50
                };
                mainLayoutColumns.Add(mainLayoutColumn2);

                mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControl.ID = "Main";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.LoginPageId), mainLayoutControl, "content", "50% + 50% (custom)", "en");

                ContentBlockBase pageTitle = new ContentBlockBase();
                pageTitle.Html = "<h1>Login</h1>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.LoginPageId), pageTitle, "Main_Left", "Content block", "en");

                LoginWidget login = new LoginWidget();
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.LoginPageId), login, "Main_Left", "Login", "en");

                string registerPageUrl = string.Empty;
                var count = 0;
                App.WorkWith().Pages().Where(pN => pN.Id == new Guid(SampleConstants.RegistrationPageId)).Count(out count);
                if (count != 0)
                {
                    PageNode node = App.WorkWith().Page(new Guid(SampleConstants.RegistrationPageId)).Get();
                    registerPageUrl = node.UrlName;
                }

                ContentBlock registerInfo = new ContentBlock();
                registerInfo.Html =
                    String.Format(@"<div>
                    <div>
                    <p>Please click on ""Register"" and complete the form on the next screen to register for our service. You will receive a confirmation email during the next few minutes. <br />
                    <br />
                    Once registered, you are ready to use our service in full mode.&nbsp;</p>
                    <p><strong>You need to be logged in to:</strong></p>
                    <ul>
                        <li>post in forums</li>
                        <li>manage your account</li>
                        <li>download documents</li>
                    </ul>
                    <a class=""important"" href=""{0}"">Register</a></div>
                    </div>", registerPageUrl);

                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.LoginPageId), registerInfo, "Main_Right", "Login", "en");
            }

            hasCreatedPage = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.LoginPageId), "Login", parentPageID, false, false, "de");
            if (hasCreatedPage)
            {
                SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.LoginPageId), new Guid(SampleConstants.EducationTemplateId), "de");

                // Add layout control
                var mainLayoutControl = new LayoutControl();
                var mainLayoutColumns = new List<ColumnDetails>();

                var mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 15, 0, 0),
                    PlaceholderId = "Left",
                    ColumnWidthPercentage = 50
                };
                mainLayoutColumns.Add(mainLayoutColumn1);

                var mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 15),
                    PlaceholderId = "Right",
                    ColumnWidthPercentage = 50
                };
                mainLayoutColumns.Add(mainLayoutColumn2);

                mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControl.ID = "Main";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.LoginPageId), mainLayoutControl, "content", "50% + 50% (custom)", "de");

                ContentBlockBase pageTitle = new ContentBlockBase();
                pageTitle.Html = "<h1>Login</h1>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.LoginPageId), pageTitle, "Main_Left", "Content block", "de");

                LoginWidget login = new LoginWidget();
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.LoginPageId), login, "Main_Left", "Login", "de");

                string registerPageUrl = string.Empty;
                var count = 0;
                App.WorkWith().Pages().Where(pN => pN.Id == new Guid(SampleConstants.RegistrationPageId)).Count(out count);
                if (count != 0)
                {
                    PageNode node = App.WorkWith().Page(new Guid(SampleConstants.RegistrationPageId)).Get();
                    registerPageUrl = node.UrlName;
                }

                ContentBlock registerInfo = new ContentBlock();
                registerInfo.Html =
                    String.Format(@"<div>
                    <p>Bitte klicken Sie auf ""Registrieren"" und f&uuml;llen Sie das Formular auf der n&auml;chsten Seite, um f&uuml;r unseren Service registrieren. Sie erhalten eine Best&auml;tigung per E-Mail in den n&auml;chsten Minuten erhalten.<br />
                    <br />
                    Einmal registriert, k&ouml;nnen Sie unseren Service in Voll-Modus verwenden.&nbsp;</p>
                    <p><strong>Sie m&uuml;ssen registriert sein, um Folgendes machen zu k&ouml;nnen:</strong></p>
                    <ul>
                        <li>In den Foren schreiben</li>
                        <li>Ihr Account managen</li>
                        <li>Dokumente herunterladen</li>
                    </ul>
                    <p><a href=""{0}"">Registrierung</a></p>
                    </div>", registerPageUrl);

                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.LoginPageId), registerInfo, "Main_Right", "Login", "de");
            }
        }
        private void CreateWhyTIUPage()
        {
            var result = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), "Why TIU", new Guid(SampleConstants.AboutTheUniversityPageId), "en");

            if (result)
            {
                SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), new Guid(SampleConstants.EducationTemplateId), "en");

                ContentBlock whyBlock = new ContentBlock();
                whyBlock.Html = @"<h2>Why TIU?</h2>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), whyBlock, "content", "Content block", "en");

                var mainLayoutControl = new LayoutControl();
                List<ColumnDetails> mainLayoutColumns = new List<ColumnDetails>();
                ColumnDetails mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 25,
                    PlaceholderId = "Left"
                };
                mainLayoutColumns.Add(mainLayoutColumn1);
                ColumnDetails mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 75,
                    PlaceholderId = "Right"
                };
                mainLayoutColumns.Add(mainLayoutColumn2);

                mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControl.ID = "Main";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), mainLayoutControl, "content", "25% + 75%", "en");

                var navigationControl = new NavigationControl();
                navigationControl.NavigationMode = NavigationModes.VerticalSimple;
                navigationControl.SelectionMode = PageSelectionModes.CurrentPageSiblings;
                navigationControl.Skin = "left";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), navigationControl, "Main_Left", "Navigation", "en");

                ContentBlock contentBlock = new ContentBlock();
                var students_tiuImageId = SampleUtilities.GetLocalizedImageId("students_tiu", "en");

                contentBlock.Html = string.Format(@"<p><img class=""special"" alt=""Lorem ipsum dolor sit amet"" src=""[images]{0}"" style=""width: 350px; height: 273px; float: left; margin-right: 15px; margin-bottom: 5px;"" longdesc=""Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."" /></p> <h3>Know how to live!</h3> <p> At TIU we believe in teaching you the knowhow of life. In order to lead a good life, one must excel in education, succeed in his profession and enjoy the free time in between. This is why life at TIU encompasses not only academics, but also activities that will shape your character and lead you to success. </p> <h3>Excellence </h3> <p>In order to expect you to excel, we must excel at what we do. We believe in making a real impact on the world by constantly growing, hiring the best staff and investing in the newest technology. You will have access to an impressive range of resources to support your studies including an outstanding academic library and some of the best computing resources. </p> <h3>Careers </h3> <p>Education is the prelude to profession. What use is a diploma unless it makes you highly demanded by the world of employers? TIU&rsquo;s reputation in the business world combined with its contacts and internship programs is a guarantee for your ability to land directly into your dream job right after graduation.</p>", students_tiuImageId);
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), contentBlock, "Main_Right", "Content block", "en");
            }

            result = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), "Warum TIU", false, "de");

            if (result)
            {
                SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), new Guid(SampleConstants.EducationTemplateId), "de");

                ContentBlock whyBlockDE = new ContentBlock();
                whyBlockDE.Html = @"<h2>Warum TIU?</h2>";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), whyBlockDE, "content", "Content block", "de");

                var mainLayoutControlDE = new LayoutControl();
                List<ColumnDetails> mainLayoutColumns = new List<ColumnDetails>();
                ColumnDetails mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 25,
                    PlaceholderId = "Left"
                };
                mainLayoutColumns.Add(mainLayoutColumn1);
                ColumnDetails mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 75,
                    PlaceholderId = "Right"
                };
                mainLayoutColumns.Add(mainLayoutColumn2);

                mainLayoutControlDE.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControlDE.ID = "Main";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), mainLayoutControlDE, "content", "25% + 75%", "de");

                var navigationControlDE = new NavigationControl();
                navigationControlDE.NavigationMode = NavigationModes.VerticalSimple;
                navigationControlDE.SelectionMode = PageSelectionModes.CurrentPageSiblings;
                navigationControlDE.Skin = "left";
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), navigationControlDE, "Main_Left", "Navigation", "de");

                ContentBlock contentBlockDE = new ContentBlock();
                var students_tiuImageIdDE = SampleUtilities.GetLocalizedImageId("students_tiu", "de");

                contentBlockDE.Html = string.Format(@"<p><img alt="""" style=""float: left; margin-right: 15px; margin-bottom: 5px;"" src=""[images]{0}"" /></p> <h3>Wissen, wie man lebt!</h3> <p> Am TIU wir glauben, in der Lehre Sie das Know-how des Lebens. Um ein gutes Leben zu f&uuml;hren, muss man excel im Bildungswesen, in seinem Beruf erfolgreich zu sein und genie&szlig;en die freie Zeit dazwischen. Dies ist, warum das Leben in TIU nicht nur Akademiker umfasst, sondern auch Aktivit&auml;ten, die Ihren Charakter Form und f&uuml;hren Sie zum Erfolg wird.</p> <h3>Exzellenzinitiative</h3> <p>Um Ihnen zu &uuml;bertreffen erwarten, m&uuml;ssen wir, was wir tun Excel. Wir glauben an einen echten Einfluss auf die Welt durch st&auml;ndig wachsende,, die besten Mitarbeiter und investieren in die neueste Technologie. Sie haben Zugriff auf eine beeindruckende Vielfalt an Ressourcen, um Ihre Studien mit einem hervorragenden akademischen Bibliothek und einige der besten IT-Ressourcen zu unterst&uuml;tzen.</p> <h3>Karriere</h3> <p>Bildung ist der Auftakt zu Beruf. Was n&uuml;tzt ein Diplom, es sei denn es macht dich stark nachgefragten durch die Welt der Arbeitgeber? TIU Ruf in der Gesch&auml;ftswelt mit ihren Kontakten und Praktika in Kombination ist ein Garant f&uuml;r Ihre F&auml;higkeit, direkt Land in Ihren Traumjob nach dem Studium.</p>", students_tiuImageIdDE);
                SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.WhyTIUPageId), contentBlockDE, "Main_Right", "Content block", "de");
            }
        }
        private void CreateFacebookThemeAndTemplate()
        {
            SampleUtilities.RegisterTheme(SampleConstants.FacebookThemeName, SampleConstants.FacebookThemePath);

            var result = SampleUtilities.RegisterTemplate(new Guid(SampleConstants.FacebookTemplateId), SampleConstants.FacebookTemplateName, SampleConstants.FacebookTemplateName,
                SampleConstants.FacebookTemplateMasterPage, SampleConstants.FacebookThemeName, CultureInfo.GetCultureInfo("en"));

            if (result)
            {
                var mainLayoutControl = new LayoutControl();
                List<ColumnDetails> mainLayoutColumns = new List<ColumnDetails>();
                ColumnDetails mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 100,
                    PlaceholderId = "Center"
                };
                mainLayoutColumns.Add(mainLayoutColumn1);
                mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, "header");
                mainLayoutControl.ID = "Header";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.FacebookTemplateId), mainLayoutControl, "content_inside", "100% (custom)");

                // Logo
                var logoBlock = new ContentBlock();
                logoBlock.Html = @"<h1>Telerik International University</h1>";
                logoBlock.CssClass = "sfContentBlock";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.FacebookTemplateId), logoBlock, "Header_Center", "Content block");

                // Image
                ImageControl universityImage = new ImageControl();
                universityImage.ImageId = SampleUtilities.GetLocalizedImageId("university_520", "en");
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.FacebookTemplateId), universityImage, "Header_Center", "Image");

                var contentLayoutControl = new LayoutControl();
                List<ColumnDetails> contentLayoutColumns = new List<ColumnDetails>();
                ColumnDetails contentLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 100,
                    PlaceholderId = "Center"
                };
                contentLayoutColumns.Add(contentLayoutColumn1);
                contentLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(contentLayoutColumns, "content");
                contentLayoutControl.ID = "Content";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.FacebookTemplateId), contentLayoutControl, "Header_Center", "100% (custom)");

                var footerLayoutControl = new LayoutControl();
                List<ColumnDetails> footerLayoutColumns = new List<ColumnDetails>();
                ColumnDetails footerLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 50,
                    PlaceholderId = "Left"
                };
                footerLayoutColumns.Add(footerLayoutColumn1);
                ColumnDetails footerLayoutColumn2 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 12),
                    ColumnWidthPercentage = 50,
                    PlaceholderId = "Right"
                };
                footerLayoutColumns.Add(footerLayoutColumn2);
                footerLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(footerLayoutColumns, "footer");
                footerLayoutControl.ID = "Footer";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.FacebookTemplateId), footerLayoutControl, "Header_Center", "50% + 50% (custom)");
            }
        }
        private void CreateEducationThemeAndTemplate()
        {
            SampleUtilities.RegisterTheme(SampleConstants.EducationThemeName, SampleConstants.EducationThemePath);
            SampleUtilities.RegisterTheme(SampleConstants.EducationInGermanThemeName, SampleConstants.EducationInGermanThemePath);

            SampleUtilities.RegisterTemplate(new Guid(SampleConstants.EducationTemplateId), SampleConstants.EducationTemplateName, SampleConstants.EducationTemplateName, SampleConstants.EducationTemplateMasterPage, SampleConstants.EducationThemeName, CultureInfo.GetCultureInfo("en"));
            var result = SampleUtilities.RegisterTemplate(new Guid(SampleConstants.EducationTemplateId), SampleConstants.EducationInGermanTemplateName, SampleConstants.EducationInGermanTemplateName, SampleConstants.EducationTemplateMasterPage, SampleConstants.EducationInGermanThemeName, CultureInfo.GetCultureInfo("de"));

            if (result)
            {
                // Main layout
                var mainLayoutControl = new LayoutControl();
                List<ColumnDetails> mainLayoutColumns = new List<ColumnDetails>();
                ColumnDetails mainLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 50),
                    ColumnWidthPercentage = 70,
                    PlaceholderId = "Left"
                };
                mainLayoutColumns.Add(mainLayoutColumn1);
                ColumnDetails mainLayoutColumn2 = new ColumnDetails()
                {
                    ColumnWidthPercentage = 30,
                    PlaceholderId = "Right"
                };
                mainLayoutColumns.Add(mainLayoutColumn2);
                mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty);
                mainLayoutControl.ID = "Header";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), mainLayoutControl, "headerInfo", "Header");

                // Logo
                var logoBlock = new ContentBlock();
                logoBlock.Html = string.Format(@"<h1><a href=""[pages]{0}"">Telerik International University</a></h1> <h3>established 2005, Sofia</h3>", SampleConstants.HomePageId);
                logoBlock.CssClass = "sfContentBlock";
                string logoId = SampleUtilities.AddLocalizedControlToTemplate(new Guid(SampleConstants.EducationTemplateId), logoBlock, "Header_Left", "Content block", "en");

                Dictionary<string, object> logoProperties = new Dictionary<string, object>();

                logoProperties.Add("Html", string.Format(@"<h1><a href=""[pages]{0}"">Internationale Universit&auml;t Telerik</a></h1> <h3>gegr&uuml;ndet im 2005, in Sofia</h3>", SampleConstants.HomePageId));
                SampleUtilities.UpdateLocalizedControlInTemplate(logoId, new Guid(SampleConstants.EducationTemplateId), logoProperties, "de");

                // Language/search layout
                var languagesSearchLayoutControl = new LayoutControl();
                List<ColumnDetails> languagesSearchLayoutColumns = new List<ColumnDetails>();
                ColumnDetails languagesSearchLayoutColumn1 = new ColumnDetails()
                {
                    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                    ColumnWidthPercentage = 46,
                    PlaceholderId = "Left"
                };
                languagesSearchLayoutColumns.Add(languagesSearchLayoutColumn1);
                ColumnDetails languagesSearchLayoutColumn2 = new ColumnDetails()
                {
                    ColumnWidthPercentage = 54,
                    PlaceholderId = "Right"
                };
                languagesSearchLayoutColumns.Add(languagesSearchLayoutColumn2);
                languagesSearchLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(languagesSearchLayoutColumns, string.Empty);
                languagesSearchLayoutControl.ID = "LanguageSearch";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), languagesSearchLayoutControl, "Header_Right", "Language and Search");

                // Language
                var languages = new LanguageSelectorControl();
                languages.SelectorType = LanguageSelectorType.Vertical;
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), languages, "LanguageSearch_Right", "Language selector");

                // Login layout
                //var loginLayoutControl = new LayoutControl();
                //List<ColumnDetails> loginLayoutColumns = new List<ColumnDetails>();
                //ColumnDetails loginLayoutColumn1 = new ColumnDetails()
                //{
                //    ColumnSpaces = new ColumnSpaces(0, 0, 0, 0),
                //    PlaceholderId = "Center"
                //};
                //loginLayoutColumns.Add(loginLayoutColumn1);
                //loginLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(loginLayoutColumns, "login-status");
                //loginLayoutControl.ID = "Login";
                //SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), loginLayoutControl, "Header_Right", "Login");

                //// Login name
                //LoginNameControl loginNameControl = new LoginNameControl();
                //SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), loginNameControl, "Login_Center", "Login name");

                //// Login status
                //LoginStatusControl loginStatusControl = new LoginStatusControl();
                //SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), loginStatusControl, "Login_Center", "Login status");

                // Image
                ImageControl headerImage = new ImageControl();
                headerImage.ImageId = SampleUtilities.GetLocalizedImageId("the_building", "en");
                headerImage.CssClass = "headerImage";
                string controlId = SampleUtilities.AddLocalizedControlToTemplate(new Guid(SampleConstants.EducationTemplateId), headerImage, "image", "Image", "en");

                Dictionary<string, object> properties = new Dictionary<string, object>();
                properties.Add("ImageId", SampleUtilities.GetLocalizedImageId("headerspring1", "de"));
                SampleUtilities.UpdateLocalizedControlInTemplate(controlId, new Guid(SampleConstants.EducationTemplateId), properties, "de");

                // Explore your potentials
                ContentBlockBase exploreContentBlock = new ContentBlockBase();
                exploreContentBlock.Html = @"<h4>Explore your potentials</h4> <p>Share your voice and unlock your potentials while we will equip you with the skills you need for the future!</p>";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), exploreContentBlock, "tagline", "Content block");

                // Header navigation
                var headerNavigationControl = new NavigationControl();
                headerNavigationControl.NavigationMode = NavigationModes.HorizontalSimple;
                headerNavigationControl.SelectionMode = PageSelectionModes.TopLevelPages;
                headerNavigationControl.Skin = "education";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), headerNavigationControl, "header", "Navigation");

                // Footer navigation
                var footerNavigationControl = new NavigationControl();
                footerNavigationControl.NavigationMode = NavigationModes.SiteMapInColumns;
                footerNavigationControl.SelectionMode = PageSelectionModes.TopLevelPages;
                footerNavigationControl.Skin = "footer";
                SampleUtilities.AddControlToTemplate(new Guid(SampleConstants.EducationTemplateId), footerNavigationControl, "footernavigation", "Navigation");
            }
        }
Esempio n. 15
0
        /// <summary>
        /// 返回一个做数据容器的block(可以作为数据容器,并包括tokens信息)
        /// </summary>
        /// <param name="blockName"></param>
        /// <returns></returns>
        public IBlock GetBlock( String blockName )
        {
            if (_isTemplateExist == false) {
                throw new TemplateException( lang.get( "exTemplateNotExist" ) + ": " + _templatePath );
            }

            BlockToken blockToken = getBlockToken( blockName );
            if (blockToken == null) throw new TemplateException(
                string.Format( lang.get( "exBlockExist" ), blockName, _templatePath, "&lt;!-- BEGIN " + blockName + " --&gt;" )
                );

            ContentBlock block = new ContentBlock();
            block.Name = blockName;
            block._thisToken = blockToken;
            block._templatePath = _templatePath;

            // 将上级变量放入下级循环可用
            block._blockData = new BlockData( _blockData.getDic() );

            _blockData.addBlock( block );

            return block;
        }