示例#1
0
        public void Tab(string label, BootstrapColors borderColor = BootstrapColors.Default)
        {
            if (string.IsNullOrWhiteSpace(label))
            {
                throw new ArgumentNullException("label");
            }

            var tabId = base.element._id + "-" + _tabIndex;

            _tabIds.Enqueue(tabId);

            if (_isFirstTab)
            {
                if (_activeTabIndex == 0)
                {
                    _activeTabIndex = 1;
                }
                WriteTab(label, borderColor, tabId, _tabIndex == _activeTabIndex);
                _isFirstTab = false;
            }
            else
            {
                WriteTab(label, borderColor, tabId, _tabIndex == _activeTabIndex);
            }

            _tabIndex++;
        }
示例#2
0
        public void Add(string text, BootstrapColors color, int dismissTimeSeconds = 5)
        {
            var newAlert = new AlertInstance(text, color, dismissTimeSeconds);

            if (OnAlertAdd != null)
            {
                OnAlertAdd(newAlert);
            }
        }
示例#3
0
        public AlertInstance(string text, BootstrapColors color, int dismissTimeSeconds)
        {
            Text  = text;
            Color = color;
            DismissTimeSeconds = dismissTimeSeconds;

            if (dismissTimeSeconds > 0)
            {
                _timer          = new Timer();
                _timer.Elapsed += new ElapsedEventHandler(OnTimerTick);
                _timer.Interval = dismissTimeSeconds * 1000;
                _timer.Enabled  = true;
                _timer.Start();
            }
        }
示例#4
0
 public static string GetClassForButtonColor(BootstrapColors buttonColor)
 {
     if (buttonColor == BootstrapColors.Primary)
     {
         return("btn-primary");
     }
     if (buttonColor == BootstrapColors.Info)
     {
         return("btn-info");
     }
     if (buttonColor == BootstrapColors.Success)
     {
         return("btn-success");
     }
     if (buttonColor == BootstrapColors.Warning)
     {
         return("btn-warning");
     }
     if (buttonColor == BootstrapColors.Danger)
     {
         return("btn-danger");
     }
     if (buttonColor == BootstrapColors.Inverse)
     {
         return("btn-inverse");
     }
     if (buttonColor == BootstrapColors.Sky)
     {
         return("btn-sky");
     }
     if (buttonColor == BootstrapColors.Blueberry)
     {
         return("btn-blueberry");
     }
     if (buttonColor == BootstrapColors.Yellow)
     {
         return("btn-yellow");
     }
     if (buttonColor == BootstrapColors.Darkorange)
     {
         return("btn-darkorange");
     }
     if (buttonColor == BootstrapColors.Magenta)
     {
         return("btn-magenta");
     }
     if (buttonColor == BootstrapColors.Purple)
     {
         return("btn-purple");
     }
     if (buttonColor == BootstrapColors.Maroon)
     {
         return("btn-maroon");
     }
     if (buttonColor == BootstrapColors.Darkpink)
     {
         return("btn-darkpink");
     }
     if (buttonColor == BootstrapColors.Azure)
     {
         return("btn-azure");
     }
     if (buttonColor == BootstrapColors.Orange)
     {
         return("btn-orange");
     }
     if (buttonColor == BootstrapColors.Palegreen)
     {
         return("btn-palegreen");
     }
     if (buttonColor == BootstrapColors.Blue)
     {
         return("btn-blue");
     }
     return(string.Empty);
 }
示例#5
0
 public AlertInstance(string text, BootstrapColors color)
 {
     Text  = text;
     Color = color;
 }
示例#6
0
文件: Widget.cs 项目: kkamau/WAFC
        public Widget BodyBorder(BootstrapColors color, Direction direction)
        {
            switch (color)
            {
            case BootstrapColors.Danger:
                _bodyBorderColor = "bordered-danger";
                break;

            case BootstrapColors.Default:
                break;

            case BootstrapColors.Info:
                _bodyBorderColor = "bordered-info";
                break;

            case BootstrapColors.Primary:
                _bodyBorderColor = "bordered-primary";
                break;

            case BootstrapColors.Success:
                _bodyBorderColor = "bordered-success";
                break;

            case BootstrapColors.Warning:
                _bodyBorderColor = "bordered-warning";
                break;

            case BootstrapColors.Sky:
                _bodyBorderColor = "bordered-sky";
                break;

            case BootstrapColors.Blueberry:
                _bodyBorderColor = "bordered-blueberry";
                break;

            case BootstrapColors.Yellow:
                _bodyBorderColor = "bordered-yellow";
                break;

            case BootstrapColors.Darkorange:
                _bodyBorderColor = "bordered-darkorange";
                break;

            case BootstrapColors.Magenta:
                _bodyBorderColor = "bordered-magenta";
                break;

            case BootstrapColors.Purple:
                _bodyBorderColor = "bordered-purple";
                break;

            case BootstrapColors.Maroon:
                _bodyBorderColor = "bordered-maroon";
                break;

            case BootstrapColors.Darkpink:
                _bodyBorderColor = "bordered-darkpink";
                break;

            case BootstrapColors.Pink:
                _bodyBorderColor = "bordered-pink";
                break;

            case BootstrapColors.Azure:
                _bodyBorderColor = "bordered-azure";
                break;

            case BootstrapColors.Orange:
                _bodyBorderColor = "bordered-orange";
                break;

            case BootstrapColors.Palegreen:
                _bodyBorderColor = "bordered-palegreen";
                break;

            case BootstrapColors.Inverse:
                _bodyBorderColor = "bordered-inverse";
                break;

            case BootstrapColors.Blue:
                _bodyBorderColor = "bordered-blue";
                break;

            default:
                break;
            }

            switch (direction)
            {
            case Direction.Bottom:
                _bodyBorderDirection = "bordered-bottom";
                break;

            case Direction.Top:
                _bodyBorderDirection = "bordered-top";
                break;

            case Direction.Right:
                _bodyBorderDirection = "bordered-right";
                break;

            case Direction.Left:
                _bodyBorderDirection = "bordered-left";
                break;

            default:
                break;
            }
            return(this);
        }
示例#7
0
文件: Widget.cs 项目: kkamau/WAFC
        public Widget BodyColor(BootstrapColors color)
        {
            switch (color)
            {
            case BootstrapColors.Danger:
                _bodyColor = "bg-danger";
                break;

            case BootstrapColors.Default:
                break;

            case BootstrapColors.Info:
                _bodyColor = "bg-info";
                break;

            case BootstrapColors.Primary:
                _bodyColor = "bg-primary";
                break;

            case BootstrapColors.Success:
                _bodyColor = "bg-success";
                break;

            case BootstrapColors.Warning:
                _bodyColor = "bg-warning";
                break;

            case BootstrapColors.Sky:
                _bodyColor = "bg-sky";
                break;

            case BootstrapColors.Blueberry:
                _bodyColor = "bg-blueberry";
                break;

            case BootstrapColors.Yellow:
                _bodyColor = "bg-yellow";
                break;

            case BootstrapColors.Darkorange:
                _bodyColor = "bg-darkorange";
                break;

            case BootstrapColors.Magenta:
                _bodyColor = "bg-magenta";
                break;

            case BootstrapColors.Purple:
                _bodyColor = "bg-purple";
                break;

            case BootstrapColors.Maroon:
                _bodyColor = "bg-maroon";
                break;

            case BootstrapColors.Darkpink:
                _bodyColor = "bg-darkpink";
                break;

            case BootstrapColors.Pink:
                _bodyColor = "bg-pink";
                break;

            case BootstrapColors.Azure:
                _bodyColor = "bg-azure";
                break;

            case BootstrapColors.Orange:
                _bodyColor = "bg-orange";
                break;

            case BootstrapColors.Palegreen:
                _bodyColor = "bg-palegreen";
                break;

            case BootstrapColors.Inverse:
                _bodyColor = "bg-inverse";
                break;

            case BootstrapColors.Blue:
                _bodyColor = "bg-blue";
                break;

            default:
                break;
            }
            return(this);
        }
示例#8
0
文件: Widget.cs 项目: kkamau/WAFC
        public Widget HeaderIconColor(BootstrapColors color)
        {
            switch (color)
            {
            case BootstrapColors.Danger:
                _headerIconColor = "danger";
                break;

            case BootstrapColors.Default:
                break;

            case BootstrapColors.Info:
                _headerIconColor = "info";
                break;

            case BootstrapColors.Primary:
                _headerIconColor = "primary";
                break;

            case BootstrapColors.Success:
                _headerIconColor = "success";
                break;

            case BootstrapColors.Warning:
                _headerIconColor = "warning";
                break;

            case BootstrapColors.Sky:
                _headerIconColor = "sky";
                break;

            case BootstrapColors.Blueberry:
                _headerIconColor = "blueberry";
                break;

            case BootstrapColors.Yellow:
                _headerIconColor = "yellow";
                break;

            case BootstrapColors.Darkorange:
                _headerIconColor = "darkorange";
                break;

            case BootstrapColors.Magenta:
                _headerIconColor = "magenta";
                break;

            case BootstrapColors.Purple:
                _headerIconColor = "purple";
                break;

            case BootstrapColors.Maroon:
                _headerIconColor = "maroon";
                break;

            case BootstrapColors.Darkpink:
                _headerIconColor = "darkpink";
                break;

            case BootstrapColors.Pink:
                _headerIconColor = "pink";
                break;

            case BootstrapColors.Azure:
                _headerIconColor = "azure";
                break;

            case BootstrapColors.Orange:
                _headerIconColor = "orange";
                break;

            case BootstrapColors.Palegreen:
                _headerIconColor = "palegreen";
                break;

            case BootstrapColors.Inverse:
                _headerIconColor = "inverse";
                break;

            case BootstrapColors.Blue:
                _headerIconColor = "blue";
                break;

            default:
                break;
            }
            return(this);
        }
示例#9
0
 public Badge Color(BootstrapColors color)
 {
     _color = color;
     return(this);
 }
 public T Color(BootstrapColors color)
 {
     this._model.color = color;
     return((T)this);
 }
示例#11
0
 public InlineLabel Color(BootstrapColors color)
 {
     _color = color;
     return(this);
 }
示例#12
0
        public static string BuildColorClass(string componentName, BootstrapColors standardColor)
        {
            var htmlClass = $"{componentName}-{standardColor.ToString().ToLower()}";

            return(htmlClass);
        }
示例#13
0
        private void WriteTab(string label, BootstrapColors borderColor, string href, bool isActive)
        {
            string tabColor = "";

            switch (borderColor)
            {
            case BootstrapColors.Danger:
                tabColor = "tab-danger";
                break;

            case BootstrapColors.Default:
                tabColor = "";
                break;

            case BootstrapColors.Info:
                tabColor = "tab-info";
                break;

            case BootstrapColors.Primary:
                tabColor = "tab-primary";
                break;

            case BootstrapColors.Success:
                tabColor = "tab-success";
                break;

            case BootstrapColors.Warning:
                tabColor = "tab-warning";
                break;

            case BootstrapColors.Sky:
                tabColor = "tab-sky";
                break;

            case BootstrapColors.Blueberry:
                tabColor = "tab-blueberry";
                break;

            case BootstrapColors.Yellow:
                tabColor = "tab-yellow";
                break;

            case BootstrapColors.Darkorange:
                tabColor = "tab-darkorange";
                break;

            case BootstrapColors.Magenta:
                tabColor = "tab-magenta";
                break;

            case BootstrapColors.Purple:
                tabColor = "tab-purple";
                break;

            case BootstrapColors.Maroon:
                tabColor = "tab-maroon";
                break;

            case BootstrapColors.Darkpink:
                tabColor = "tab-darkpink";
                break;

            case BootstrapColors.Pink:
                tabColor = "tab-pink";
                break;

            case BootstrapColors.Azure:
                tabColor = "tab-azure";
                break;

            case BootstrapColors.Orange:
                tabColor = "tab-orange";
                break;

            case BootstrapColors.Inverse:
                tabColor = "tab-inverse";
                break;

            case BootstrapColors.Palegreen:
                tabColor = "tab-palegreen";
                break;

            case BootstrapColors.Blue:
                tabColor = "tab-blue";
                break;

            default:
                tabColor = "";
                break;
            }


            textWriter.Write(isActive
                ? string.Format(@"<li class=""active " + tabColor + @"""><a data-toggle=""tab"" href=""#{1}"">{0}</a></li>", label, href)
                : string.Format(@"<li class=""" + tabColor + @"""><a data-toggle=""tab"" href=""#{1}"">{0}</a></li>", label, href)
                             );
        }
示例#14
0
        internal ProgressBar(TextWriter writer, string text, string progressId, int value,
                             BootstrapColors color = BootstrapColors.Default, int minValue = 0, int maxValue = 100,
                             bool isVertical       = false)
        {
            textWriter = writer;


            var builder = new TagBuilder("div");

            switch (color)
            {
            case BootstrapColors.Danger:
                builder.AddCssClass("progress-bar progress-bar-danger");
                break;

            case BootstrapColors.Default:
                builder.AddCssClass("progress-bar");
                break;

            case BootstrapColors.Info:
                builder.AddCssClass("progress-bar progress-bar-info");
                break;

            case BootstrapColors.Primary:
                builder.AddCssClass("progress-bar progress-bar-primary");
                break;

            case BootstrapColors.Success:
                builder.AddCssClass("progress-bar progress-bar-success");
                break;

            case BootstrapColors.Warning:
                builder.AddCssClass("progress-bar progress-bar-warning");
                break;

            case BootstrapColors.Sky:
                builder.AddCssClass("progress-bar progress-bar-sky");
                break;

            case BootstrapColors.Blueberry:
                builder.AddCssClass("progress-bar progress-bar-blueberry");
                break;

            case BootstrapColors.Yellow:
                builder.AddCssClass("progress-bar progress-bar-yellow");
                break;

            case BootstrapColors.Darkorange:
                builder.AddCssClass("progress-bar progress-bar-darkorange");
                break;

            case BootstrapColors.Magenta:
                builder.AddCssClass("progress-bar progress-bar-magenta");
                break;

            case BootstrapColors.Purple:
                builder.AddCssClass("progress-bar progress-bar-purple");
                break;

            case BootstrapColors.Maroon:
                builder.AddCssClass("progress-bar progress-bar-maroon");
                break;

            case BootstrapColors.Darkpink:
                builder.AddCssClass("progress-bar progress-bar-darkpink");
                break;

            case BootstrapColors.Pink:
                builder.AddCssClass("progress-bar progress-bar-pink");
                break;

            case BootstrapColors.Azure:
                builder.AddCssClass("progress-bar progress-bar-azure");
                break;

            case BootstrapColors.Orange:
                builder.AddCssClass("progress-bar progress-bar-orange");
                break;

            case BootstrapColors.Palegreen:
                builder.AddCssClass("progress-bar progress-bar-palegreen");
                break;

            case BootstrapColors.Inverse:
                builder.AddCssClass("progress-bar progress-bar-inverse");
                break;

            case BootstrapColors.Blue:
                builder.AddCssClass("progress-bar progress-bar-blue");
                break;

            default:
                builder.AddCssClass("progress-bar");
                break;
            }
            builder.MergeAttribute("role", "progressbar");
            builder.MergeAttribute("aria-valuenow", value.ToString());
            if (!isVertical)
            {
                builder.MergeAttribute("style", @"width:" + value + "%");
            }
            else
            {
                builder.MergeAttribute("style", @"height:" + value + "%");
            }


            builder.MergeAttribute("aria-valuemin", minValue.ToString());
            builder.MergeAttribute("aria-valuemax", maxValue.ToString());

            if (!String.IsNullOrEmpty(text))
            {
                var builder2 = new TagBuilder("span");
                builder2.InnerHtml = text;
                builder.InnerHtml  = builder2.ToString();
            }

            builder.MergeAttribute("id", progressId);
            textWriter.Write(builder.ToString());
        }
示例#15
0
        public Modal Color(BootstrapColors color)
        {
            switch (color)
            {
            case BootstrapColors.Danger:
                EnsureClass("modal-danger");
                break;

            case BootstrapColors.Default:
                break;

            case BootstrapColors.Info:
                EnsureClass("modal-info");
                break;

            case BootstrapColors.Primary:
                EnsureClass("modal-primary");
                break;

            case BootstrapColors.Success:
                EnsureClass("modal-success");
                break;

            case BootstrapColors.Warning:
                EnsureClass("modal-warning");
                break;

            case BootstrapColors.Sky:
                EnsureClass("modal-sky");
                break;

            case BootstrapColors.Blueberry:
                EnsureClass("modal-blueberry");
                break;

            case BootstrapColors.Yellow:
                EnsureClass("modal-yellow");
                break;

            case BootstrapColors.Darkorange:
                EnsureClass("modal-darkorange");
                break;

            case BootstrapColors.Magenta:
                EnsureClass("modal-magenta");
                break;

            case BootstrapColors.Purple:
                EnsureClass("modal-purple");
                break;

            case BootstrapColors.Maroon:
                EnsureClass("modal-maroon");
                break;

            case BootstrapColors.Darkpink:
                EnsureClass("modal-darkpink");
                break;

            case BootstrapColors.Pink:
                EnsureClass("modal-pink");
                break;

            case BootstrapColors.Azure:
                EnsureClass("modal-azure");
                break;

            case BootstrapColors.Orange:
                EnsureClass("modal-orange");
                break;

            case BootstrapColors.Palegreen:
                EnsureClass("modal-palegreen");
                break;

            case BootstrapColors.Inverse:
                EnsureClass("modal-inverse");
                break;

            case BootstrapColors.Blue:
                EnsureClass("modal-blue");
                break;

            default:
                break;
            }
            return(this);
        }
示例#16
0
 public ProgressBar BeginProgressBar(string text, string progressId, int value, BootstrapColors color = BootstrapColors.Default, int minValue = 0, int maxValue = 100)
 {
     return(new ProgressBar(base.textWriter, text, progressId, value, color, minValue, maxValue, _isVertical));
 }