Exemplo n.º 1
0
        //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        partial void OkButton_TouchUpInside(UIButton sender)
        {
            try
            {
                double val;

                if ((sensor.type.code == SensorTypeCodes.Pulse) || (sensor.type.code == SensorTypeCodes.IRDAModem))
                {
                    if (double.TryParse(Setting1Field.Text.Replace(" ", "").Replace(".", ","), out val) == true)
                    {
                        nodeValues[2] = val;
                    }

                    if (double.TryParse(Setting2Field.Text.Replace(" ", "").Replace(".", ","), out val) == true)
                    {
                        nodeValues[1] = val;
                    }

                    nodeValues[0] = nodeValues[1] + nodeValues[2];

                    if (double.TryParse(Setting3Field.Text.Replace(" ", "").Replace(".", ","), out val) == true)
                    {
                        nodeValues[3] = val;
                    }
                }
                else if (sensor.type.code == SensorTypeCodes.Pulse2Channel)
                {
                    if (double.TryParse(Setting1Field.Text.Replace(" ", "").Replace(".", ","), out val) == true)
                    {
                        nodeValues[0] = val;
                    }

                    if (double.TryParse(Setting2Field.Text.Replace(" ", "").Replace(".", ","), out val) == true)
                    {
                        nodeValues[2] = val;
                    }

                    if (double.TryParse(Setting3Field.Text.Replace(" ", "").Replace(".", ","), out val) == true)
                    {
                        nodeValues[1] = val;
                    }

                    nodeValues[3] = nodeValues[1];
                }
            }
            catch {}

            ByteBuffer buffer = new ByteBuffer();

            foreach (KeyValuePair <byte, double> nodeValue in (Dictionary <byte, double>)nodeValues)
            {
                buffer.Add((byte)nodeValue.Key);
                buffer.Add((double)nodeValue.Value);
            }

            DataManager.SheduleSetNodeValuesRequest(sensor.nodeID, buffer, null);
            DataManager.SheduleGetNodeValuesRequest(sensor.nodeID, DataUpdateCallback);

            OkButton.SetTitle(OkButton.Title(UIControlState.Normal) + "+", UIControlState.Normal);
        }
Exemplo n.º 2
0
        public LockScreenView(RectangleF frame) : base(frame)
        {
            SetDefaultStyles();
            var height = frame.Size.Height >= 568.0f ? 568.0f : frame.Size.Height;

            ContentView = new UIView(new RectangleF(0, 0, 320, height));
            ContentView.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin |
                                           UIViewAutoresizing.FlexibleTopMargin |
                                           UIViewAutoresizing.FlexibleRightMargin |
                                           UIViewAutoresizing.FlexibleBottomMargin;
            ContentView.Center = this.Center;
            AddSubview(ContentView);

            RequiresRotationCorrection = false;

            EnterPasscodeLabel      = StandardLabel();
            DigitsTextField         = new UITextField(Rectangle.Empty);
            EnterPasscodeLabel.Text = "Enter Passcode".Translate();
            DetailLabel             = StandardLabel();
            ButtonOne   = new LockButton(RectangleF.Empty, 1, string.Empty);
            ButtonTwo   = new LockButton(RectangleF.Empty, 2, "ABC");
            ButtonThree = new LockButton(RectangleF.Empty, 3, "DEF");

            ButtonFour = new LockButton(RectangleF.Empty, 4, "GHI");
            ButtonFive = new LockButton(RectangleF.Empty, 5, "JKL");
            ButtonSix  = new LockButton(RectangleF.Empty, 6, "MNO");

            ButtonSeven = new LockButton(RectangleF.Empty, 7, "PQRS");
            ButtonEight = new LockButton(RectangleF.Empty, 8, "TUV");
            ButtonNine  = new LockButton(RectangleF.Empty, 9, "WXYZ");

            ButtonZero = new LockButton(RectangleF.Empty, 0, string.Empty);

            var buttonType = UIButtonType.System;

            if (IsLessThanIOS6)
            {
                buttonType = UIButtonType.Custom;
            }
            CancelButton = UIButton.FromType(buttonType);
            CancelButton.SetTitle("Cancel".Translate(), UIControlState.Normal);
            CancelButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;

            DeleteButton = UIButton.FromType(buttonType);
            DeleteButton.SetTitle("Delete".Translate(), UIControlState.Normal);
            DeleteButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            DeleteButton.Alpha = 0.0f;

            OkButton = UIButton.FromType(buttonType);
            OkButton.SetTitle("OK".Translate(), UIControlState.Normal);
            OkButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            OkButton.Alpha = 0.0f;

            IsComplexPin = false;
        }