Exemplo n.º 1
0
Arquivo: Slider.cs Projeto: Zedfa/Core
        private void SerializeProperties(IDictionary <string, object> options)
        {
            FluentDictionary.For(options)
            .Add("orientation", Orientation.ToString().ToLowerInvariant(), () => Orientation.HasValue)
            .Add("tickPlacement", TickPlacement.ToString().ToLowerInvariant(), () => TickPlacement.HasValue)
            .Add("dragHandleTitle", DragHandleTitle, () => DragHandleTitle.HasValue())
            .Add("increaseButtonTitle", IncreaseButtonTitle, () => IncreaseButtonTitle.HasValue())
            .Add("decreaseButtonTitle", DecreaseButtonTitle, () => DecreaseButtonTitle.HasValue())
            .Add("showButtons", ShowButtons, () => ShowButtons.HasValue)
            .Add("smallStep", SmallStep, () => SmallStep.HasValue)
            .Add("largeStep", LargeStep, () => LargeStep.HasValue)
            .Add("min", Min, () => Min.HasValue)
            .Add("max", Max, () => Max.HasValue);

            Settings.SerializeTo("tooltip", options);
        }
Exemplo n.º 2
0
        public override void WriteInitializationScript(TextWriter writer)
        {
            var options = new Dictionary <string, object>(Events);

            if (Format.HasValue())
            {
                options["format"] = Format;
            }

            if (Culture.HasValue())
            {
                options["culture"] = Culture;
            }

            if (Placeholder.HasValue())
            {
                options["placeholder"] = Placeholder;
            }

            if (IncreaseButtonTitle.HasValue())
            {
                options["upArrowText"] = IncreaseButtonTitle;
            }

            if (DecreaseButtonTitle.HasValue())
            {
                options["downArrowText"] = DecreaseButtonTitle;
            }

            if (Spinners != null)
            {
                options["spinners"] = Spinners;
            }

            if (Decimals != null)
            {
                options["decimals"] = Decimals;
            }

            writer.Write(Initializer.Initialize(Selector, "NumericTextBox", options));

            base.WriteInitializationScript(writer);
        }