private void codeActivity1_ExecuteCode(object sender, EventArgs e)
        {
            this.Bindings.Add(Binding_Title, string.Empty);

            List <KeyValuePair <Guid, string> > templatesOptions =
                (from template in PageTemplateFacade.GetPageTemplates().OfType <RazorPageTemplateDescriptor>()
                 where template.IsValid
                 orderby template.Title
                 select new KeyValuePair <Guid, string>(template.Id, template.Title)).ToList();

            templatesOptions.Insert(0, new KeyValuePair <Guid, string>(
                                        Guid.Empty, GetText("AddNewRazorPageTemplate.LabelCopyFromEmptyOption")));

            Guid mostUsedTemplate = PageTemplateHelper.GetTheMostUsedTemplate(templatesOptions.Select(p => p.Key));

            this.Bindings.Add("CopyOfOptions", templatesOptions);
            this.Bindings.Add("CopyOfId", mostUsedTemplate);
        }
        private void codeActivity1_ExecuteCode(object sender, EventArgs e)
        {
            IXmlPageTemplate newPageTemplate = DataFacade.BuildNew <IXmlPageTemplate>();

            newPageTemplate.Id    = Guid.NewGuid();
            newPageTemplate.Title = "";

            this.Bindings.Add("NewPageTemplate", newPageTemplate);

            List <KeyValuePair <Guid, string> > templatesOptions =
                (from template in PageTemplateFacade.GetPageTemplates()
                 where template is XmlPageTemplateDescriptor && template.IsValid
                 orderby template.Title
                 select new KeyValuePair <Guid, string>(template.Id, template.Title)).ToList();

            templatesOptions.Insert(0, new KeyValuePair <Guid, string>(
                                        Guid.Empty, GetText("AddNewXmlPageTemplate.LabelCopyFromEmptyOption")));

            Guid mostUsedTemplate = PageTemplateHelper.GetTheMostUsedTemplate(templatesOptions.Select(p => p.Key));

            this.Bindings.Add("CopyOfOptions", templatesOptions);
            this.Bindings.Add("CopyOfId", mostUsedTemplate);
        }