Esempio n. 1
0
        public PercentageProfileWindow()
        {
            InitializeComponent();

            LayoutDisplay.SetWithAndHeight((int)LayoutDisplay.Width, (int)LayoutDisplay.Height);
            LayoutDisplay.DrawLayout();
            LayoutDisplay.EnableClick();
            LayoutDisplay.DisableColorTimer();

            if (UserSettings.Settings.ActiveDevice.PercentageProfile != null)
            {
                var serialized = JsonConvert.SerializeObject(UserSettings.Settings.ActiveDevice.PercentageProfile); //Deep copy the profile when editing
                _profile = JsonConvert.DeserializeObject <PercentageProfile>(serialized);

                BuildStepList();

                foreach (var step in _profile.Steps)
                {
                    LayoutDisplay.LockPanels(step.PanelIds);
                }
            }
            else
            {
                _profile = new PercentageProfile();
            }
        }
Esempio n. 2
0
        private void Plus_Click(object sender, RoutedEventArgs e)
        {
            if (LayoutDisplay.SelectedPanelIds.Count <= 0)
            {
                return;
            }

            var newStep = new PercentageStep();

            foreach (var panelId in LayoutDisplay.SelectedPanelIds)
            {
                newStep.PanelIds.Add(panelId);
            }

            _profile.Steps.Add(newStep);

            BuildStepList();

            LayoutDisplay.LockPanels(LayoutDisplay.SelectedPanelIds);

            LayoutDisplay.ClearSelectedPanels();
        }