Esempio n. 1
0
        public static void CheckFile(string path)
        {
            if (!File.Exists(path))
            {
                throw new Exception("File not found");
            }

            using (var zipHelper = new ZipHelper())
            {
                string fileContent = zipHelper.GetFileContent(path, Statics.CustomizationsFileName);

                bool hasSitemap = CustomizationsFileProcessor.ContainsSiteMap(fileContent);
                if (!hasSitemap)
                {
                    throw new Exception("No sitemap inside customizations.xml");
                }
            }
        }
Esempio n. 2
0
        private void bLoadFromSolution_Click(object sender, EventArgs e)
        {
            HideNotification();

            try
            {
                using (var zipHelper = new Helpers.ZipHelper())
                {
                    string fileContent = zipHelper.GetFileContent(tbSolutionFile.Text, Helpers.Statics.CustomizationsFileName);
                    string xml         = Helpers.CustomizationsFileProcessor.GetSiteMap(fileContent);

                    teReplacementSitemap.Text = xml;
                }
            }
            catch (Exception ex)
            {
                ShowErrorNotification(ex.Message, null);
                tbSolutionFile.BackColor = badColor;
            }
        }