Inheritance: IStatusStrategy
Exemplo n.º 1
0
        /// <summary>
        /// Gets the button status strategy.
        /// </summary>
        /// <param name="status">The status.</param>
        /// <returns></returns>
        private static IStatusStrategy GetStatusStrategy(ButtonStatus status)
        {
            IStatusStrategy strategy;
            switch (status)
            {
                case ButtonStatus.Success:
                    strategy = new SuccessStatusStrategy();
                    break;
                case ButtonStatus.Warning:
                    strategy = new WarningStatusStrategy();
                    break;
                case ButtonStatus.Danger:
                    strategy = new DangerStatusStrategy();
                    break;
                case ButtonStatus.Info:
                    strategy = new InfoStatusStrategy();
                    break;
                case ButtonStatus.Inverse:
                    strategy = new InverseStatusStragety();
                    break;
                default:
                    strategy = new DefaultStatusStrategy();
                    break;
            }

            return strategy;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the status strategy.
        /// </summary>
        /// <param name="status">The status.</param>
        private static IStatusStrategy GetStatusStrategy(BootstrapStatus status)
        {
            IStatusStrategy strategy;
            switch (status)
            {
                case BootstrapStatus.Success:
                    strategy = new SuccessStatusStrategy();
                    break;
                case BootstrapStatus.Warning:
                    strategy = new WarningStatusStrategy();
                    break;
                case BootstrapStatus.Important:
                    strategy = new ImportantStatusStrategy();
                    break;
                case BootstrapStatus.Info:
                    strategy = new InfoStatusStrategy();
                    break;
                case BootstrapStatus.Inverse:
                    strategy = new InverseStatusStragety();
                    break;
                default:
                    strategy = new DefaultStatusStrategy();
                    break;
            }

            return strategy;
        }