Esempio n. 1
0
        public static SensePanelCheckboxItem CreateCheckboxItem(SensePropertyBag parameter,
                                                                SensePanelCheckboxItem.StatusEventHandler handler)
        {
            SensePanelCheckboxItem result = new SensePanelCheckboxItem(parameter.PropertyName)
            {
                ButtonAnimation     = true,
                ProcessEntireButton = false,
                PrimaryText         = parameter.PropertyLabel,
                Enabled             = true,
                Status        = BoolToStatus(Convert.ToBoolean(Settings.GetProperty(parameter.PropertyName))),
                SecondaryText = parameter.PropertyExplanation
            };

            result.OnStatusChanged += handler;

            return(result);
        }
Esempio n. 2
0
        //private void OnTextBoxItemTextChanged(object sender, System.EventArgs e)
        //{
        //    SensePanelTextboxItem textboxItem = (sender as SensePanelTextboxItem);

        //    if (null != textboxItem)
        //    {
        //        switch (textboxItem.Name)
        //        {
        //            case "AlertDistance":
        //                Settings.SetProperty(textboxItem.Name, textboxItem.Text);
        //                break;
        //            default:
        //                break;
        //        }
        //    }
        //}

        private void OnCheckboxStatusChanged(object sender, ItemStatus status)
        {
            SensePanelCheckboxItem _Itm = (sender as SensePanelCheckboxItem);

            if (_Itm != null)
            {
                UpdateSetting(_Itm.Name, SenseFactory.StatusToBool(status).ToString());

                switch (_Itm.Name)
                {
                case "LastStationFromRoute":
                    SensePanelComboItem _Cbo = (senseListCtrlAlert["Stations"] as SensePanelComboItem);
                    if (null != _Cbo)
                    {
                        _Cbo.Enabled = (status == ItemStatus.Off);
                    }
                    break;

                default:
                    break;
                }
            }
        }