Skip to content

Commit

Permalink
WPF shutdown fix. Fix for aliases getting erased. Sort device grid.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Feb 14, 2020
1 parent 6cc3857 commit 5687406
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 382 deletions.
14 changes: 2 additions & 12 deletions Desktop.Win/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,8 @@ private void Application_DispatcherUnhandledException(object sender, System.Wind

private void Application_Exit(object sender, ExitEventArgs e)
{
var conductor = ServiceContainer.Instance.GetRequiredService<Conductor>();
foreach (var viewer in conductor.Viewers.Values.ToArray())
{
try
{
viewer.Dispose();
}
catch (Exception ex)
{
Logger.Write(ex);
}
}
// Hack to fix application not exiting when window closed.
Environment.Exit(0);
}

private void Application_Startup(object sender, StartupEventArgs e)
Expand Down
14 changes: 11 additions & 3 deletions Server/Services/DataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,19 @@ public void SetDeviceSetupOptions(string deviceID, DeviceSetupOptions options)
var device = RemotelyContext.Devices.FirstOrDefault(x => x.ID == deviceID);
if (device != null)
{
device.Alias = options.DeviceAlias;
var group = RemotelyContext.DeviceGroups.FirstOrDefault(x =>
if (!string.IsNullOrWhiteSpace(options.DeviceAlias))
{
device.Alias = options.DeviceAlias;
}

if (!string.IsNullOrWhiteSpace(options.DeviceGroup))
{
var group = RemotelyContext.DeviceGroups.FirstOrDefault(x =>
x.Name.ToLower() == options.DeviceGroup.ToLower() &&
x.OrganizationID == device.OrganizationID);
device.DeviceGroup = group;
device.DeviceGroup = group;
}

RemotelyContext.SaveChanges();
}
}
Expand Down
185 changes: 0 additions & 185 deletions Server/wwwroot/Downloads/Install-Win10-x64.ps1

This file was deleted.

Loading

0 comments on commit 5687406

Please sign in to comment.