Ejemplo n.º 1
0
        /// <summary>
        /// Gets the image path for the state of the service app.
        /// </summary>
        /// <param name="serviceApp">The service app.</param>
        /// <returns></returns>
        public override string GetStateImagePath(DataAccessLayer.Models.ServiceApp serviceApp)
        {
            switch (serviceApp.CurrentState)
            {
            case ServiceAppState.NotLoaded:
                return(serviceApp.StartupTypeEnum == StartupType.Disabled ?
                       "~/Content/Images/Disabled.png" :
                       "~/Content/Images/Stop.png");

            case ServiceAppState.Ready:
                return(serviceApp.StartupTypeEnum == StartupType.Automatic ?
                       "~/Content/Images/OK.png" :
                       "~/Content/Images/OKManual.png");

            case ServiceAppState.Executing:
                return("~/Content/Images/Play.png");

            case ServiceAppState.Error:
                return("~/Content/Images/Error.png");

            case ServiceAppState.Unknown:
            default:
                return("~/Content/Images/Unknown.png");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Validates the entire service app.
        /// </summary>
        /// <param name="serviceApp">The service application.</param>
        /// <returns></returns>
        public bool ValidateServiceApp(DataAccessLayer.Models.ServiceApp serviceApp)
        {
            if (serviceApp == null)
            {
                return(false);
            }

            bool isValid = true;

            isValid &= this.ValidateAppName(serviceApp.Name);
            isValid &= this.ValidateStartupType(serviceApp.StartupTypeEnum);
            isValid &= this.ValidateEnvironmentName(serviceApp.Environment);
            isValid &= this.ValidateDescription(serviceApp.Description);
            isValid &= this.ValidateAppFilePath(serviceApp.AppFilePath);
            isValid &= this.ValidateSchedule(serviceApp.Schedule);

            return(isValid);
        }