コード例 #1
0
        /// <summary>
        /// Creates a new instance of the <see cref="WebsiteManager" /> class.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <param name="log">The log.</param>
        /// <param name="server">The <see cref="ServerManager" /> to connect to.</param>
        /// <returns>a new instance of the <see cref="WebFarmManager" />.</returns>
        public static WebsiteManager Using(ICakeEnvironment environment, ICakeLog log, ServerManager server)
        {
            WebsiteManager manager = new WebsiteManager(environment, log);

            manager.SetServer(server);

            return(manager);
        }
コード例 #2
0
ファイル: WebsiteManager.cs プロジェクト: DrKoch/Cake.IIS
            public static WebsiteManager Using(ICakeEnvironment environment, ICakeLog log, ServerManager server)
            {
                WebsiteManager manager = new WebsiteManager(environment, log);

                manager.SetServer(server);

                return manager;
            }
コード例 #3
0
 public static bool SiteApplicationExists(this ICakeContext context, string server, ApplicationSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .ApplicationExists(settings));
     }
 }
コード例 #4
0
 public static void RemoveSiteApplication(this ICakeContext context, string server, ApplicationSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         WebsiteManager
         .Using(context.Environment, context.Log, manager)
         .RemoveApplication(settings);
     }
 }
コード例 #5
0
ファイル: BindingAliases.cs プロジェクト: shamork/Cake.IIS
 public static void RemoveBinding(this ICakeContext context, string server, string siteName, BindingSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         WebsiteManager
         .Using(context.Environment, context.Log, manager)
         .RemoveBinding(siteName, settings);
     }
 }
コード例 #6
0
 public static bool SiteVirtualDirectoryExists(this ICakeContext context, string server, VirtualDirectorySettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .VirtualDirectoryExists(settings));
     }
 }
コード例 #7
0
 public static void RemoveSiteVirtualDirectory(this ICakeContext context, string server, VirtualDirectorySettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         WebsiteManager
         .Using(context.Environment, context.Log, manager)
         .RemoveVirtualDirectory(settings);
     }
 }
コード例 #8
0
 public static bool StartSite(this ICakeContext context, string server, string name)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .Start(name));
     }
 }
コード例 #9
0
        public static void AddSiteApplication(this ICakeContext context, string server, ApplicationSettings settings)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                settings.ComputerName = server;

                WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .AddApplication(settings);
            }
        }
コード例 #10
0
        public static void AddSiteVirtualDirectory(this ICakeContext context, string server, VirtualDirectorySettings settings)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                settings.ComputerName = server;

                WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .AddVirtualDirectory(settings);
            }
        }
コード例 #11
0
        public static void CreateWebsite(this ICakeContext context, string server, WebsiteSettings settings)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                settings.ComputerName = server;

                WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .Create(settings);
            }
        }
コード例 #12
0
        public static bool RestartSite(this ICakeContext context, string server, string name)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                WebsiteManager webManager = WebsiteManager.Using(context.Environment, context.Log, manager);

                if (webManager.Stop(name))
                {
                    return(webManager.Start(name));
                }
                else
                {
                    return(false);
                }
            }
        }