예제 #1
0
 void request_ResponseReceived(HttpRequest sender, HttpResponse response)
 {
     var x = response.Text;
     Debug.Print(x);
     temp = (TextBlock)Glide.MainWindow.GetChildByName("texto_temperatura");
     temp.Text = x;
     sliderBar = (Slider)Glide.MainWindow.GetChildByName("slider");
     sliderBar.Value = Convert.ToDouble(x);
     Glide.MainWindow = temperatura;
 }
예제 #2
0
        /// <summary>
        /// Parses the Slider XML into a UI component.
        /// </summary>
        /// <param name="reader">XML reader object.</param>
        /// <returns>Slider object.</returns>
        private static Slider LoadSlider(XmlReader reader)
        {
            string name = reader.GetAttribute("Name");
            ushort alpha = (reader.GetAttribute("Alpha") != null) ? Convert.ToUInt16(reader.GetAttribute("Alpha")) : _defaultDisplayObject.Alpha;
            int x = Convert.ToInt32(reader.GetAttribute("X"));
            int y = Convert.ToInt32(reader.GetAttribute("Y"));
            int width = Convert.ToInt32(reader.GetAttribute("Width"));
            int height = Convert.ToInt32(reader.GetAttribute("Height"));
            bool visible = (reader.GetAttribute("Visible") != null) ? (reader.GetAttribute("Visible") == bool.TrueString) : _defaultDisplayObject.Visible;
            bool enabled = (reader.GetAttribute("Enabled") != null) ? (reader.GetAttribute("Enabled") == bool.TrueString) : _defaultDisplayObject.Enabled;

            string direction = reader.GetAttribute("Direction");
            int snapInterval = Convert.ToInt32(reader.GetAttribute("SnapInterval"));
            int tickInterval = Convert.ToInt32(reader.GetAttribute("TickInterval"));
            Color tickColor = GlideUtils.Convert.ToColor(reader.GetAttribute("TickColor"));
            int knobSize = Convert.ToInt32(reader.GetAttribute("KnobSize"));
            double minimum = Convert.ToDouble(reader.GetAttribute("Minimum"));
            double maximum = Convert.ToDouble(reader.GetAttribute("Maximum"));
            double value = Convert.ToDouble(reader.GetAttribute("Value"));

            Slider slider = new Slider(name, alpha, x, y, width, height);
            slider.Visible = visible;
            slider.Enabled = enabled;
            slider.Direction = direction;
            slider.SnapInterval = snapInterval;
            slider.TickInterval = tickInterval;
            slider.TickColor = tickColor;
            slider.KnobSize = knobSize;
            slider.Minimum = minimum;
            slider.Maximum = maximum;
            slider.Value = value;

            return slider;
        }