mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 19:14:20 +01:00
Moved right click disconnect method to View Model
This commit is contained in:
parent
c4cdade076
commit
c865e3c9b2
@ -705,19 +705,7 @@ Properties.Resources.DS4Update, MessageBoxButton.YesNo, MessageBoxImage.Question
|
|||||||
private void ContStatusImg_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
|
private void ContStatusImg_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
CompositeDeviceModel item = conLvViewModel.CurrentItem;
|
CompositeDeviceModel item = conLvViewModel.CurrentItem;
|
||||||
DS4Device tempDev = item.Device;
|
item.RequestDisconnect();
|
||||||
if (tempDev.Synced && !tempDev.Charging)
|
|
||||||
{
|
|
||||||
if (tempDev.ConnectionType == ConnectionType.BT)
|
|
||||||
{
|
|
||||||
//tempDev.StopUpdate();
|
|
||||||
tempDev.DisconnectBT();
|
|
||||||
}
|
|
||||||
else if (tempDev.ConnectionType == ConnectionType.SONYWA)
|
|
||||||
{
|
|
||||||
tempDev.DisconnectDongle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ExportLogBtn_Click(object sender, RoutedEventArgs e)
|
private void ExportLogBtn_Click(object sender, RoutedEventArgs e)
|
||||||
|
@ -405,5 +405,21 @@ namespace DS4WinWPF.DS4Forms.ViewModels
|
|||||||
SelectedIndex = profileListHolder.ProfileListCol.IndexOf(temp);
|
SelectedIndex = profileListHolder.ProfileListCol.IndexOf(temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RequestDisconnect()
|
||||||
|
{
|
||||||
|
if (device.Synced && !device.Charging)
|
||||||
|
{
|
||||||
|
if (device.ConnectionType == ConnectionType.BT)
|
||||||
|
{
|
||||||
|
//device.StopUpdate();
|
||||||
|
device.DisconnectBT();
|
||||||
|
}
|
||||||
|
else if (device.ConnectionType == ConnectionType.SONYWA)
|
||||||
|
{
|
||||||
|
device.DisconnectDongle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user