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

            foreach (var viewport in viewports)
            {
                var screen = Screen.AllScreens.First(s => s.DeviceName == viewport.MonitorId);
                _viewportService.UpsertViewport(name, moduleId, screen, viewport);
            }
        }
Beispiel #2
0
        public override bool Commit()
        {
            var deviceScreenId = _profileService.GetValue <string[]>(ViewportProfileCategories.Viewports, ViewportSettingKeys.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)
                {
                    _viewportService.UpsertViewport(selected.Name.Value, selected.Module.Value.ModuleId, screen, viewport);
                }
            }

            return(base.Commit());
        }