示例#1
0
 public Slider(SliderTypes sliderType, float currentValue)
 {
     SliderType   = sliderType;
     CurrentValue = currentValue;
     DisplayName  = TypeToDisplayName[SliderType];
     Tooltip      = TypeToTooltip[SliderType];
 }
示例#2
0
 public static string RenderSlider(this HtmlHelper htmlHelper, string[] sliderIds, SliderTypes sliderType)
 {
     switch (sliderType)
     {
         case SliderTypes.Recommendation:
             return RenderSlider(htmlHelper, sliderIds, new { });
         case SliderTypes.DefaultFuntionality:
             return RenderSlider(htmlHelper, sliderIds, new { });
         default:    // Recommendation
             return RenderSlider(htmlHelper, sliderIds, new { });
     }
 }
        private void _handleDataPush(MessageColonyDataPush data, Colony colony, IShip requestingShip)
        {
            switch (data.UpdateType)
            {
            case UpdateTypes.SetSlider:
            {
                SliderTypes sliderType  = (SliderTypes)(byte)data.FirstIdentifier;       //Dunno if the byte cast is necessary
                float       sliderValue = data.Data;
                colony.Sliders[sliderType].CurrentValue = sliderValue;

                break;
            }

            case UpdateTypes.AddConstructableToQueue:
            {
                throw new NotImplementedException();
                break;
            }

            case UpdateTypes.WithdrawResource:
            {
                throw new NotImplementedException();
                //TransactionSequence tr = new TransactionSequence();
                //tr.AddTransaction

                //_cargoSynchronizer.RequestAtomicTransactionSequence()
                break;
            }

            case UpdateTypes.DropResource:
            {
                throw new NotImplementedException();
                break;
            }
            }
        }
示例#4
0
        public static string Slider(this HtmlHelper htmlHelper, string id, string value, SliderTypes sliderType, object htmlAttributes, bool withoutScript)
        {
            // Create tag builder
            var builder = new TagBuilder("div");

            // Create valid id
            builder.GenerateId(id);

            // Add attributes
            builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));

            // Render tag
            return(builder.ToString(TagRenderMode.Normal)
                   + (withoutScript == true ? string.Empty : "\n    " + RenderSlider(htmlHelper, new string[] { id }, sliderType)));
        }
示例#5
0
 public static string Slider(this HtmlHelper htmlHelper, string id, string value, SliderTypes sliderType, object htmlAttributes)
 {
     return(Slider(htmlHelper, id, value, sliderType, htmlAttributes, false /*withoutScript*/));
 }
示例#6
0
 public static string Slider(this HtmlHelper htmlHelper, string id, string value, SliderTypes sliderType, bool withoutScript)
 {
     return(Slider(htmlHelper, id, value, sliderType, null /*htmlAttributes*/, withoutScript));
 }
示例#7
0
        public static string RenderSlider(this HtmlHelper htmlHelper, string[] sliderIds, SliderTypes sliderType)
        {
            switch (sliderType)
            {
            case SliderTypes.Recommendation:
                return(RenderSlider(htmlHelper, sliderIds, new { }));

            case SliderTypes.DefaultFuntionality:
                return(RenderSlider(htmlHelper, sliderIds, new { }));

            default:        // Recommendation
                return(RenderSlider(htmlHelper, sliderIds, new { }));
            }
        }
示例#8
0
        public static string Slider(this HtmlHelper htmlHelper, string id, string value, SliderTypes sliderType, object htmlAttributes, bool withoutScript)
        {
            // Create tag builder
            var builder = new TagBuilder("div");

            // Create valid id
            builder.GenerateId(id);

            // Add attributes
            builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));

            // Render tag
            return builder.ToString(TagRenderMode.Normal)
                + (withoutScript == true ? string.Empty : "\n    " + RenderSlider(htmlHelper, new string[] { id }, sliderType));
        }
示例#9
0
 public static string Slider(this HtmlHelper htmlHelper, string id, string value, SliderTypes sliderType, object htmlAttributes)
 {
     return Slider(htmlHelper, id, value, sliderType, htmlAttributes, false/*withoutScript*/);
 }
示例#10
0
 public static string Slider(this HtmlHelper htmlHelper, string id, string value, SliderTypes sliderType, bool withoutScript)
 {
     return Slider(htmlHelper, id, value, sliderType, null/*htmlAttributes*/, withoutScript);
 }
示例#11
0
 public static string Slider(this HtmlHelper htmlHelper, string id, string value, SliderTypes sliderType)
 {
     return Slider(htmlHelper, id, value, sliderType, false/*withoutScript*/);
 }