mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Ready for Review - [Mouse Without Borders] - refactoring "Common" classes (Part 3) - #35155 (#36950)
* [MWB] - refactoring MachineInf from Common.MachineStuff.cs into MachineInf.cs - #35155 * [MWB] - fixing references to MachineInf - #35155 * [MWB] - cleaning up MachineInf.cs - #35155 * [MWB] - moving MyRectangle from Common.MachineStuff.cs into MyRectangle.cs - #35155 * [MWB] - cleaning up MyRectangle.cs - #35155 * [MWB] - moving Common.MachineStuff.cs to MachineStuff.cs - #35155 * [MWB] - fixing references to MachineStuff - #35155 * [MWB] - cleaning up MachineStuff.cs - #35155 * [MWB] - cleaning up MachineStuff.cs - #35155 * [MWB] - moving Common.DragDrop.cs to DragDrop.cs - #35155 * [MWB] - fixing references to DragDrop - #35155 * [MWB] - fixing unit test - #35155 * [MWB] - cleaning up DragDrop.cs - #35155 * [MWB] - cleaning up DragDrop.cs - #35155
This commit is contained in:
@@ -188,7 +188,7 @@ namespace MouseWithoutBorders.Class
|
||||
{
|
||||
if (Common.DesMachineID != Common.MachineID)
|
||||
{
|
||||
Common.SwitchToMultipleMode(false, true);
|
||||
MachineStuff.SwitchToMultipleMode(false, true);
|
||||
}
|
||||
|
||||
if (!Common.RunOnLogonDesktop && !Common.RunOnScrSaverDesktop)
|
||||
@@ -253,7 +253,7 @@ namespace MouseWithoutBorders.Class
|
||||
{
|
||||
if (Setting.Values.LastX == Common.JUST_GOT_BACK_FROM_SCREEN_SAVER)
|
||||
{
|
||||
Common.NewDesMachineID = Common.DesMachineID = Common.MachineID;
|
||||
MachineStuff.NewDesMachineID = Common.DesMachineID = Common.MachineID;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -263,11 +263,11 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
if (Common.RunOnLogonDesktop && Setting.Values.DesMachineID == (uint)ID.ALL)
|
||||
{
|
||||
Common.SwitchToMultipleMode(true, false);
|
||||
MachineStuff.SwitchToMultipleMode(true, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Common.SwitchToMultipleMode(false, false);
|
||||
MachineStuff.SwitchToMultipleMode(false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -804,11 +804,11 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
try
|
||||
{
|
||||
if (Common.MachineMatrix != null)
|
||||
if (MachineStuff.MachineMatrix != null)
|
||||
{
|
||||
Logger.LogDebug("MachineMatrix = " + string.Join(", ", Common.MachineMatrix));
|
||||
Logger.LogDebug("MachineMatrix = " + string.Join(", ", MachineStuff.MachineMatrix));
|
||||
|
||||
foreach (string st in Common.MachineMatrix)
|
||||
foreach (string st in MachineStuff.MachineMatrix)
|
||||
{
|
||||
string machineName = st.Trim();
|
||||
if (!string.IsNullOrEmpty(machineName) &&
|
||||
@@ -961,7 +961,7 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
UpdateTcpSockets(dummyTcp, SocketStatus.NA);
|
||||
|
||||
if (!Common.InMachineMatrix(machineName))
|
||||
if (!MachineStuff.InMachineMatrix(machineName))
|
||||
{
|
||||
// While Resolving from name to IP, user may have changed the machine name and clicked on Apply.
|
||||
return;
|
||||
@@ -1449,19 +1449,19 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
Common.SendHeartBeat(initial: true);
|
||||
|
||||
if (Common.MachinePool.TryFindMachineByName(remoteMachine, out MachineInf machineInfo))
|
||||
if (MachineStuff.MachinePool.TryFindMachineByName(remoteMachine, out MachineInf machineInfo))
|
||||
{
|
||||
Logger.LogDebug("Machine updated: " + remoteMachine + "/" + remoteID.ToString());
|
||||
|
||||
if (machineInfo.Name.Equals(Common.DesMachineName, StringComparison.OrdinalIgnoreCase))
|
||||
if (machineInfo.Name.Equals(MachineStuff.DesMachineName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Logger.LogDebug("Des ID updated: " + Common.DesMachineID.ToString() +
|
||||
"/" + remoteID.ToString());
|
||||
Common.NewDesMachineID = Common.DesMachineID = remoteID;
|
||||
MachineStuff.NewDesMachineID = Common.DesMachineID = remoteID;
|
||||
}
|
||||
|
||||
_ = Common.MachinePool.TryUpdateMachineID(remoteMachine, remoteID, true);
|
||||
Common.UpdateMachinePoolStringSetting();
|
||||
_ = MachineStuff.MachinePool.TryUpdateMachineID(remoteMachine, remoteID, true);
|
||||
MachineStuff.UpdateMachinePoolStringSetting();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1475,7 +1475,7 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
if (!isClient)
|
||||
{
|
||||
Common.UpdateClientSockets("MainTCPRoutine");
|
||||
MachineStuff.UpdateClientSockets("MainTCPRoutine");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1559,7 +1559,7 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
if (remoteID != ID.NONE)
|
||||
{
|
||||
_ = Common.RemoveDeadMachines(remoteID);
|
||||
_ = MachineStuff.RemoveDeadMachines(remoteID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1635,9 +1635,9 @@ namespace MouseWithoutBorders.Class
|
||||
{
|
||||
string remoteEndPoint = s.RemoteEndPoint.ToString();
|
||||
Logger.LogDebug("SendClipboardData: Request accepted: " + s.LocalEndPoint.ToString() + "/" + remoteEndPoint);
|
||||
Common.IsDropping = false;
|
||||
Common.IsDragging = false;
|
||||
Common.DragMachine = (ID)1;
|
||||
DragDrop.IsDropping = false;
|
||||
DragDrop.IsDragging = false;
|
||||
DragDrop.DragMachine = (ID)1;
|
||||
|
||||
bool clientPushData = true;
|
||||
ClipboardPostAction postAction = ClipboardPostAction.Other;
|
||||
@@ -2064,7 +2064,7 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
if (string.IsNullOrEmpty(tcp.MachineName) || tcp.MachineName.Contains('.') || tcp.MachineName.Contains(':'))
|
||||
{
|
||||
tcp.MachineName = Common.NameFromID((ID)tcp.MachineId);
|
||||
tcp.MachineName = MachineStuff.NameFromID((ID)tcp.MachineId);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(tcp.MachineName) || tcp.MachineName.Contains('.') || tcp.MachineName.Contains(':'))
|
||||
|
||||
Reference in New Issue
Block a user