Exemple #1
0
        public static void CheckoutOrUpdate(HttpApplication context, IConfigurationManager configurationManager, IRepositoryManager repositoryManager)
        {
            if (configurationManager == null)
            {
                throw new ArgumentNullException("configurationManager");
            }

            if (repositoryManager == null)
            {
                throw new ArgumentNullException("repositoryManager");
            }

            var repositoryUri = configurationManager.AppSettings["SiteRepositoryUri"];
            var path          = configurationManager.AppSettings["SitePath"];

            if (!Path.IsPathRooted(path))
            {
                path = context.Server.MapPath(path);
            }

            try
            {
                repositoryManager.CheckoutOrUpdate(repositoryUri, path);
            }
            catch { }
        }
        public static void CheckoutOrUpdate(HttpApplication context, IConfigurationManager configurationManager, IRepositoryManager repositoryManager)
        {
            if (configurationManager == null)
            {
                throw new ArgumentNullException("configurationManager");
            }

            if (repositoryManager == null)
            {
                throw new ArgumentNullException("repositoryManager");
            }

            var repositoryUri = configurationManager.AppSettings["SiteRepositoryUri"];
            var path = configurationManager.AppSettings["SitePath"];
            if (!Path.IsPathRooted(path))
            {
                path = context.Server.MapPath(path);
            }

            try
            {
                repositoryManager.CheckoutOrUpdate(repositoryUri, path);
            }
            catch { }
        }