Esempio n. 1
0
        public void Start(string fileName, DirectoryInfo directory, string options, string provisionResourceFolder = null)
        {
            ProvisioningTemplate template = null;

            using (var ctx = base.GetClientContext())
            {
                if (provisionResourceFolder == null)
                {
                    template = ProvisioningHelper.GetProvisioningTemplateFromResourcePath(fileName, directory);
                }
                else
                {
                    template = ProvisioningHelper.GetProvisioningTemplateFromResourcePath(fileName, directory, provisionResourceFolder);
                }
                ProvisioningHelper.ReportOnTemplateStats(template);
                if (options.ToLower().IndexOf("quiet") < 0)
                {
                    Console.WriteLine("");
                    Console.WriteLine("Continue (Y/N):");
                    string YesNo = Console.ReadLine();
                    if (YesNo.ToLower().IndexOf('n') >= 0)
                    {
                        return;
                    }
                }

                ProvisioningHelper.ApplyCustomTemplateToSite(defaultForeground, ctx, template);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Create news pages, articles etc..
        /// </summary>
        public void Start(string fileName, DirectoryInfo directory)
        {
            // get the list of groups sites
            var sites = Properties.Settings.Default.GroupSitesStage;

            foreach (var url in sites)
            {
                using (var ctx = GetClientContext(url))
                {
                    var template = ProvisioningHelper.GetProvisioningTemplateFromResourcePath(fileName, directory);
                    ProvisioningHelper.ReportOnTemplateStats(template);
                    ProvisioningHelper.ApplyCustomTemplateToSite(defaultForeground, ctx, template);
                }
            }
        }