/// <summary> /// Creates a custom spinner with a given SpinnerModel. /// </summary> /// <param name="model"></param> public G2DSpinner(SpinnerModel model) : base() { this.model = model; initialPressInterval = 20; pressInterval = 5; pressCount = 0; initialPress = true; textField = new G2DTextField("" + model.Value); textField.HorizontalAlignment = GoblinEnums.HorizontalAlignment.Right; textField.Editable = false; upArrowBound = new Rectangle(); downArrowBound = new Rectangle(); upArrowPoints = new List <Point>(); downArrowPoints = new List <Point>(); upPressed = downPressed = false; heldDown = false; buttonColor = Color.Turquoise; highlightColor = new Color((byte)0x99, (byte)255, (byte)255, (byte)255); arrowColor = Color.Navy; name = "G2DSpinner"; }
public IViewComponentResult Invoke() { bool useSpinner = HttpContext.Request.Cookies["UseSpinner"] != null; SpinnerModel spinner = new SpinnerModel(useSpinner); return(View(spinner)); }