Example #1
0
        public static SensePanelComboItem CreateComboItem(SensePropertyBag parameter,
                                                          SensePanelComboItem.SelectedIndexChangedEventHandler handler)
        {
            SensePanelComboItem result = new SensePanelComboItem(parameter.PropertyName)
            {
                LabelText = parameter.PropertyLabel,
                Enabled   = parameter.PropertyEnabled
            };

            result.OnSelectedIndexChanged += handler;

            return(result);
        }
Example #2
0
        public static SensePanelTrackbarItem CreateTrackbarItem(SensePropertyBag parameter,
                                                                SensePanelTrackbarItem.ValueEventHandler handler)
        {
            SensePanelTrackbarItem result = new SensePanelTrackbarItem(parameter.PropertyName)
            {
                ButtonAnimation     = true,
                ProcessEntireButton = false,
                Text  = parameter.PropertyLabel,
                Value = int.Parse(Settings.GetProperty(parameter.PropertyName))
            };

            result.OnValueChanged += handler;

            return(result);
        }
Example #3
0
        public static SensePanelTextboxItem CreateTextboxItem(SensePropertyBag parameter, EventHandler handler)
        {
            SensePanelTextboxItem result = new SensePanelTextboxItem(parameter.PropertyName)
            {
                LabelWidth    = 30,
                LayoutSytle   = SenseTexboxLayoutStyle.Horizontal,
                LabelText     = parameter.PropertyLabel,
                ShowSeparator = true,
                Text          = Settings.GetProperty(parameter.PropertyName)
            };

            result.TextChanged += handler;

            return(result);
        }
Example #4
0
        public static SensePanelNumericItem CreateNumericItem(SensePropertyBag parameter,
                                                              SensePanelNumericItem.ValueChangedEventHandler handler)
        {
            SensePanelNumericItem result = new SensePanelNumericItem(parameter.PropertyName)
            {
                AutoShowDialog     = true,
                AutoShowDialogText = parameter.PropertyLabel,
                ButtonAnimation    = false,
                PrimaryText        = parameter.PropertyLabel,
                SecondaryText      = parameter.PropertyExplanation,
                Value = int.Parse(Settings.GetProperty(parameter.PropertyName))
            };

            result.OnValueChanged += handler;

            return(result);
        }
Example #5
0
        public static SensePanelOnOffItem CreateOnOffItem(SensePropertyBag parameter,
                                                          SensePanelOnOffItem.StatusEventHandler handler)
        {
            SensePanelOnOffItem result = new SensePanelOnOffItem(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);
        }