[MWB] - refactoring "Common" classes - Common.Log.cs, Common.Receiver.cs (#35726)

This commit is contained in:
Michael Clayton
2025-01-17 15:41:39 +00:00
committed by GitHub
parent 44f170d4ed
commit 1aaf764c14
19 changed files with 698 additions and 661 deletions

View File

@@ -32,12 +32,17 @@ using MouseWithoutBorders.Core;
using MouseWithoutBorders.Exceptions;
using SystemClipboard = System.Windows.Forms.Clipboard;
using Thread = MouseWithoutBorders.Core.Thread;
namespace MouseWithoutBorders
{
internal partial class Common
{
private const uint BIG_CLIPBOARD_DATA_TIMEOUT = 30000;
internal static readonly char[] Comma = new char[] { ',' };
internal static readonly char[] Star = new char[] { '*' };
internal static readonly char[] NullSeparator = new char[] { '\0' };
internal const uint BIG_CLIPBOARD_DATA_TIMEOUT = 30000;
private const uint MAX_CLIPBOARD_DATA_SIZE_CAN_BE_SENT_INSTANTLY_TCP = 1024 * 1024; // 1MB
private const uint MAX_CLIPBOARD_FILE_SIZE_CAN_BE_SENT = 100 * 1024 * 1024; // 100MB
private const int TEXT_HEADER_SIZE = 12;
@@ -46,11 +51,9 @@ namespace MouseWithoutBorders
private static long lastClipboardEventTime;
private static string lastMachineWithClipboardData;
private static string lastDragDropFile;
private static long clipboardCopiedTime;
internal static readonly char[] Comma = new char[] { ',' };
internal static readonly char[] Star = new char[] { '*' };
internal static readonly char[] NullSeparator = new char[] { '\0' };
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
internal static long clipboardCopiedTime;
#pragma warning restore SA1307
internal static ID LastIDWithClipboardData { get; set; }
@@ -332,7 +335,7 @@ namespace MouseWithoutBorders
break;
default:
ProcessPackage(data, tcp);
Receiver.ProcessPackage(data, tcp);
if (++unexpectedCount > 100)
{
Logger.Log("ReceiveClipboardDataUsingTCP: unexpectedCount > 100!");

View File

@@ -22,6 +22,8 @@ using Microsoft.PowerToys.Telemetry;
using MouseWithoutBorders.Class;
using MouseWithoutBorders.Core;
using Thread = MouseWithoutBorders.Core.Thread;
namespace MouseWithoutBorders
{
/* Common.DragDrop.cs
@@ -238,7 +240,7 @@ namespace MouseWithoutBorders
internal static void DragDropStep08(DATA package)
{
GetNameOfMachineWithClipboardData(package);
Receiver.GetNameOfMachineWithClipboardData(package);
Logger.LogDebug("DragDropStep08: ClipboardDragDrop Received. machine with drag file was set");
}

View File

@@ -21,6 +21,8 @@ using MouseWithoutBorders.Class;
using MouseWithoutBorders.Core;
using MouseWithoutBorders.Form;
using Thread = MouseWithoutBorders.Core.Thread;
namespace MouseWithoutBorders
{
internal partial class Common
@@ -145,7 +147,7 @@ namespace MouseWithoutBorders
}
}
private static bool IsSwitchingByMouseEnabled()
internal static bool IsSwitchingByMouseEnabled()
{
return (EasyMouseOption)Setting.Values.EasyMouse == EasyMouseOption.Enable || InputHook.EasyMouseKeyDown;
}

View File

@@ -23,6 +23,8 @@ using MouseWithoutBorders.Core;
using MouseWithoutBorders.Form;
using Windows.UI.Input.Preview.Injection;
using Thread = MouseWithoutBorders.Core.Thread;
namespace MouseWithoutBorders
{
internal partial class Common

View File

@@ -1,119 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms;
// <summary>
// Logging.
// </summary>
// <history>
// 2008 created by Truong Do (ductdo).
// 2009-... modified by Truong Do (TruongDo).
// 2023- Included in PowerToys.
// </history>
using MouseWithoutBorders.Class;
using MouseWithoutBorders.Core;
using MouseWithoutBorders.Exceptions;
namespace MouseWithoutBorders
{
public class Thread
{
private static readonly Lock ThreadsLock = new();
private static List<System.Threading.Thread> threads;
private readonly System.Threading.Thread thread;
internal Thread(ThreadStart callback, string name)
{
UpdateThreads(thread = new System.Threading.Thread(callback) { Name = name });
}
internal Thread(ParameterizedThreadStart callback, string name)
{
UpdateThreads(thread = new System.Threading.Thread(callback) { Name = name });
}
internal static void UpdateThreads(System.Threading.Thread thread)
{
lock (ThreadsLock)
{
bool found = false;
List<System.Threading.Thread> toBeRemovedThreads = new();
threads ??= new List<System.Threading.Thread>();
foreach (System.Threading.Thread t in threads)
{
if (!t.IsAlive)
{
toBeRemovedThreads.Add(t);
}
else if (t.ManagedThreadId == thread.ManagedThreadId)
{
found = true;
}
}
foreach (System.Threading.Thread t in toBeRemovedThreads)
{
_ = threads.Remove(t);
}
if (!found)
{
threads.Add(thread);
}
}
}
internal static string DumpThreadsStack()
{
string stack = "\r\nMANAGED THREADS: " + threads.Count.ToString(CultureInfo.InvariantCulture) + "\r\n";
stack += Logger.GetStackTrace(new StackTrace());
return stack;
}
internal void SetApartmentState(ApartmentState apartmentState)
{
thread.SetApartmentState(apartmentState);
}
internal void Start()
{
thread.Start();
}
internal void Start(object parameter)
{
thread.Start(parameter);
}
internal static void Sleep(int millisecondsTimeout)
{
System.Threading.Thread.Sleep(millisecondsTimeout);
}
internal static System.Threading.Thread CurrentThread => System.Threading.Thread.CurrentThread;
internal ThreadPriority Priority
{
get => thread.Priority;
set => thread.Priority = value;
}
internal System.Threading.ThreadState ThreadState => thread.ThreadState;
}
}

View File

@@ -51,10 +51,14 @@ namespace MouseWithoutBorders
private const int SKIP_PIXELS = 1;
private const int JUMP_PIXELS = 2;
private static ID desMachineID;
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
internal static ID desMachineID;
#pragma warning restore SA1307
internal static string DesMachineName = string.Empty;
private static ID newDesMachineID;
private static ID newDesMachineIdEx;
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
internal static ID newDesMachineIdEx;
#pragma warning restore SA1307
private static ID dropMachineID;
private static long lastJump = Common.GetTick();
@@ -720,7 +724,7 @@ namespace MouseWithoutBorders
}
}
private static string AddToMachinePool(DATA package)
internal static string AddToMachinePool(DATA package)
{
// Log("********** AddToMachinePool called: " + package.src.ToString(CultureInfo.InvariantCulture));

View File

@@ -1,431 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
// <summary>
// Back-end thread for the socket.
// </summary>
// <history>
// 2008 created by Truong Do (ductdo).
// 2009-... modified by Truong Do (TruongDo).
// 2023- Included in PowerToys.
// </history>
using MouseWithoutBorders.Class;
using MouseWithoutBorders.Core;
[module: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "MouseWithoutBorders.Common.#PreProcess(MouseWithoutBorders.DATA)", Justification = "Dotnet port with style preservation")]
namespace MouseWithoutBorders
{
internal partial class Common
{
private static readonly uint QUEUE_SIZE = 50;
private static readonly int[] RecentProcessedPackageIDs = new int[QUEUE_SIZE];
private static int recentProcessedPackageIndex;
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
internal static long processedPackageCount;
internal static long skippedPackageCount;
#pragma warning restore SA1307
internal static long JustGotAKey { get; set; }
private static bool PreProcess(DATA package)
{
if (package.Type == PackageType.Invalid)
{
if ((Common.InvalidPackageCount % 100) == 0)
{
ShowToolTip("Invalid packages received!", 1000, ToolTipIcon.Warning, false);
}
Common.InvalidPackageCount++;
Logger.Log("Invalid packages received!");
return false;
}
else if (package.Type == 0)
{
Logger.Log("Got an unknown package!");
return false;
}
else if (package.Type is not PackageType.ClipboardText and not PackageType.ClipboardImage
// BEGIN: These package types are sent by TcpSend which is single direction.
and not PackageType.Handshake and not PackageType.HandshakeAck)
{
// END
lock (RecentProcessedPackageIDs)
{
for (int i = 0; i < QUEUE_SIZE; i++)
{
if (RecentProcessedPackageIDs[i] == package.Id)
{
skippedPackageCount++;
return false;
}
}
processedPackageCount++;
recentProcessedPackageIndex = (int)((recentProcessedPackageIndex + 1) % QUEUE_SIZE);
RecentProcessedPackageIDs[recentProcessedPackageIndex] = package.Id;
}
}
return true;
}
private static System.Drawing.Point lastXY;
internal static void ProcessPackage(DATA package, TcpSk tcp)
{
if (!PreProcess(package))
{
return;
}
switch (package.Type)
{
case PackageType.Keyboard:
PackageReceived.Keyboard++;
if (package.Des == MachineID || package.Des == ID.ALL)
{
JustGotAKey = GetTick();
// NOTE(@yuyoyuppe): disabled to drop elevation requirement
bool nonElevated = Common.RunWithNoAdminRight && false;
if (nonElevated && Setting.Values.OneWayControlMode)
{
if ((package.Kd.dwFlags & (int)Common.LLKHF.UP) == (int)Common.LLKHF.UP)
{
Common.ShowOneWayModeMessage();
}
return;
}
InputSimulation.SendKey(package.Kd);
}
break;
case PackageType.Mouse:
PackageReceived.Mouse++;
if (package.Des == MachineID || package.Des == ID.ALL)
{
if (desMachineID != MachineID)
{
NewDesMachineID = DesMachineID = MachineID;
}
// NOTE(@yuyoyuppe): disabled to drop elevation requirement
bool nonElevated = Common.RunWithNoAdminRight && false;
if (nonElevated && Setting.Values.OneWayControlMode && package.Md.dwFlags != Common.WM_MOUSEMOVE)
{
if (!IsDropping)
{
if (package.Md.dwFlags is WM_LBUTTONDOWN or WM_RBUTTONDOWN)
{
Common.ShowOneWayModeMessage();
}
}
else if (package.Md.dwFlags is WM_LBUTTONUP or WM_RBUTTONUP)
{
IsDropping = false;
}
return;
}
if (Math.Abs(package.Md.X) >= MOVE_MOUSE_RELATIVE && Math.Abs(package.Md.Y) >= MOVE_MOUSE_RELATIVE)
{
if (package.Md.dwFlags == Common.WM_MOUSEMOVE)
{
InputSimulation.MoveMouseRelative(
package.Md.X < 0 ? package.Md.X + MOVE_MOUSE_RELATIVE : package.Md.X - MOVE_MOUSE_RELATIVE,
package.Md.Y < 0 ? package.Md.Y + MOVE_MOUSE_RELATIVE : package.Md.Y - MOVE_MOUSE_RELATIVE);
_ = NativeMethods.GetCursorPos(ref lastXY);
Point p = MoveToMyNeighbourIfNeeded(lastXY.X, lastXY.Y, MachineID);
if (!p.IsEmpty)
{
HasSwitchedMachineSinceLastCopy = true;
Logger.LogDebug(string.Format(
CultureInfo.CurrentCulture,
"***** Controlled Machine: newDesMachineIdEx set = [{0}]. Mouse is now at ({1},{2})",
newDesMachineIdEx,
lastXY.X,
lastXY.Y));
SendNextMachine(package.Src, newDesMachineIdEx, p);
}
}
else
{
_ = NativeMethods.GetCursorPos(ref lastXY);
package.Md.X = lastXY.X * 65535 / screenWidth;
package.Md.Y = lastXY.Y * 65535 / screenHeight;
_ = InputSimulation.SendMouse(package.Md);
}
}
else
{
_ = InputSimulation.SendMouse(package.Md);
_ = NativeMethods.GetCursorPos(ref lastXY);
}
LastX = lastXY.X;
LastY = lastXY.Y;
CustomCursor.ShowFakeMouseCursor(LastX, LastY);
}
DragDropStep01(package.Md.dwFlags);
DragDropStep09(package.Md.dwFlags);
break;
case PackageType.NextMachine:
Logger.LogDebug("PackageType.NextMachine received!");
if (IsSwitchingByMouseEnabled())
{
PrepareToSwitchToMachine((ID)package.Md.WheelDelta, new Point(package.Md.X, package.Md.Y));
}
break;
case PackageType.ExplorerDragDrop:
PackageReceived.ExplorerDragDrop++;
DragDropStep03(package);
break;
case PackageType.Heartbeat:
case PackageType.Heartbeat_ex:
PackageReceived.Heartbeat++;
Common.GeneratedKey = Common.GeneratedKey || package.Type == PackageType.Heartbeat_ex;
if (Common.GeneratedKey)
{
Setting.Values.MyKey = Common.MyKey;
SendPackage(ID.ALL, PackageType.Heartbeat_ex_l2);
}
string desMachine = Common.AddToMachinePool(package);
if (Setting.Values.FirstRun && !string.IsNullOrEmpty(desMachine))
{
Common.UpdateSetupMachineMatrix(desMachine);
Common.UpdateClientSockets("UpdateSetupMachineMatrix");
}
break;
case PackageType.Heartbeat_ex_l2:
Common.GeneratedKey = true;
Setting.Values.MyKey = Common.MyKey;
SendPackage(ID.ALL, PackageType.Heartbeat_ex_l3);
break;
case PackageType.Heartbeat_ex_l3:
Common.GeneratedKey = true;
Setting.Values.MyKey = Common.MyKey;
break;
case PackageType.Awake:
PackageReceived.Heartbeat++;
_ = Common.AddToMachinePool(package);
Common.HumanBeingDetected();
break;
case PackageType.Hello:
PackageReceived.Hello++;
SendHeartBeat();
string newMachine = Common.AddToMachinePool(package);
if (Setting.Values.MachineMatrixString == null)
{
string tip = newMachine + " saying Hello!";
tip += "\r\n Right Click to setup your machine Matrix";
ShowToolTip(tip);
}
break;
case PackageType.Hi:
PackageReceived.Hello++;
break;
case PackageType.ByeBye:
PackageReceived.ByeBye++;
ProcessByeByeMessage(package);
break;
case PackageType.Clipboard:
PackageReceived.Clipboard++;
if (!RunOnLogonDesktop && !RunOnScrSaverDesktop)
{
clipboardCopiedTime = GetTick();
GetNameOfMachineWithClipboardData(package);
SignalBigClipboardData();
}
break;
case PackageType.MachineSwitched:
if (GetTick() - clipboardCopiedTime < BIG_CLIPBOARD_DATA_TIMEOUT && (package.Des == MachineID))
{
clipboardCopiedTime = 0;
Common.GetRemoteClipboard("PackageType.MachineSwitched");
}
break;
case PackageType.ClipboardCapture:
PackageReceived.Clipboard++;
if (!RunOnLogonDesktop && !RunOnScrSaverDesktop)
{
if (package.Des == MachineID || package.Des == ID.ALL)
{
GetNameOfMachineWithClipboardData(package);
GetRemoteClipboard("mspaint," + LastMachineWithClipboardData);
}
}
break;
case PackageType.CaptureScreenCommand:
PackageReceived.Clipboard++;
if (package.Des == MachineID || package.Des == ID.ALL)
{
Common.SendImage(package.Src, Common.CaptureScreen());
}
break;
case PackageType.ClipboardAsk:
PackageReceived.ClipboardAsk++;
if (package.Des == MachineID)
{
_ = Task.Run(() =>
{
try
{
System.Threading.Thread thread = Thread.CurrentThread;
thread.Name = $"{nameof(PackageType.ClipboardAsk)}.{thread.ManagedThreadId}";
Thread.UpdateThreads(thread);
string remoteMachine = package.MachineName;
System.Net.Sockets.TcpClient client = ConnectToRemoteClipboardSocket(remoteMachine);
bool clientPushData = true;
if (ShakeHand(ref remoteMachine, client.Client, out Stream enStream, out Stream deStream, ref clientPushData, ref package.PostAction))
{
SocketStuff.SendClipboardData(client.Client, enStream);
}
}
catch (Exception e)
{
Logger.Log(e);
}
});
}
break;
case PackageType.ClipboardDragDrop:
PackageReceived.ClipboardDragDrop++;
DragDropStep08(package);
break;
case PackageType.ClipboardDragDropOperation:
PackageReceived.ClipboardDragDrop++;
DragDropStep08_2(package);
break;
case PackageType.ClipboardDragDropEnd:
PackageReceived.ClipboardDragDropEnd++;
DragDropStep12();
break;
case PackageType.ClipboardText:
case PackageType.ClipboardImage:
clipboardCopiedTime = 0;
if (package.Type == PackageType.ClipboardImage)
{
PackageReceived.ClipboardImage++;
}
else
{
PackageReceived.ClipboardText++;
}
if (tcp != null)
{
Common.ReceiveClipboardDataUsingTCP(
package,
package.Type == PackageType.ClipboardImage,
tcp);
}
break;
case PackageType.HideMouse:
HasSwitchedMachineSinceLastCopy = true;
HideMouseCursor(true);
MainFormDotEx(false);
ReleaseAllKeys();
break;
default:
if ((package.Type & PackageType.Matrix) == PackageType.Matrix)
{
PackageReceived.Matrix++;
UpdateMachineMatrix(package);
break;
}
else
{
// We should never get to this point!
Logger.Log("Invalid package received!");
return;
}
}
}
private static void GetNameOfMachineWithClipboardData(DATA package)
{
LastIDWithClipboardData = package.Src;
List<MachineInf> matchingMachines = Common.MachinePool.TryFindMachineByID(LastIDWithClipboardData);
if (matchingMachines.Count >= 1)
{
LastMachineWithClipboardData = matchingMachines[0].Name.Trim();
}
/*
lastMachineWithClipboardData =
Common.GetString(BitConverter.GetBytes(package.machineNameHead));
lastMachineWithClipboardData +=
Common.GetString(BitConverter.GetBytes(package.machineNameTail));
lastMachineWithClipboardData = lastMachineWithClipboardData.Trim();
* */
}
private static void SignalBigClipboardData()
{
Logger.LogDebug("SignalBigClipboardData");
SetToggleIcon(new int[TOGGLE_ICONS_SIZE] { ICON_BIG_CLIPBOARD, -1, ICON_BIG_CLIPBOARD, -1 });
}
}
}

View File

@@ -23,6 +23,8 @@ using System.Windows.Forms;
using MouseWithoutBorders.Class;
using MouseWithoutBorders.Core;
using Thread = MouseWithoutBorders.Core.Thread;
namespace MouseWithoutBorders
{
// Desktops, and GetScreenConfig routines

View File

@@ -32,6 +32,8 @@ using MouseWithoutBorders.Class;
using MouseWithoutBorders.Core;
using MouseWithoutBorders.Exceptions;
using Thread = MouseWithoutBorders.Core.Thread;
// Log is enough
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.Common.#CheckClipboard()", Justification = "Dotnet port with style preservation")]
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.Common.#CheckForDesktopSwitchEvent(System.Boolean)", Justification = "Dotnet port with style preservation")]
@@ -88,8 +90,10 @@ namespace MouseWithoutBorders
private static FrmInputCallback inputCallbackForm;
private static FrmAbout aboutForm;
private static Thread helper;
private static int screenWidth;
private static int screenHeight;
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
internal static int screenWidth;
internal static int screenHeight;
#pragma warning restore SA1307
private static int lastX;
private static int lastY;
@@ -552,7 +556,7 @@ namespace MouseWithoutBorders
lastRealInputEventCount = Common.RealInputEventCount;
}
private static void HumanBeingDetected()
internal static void HumanBeingDetected()
{
if (lastInputEventCount == Common.InputEventCount)
{
@@ -613,7 +617,7 @@ namespace MouseWithoutBorders
SendPackage(ID.ALL, PackageType.Clipboard);
}
private static void ProcessByeByeMessage(DATA package)
internal static void ProcessByeByeMessage(DATA package)
{
if (package.Src == desMachineID)
{

View File

@@ -27,6 +27,9 @@ using MouseWithoutBorders.Core;
#endif
using SystemClipboard = System.Windows.Forms.Clipboard;
#if !MM_HELPER
using Thread = MouseWithoutBorders.Core.Thread;
#endif
namespace MouseWithoutBorders
{

View File

@@ -35,6 +35,7 @@ using Newtonsoft.Json;
using StreamJsonRpc;
using Logger = MouseWithoutBorders.Core.Logger;
using Thread = MouseWithoutBorders.Core.Thread;
[module: SuppressMessage("Microsoft.MSInternal", "CA904:DeclareTypesInMicrosoftOrSystemNamespace", Scope = "namespace", Target = "MouseWithoutBorders", Justification = "Dotnet port with style preservation")]
[module: SuppressMessage("Microsoft.Design", "CA1014:MarkAssembliesWithClsCompliant", Justification = "Dotnet port with style preservation")]

View File

@@ -13,7 +13,6 @@ using System.IO.Abstractions;
using System.Linq;
using System.Security.Cryptography;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -33,6 +32,8 @@ using Microsoft.Win32;
using MouseWithoutBorders.Core;
using Settings.UI.Library.Attributes;
using Lock = System.Threading.Lock;
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.Properties.Setting.Values.#LoadIntSetting(System.String,System.Int32)", Justification = "Dotnet port with style preservation")]
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.Properties.Setting.Values.#SaveSetting(System.String,System.Object)", Justification = "Dotnet port with style preservation")]
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.Properties.Setting.Values.#LoadStringSetting(System.String,System.String)", Justification = "Dotnet port with style preservation")]

View File

@@ -29,6 +29,8 @@ using MouseWithoutBorders.Core;
// </history>
using MouseWithoutBorders.Exceptions;
using Thread = MouseWithoutBorders.Core.Thread;
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.SocketStuff.#SendData(System.Byte[])", Justification = "Dotnet port with style preservation")]
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.SocketStuff.#Close()", Justification = "Dotnet port with style preservation")]
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.SocketStuff.#CreateSocket(System.Boolean)", Justification = "Dotnet port with style preservation")]
@@ -1524,7 +1526,7 @@ namespace MouseWithoutBorders.Class
}
else
{
Common.ProcessPackage(package, currentTcp);
Receiver.ProcessPackage(package, currentTcp);
}
}
}

View File

@@ -23,6 +23,8 @@ using MouseWithoutBorders.Core;
// </history>
using MouseWithoutBorders.Exceptions;
using Thread = MouseWithoutBorders.Core.Thread;
[module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.TcpServer.#Close()", Justification = "Dotnet port with style preservation")]
namespace MouseWithoutBorders.Class