Esempio n. 1
0
 public Slider(SliderTypes sliderType, float currentValue)
 {
     SliderType   = sliderType;
     CurrentValue = currentValue;
     DisplayName  = TypeToDisplayName[SliderType];
     Tooltip      = TypeToTooltip[SliderType];
 }
Esempio n. 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;
            }
            }
        }
Esempio n. 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)));
        }
Esempio n. 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*/));
 }
Esempio n. 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));
 }
Esempio n. 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 { }));
            }
        }
Esempio n. 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));
        }
Esempio n. 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*/);
 }
Esempio n. 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);
 }
Esempio n. 11
0
 public static string Slider(this HtmlHelper htmlHelper, string id, string value, SliderTypes sliderType)
 {
     return Slider(htmlHelper, id, value, sliderType, false/*withoutScript*/);
 }