public void SaveViewports(string name, string moduleId, Viewport[] viewports)
        {
            _profileSettingsService.ClearViewports(name, moduleId);

            foreach (var viewport in viewports)
            {
                var screen = Screen.AllScreens.First(s => s.DeviceName == viewport.MonitorId);
                _profileSettingsService.UpsertViewport(name, moduleId, screen, viewport);
            }
        }
Exemple #2
0
        public override bool Commit()
        {
            var deviceScreenId = _profileSettingsService.GetValue <string[]>(ProfileSettingsCategories.Viewports, SettingsKeys.DeviceViewportsDisplays).First();
            var screen         = Screen.AllScreens.First(s => s.DeviceName == deviceScreenId);

            foreach (var selected in ModuleViewports.Where(mv => mv.IsSelected.Value))
            {
                foreach (var viewport in selected.Viewports)
                {
                    _profileSettingsService.UpsertViewport(selected.Name.Value, selected.Module.Value.ModuleId, screen, viewport);
                }
            }

            return(base.Commit());
        }