From d3d333319bef6c085cb73fe12e50bd75c7073453 Mon Sep 17 00:00:00 2001 From: Ani <115020168+drawbyperpetual@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:16:38 +0200 Subject: [PATCH] [MWB][CQ]Remove use of deprecated BinaryFormatter (#32925) --- .../App/Form/frmScreen.Designer.cs | 8 ---- .../MouseWithoutBorders/App/Form/frmScreen.cs | 4 +- .../App/Form/frmScreen.resx | 42 ------------------ .../App/Icon/notify_default.bmp | Bin 0 -> 680 bytes .../App/MouseWithoutBorders.csproj | 11 +++++ .../App/Properties/Images.Designer.cs | 14 +++++- .../App/Properties/Images.resx | 7 ++- 7 files changed, 30 insertions(+), 56 deletions(-) create mode 100644 src/modules/MouseWithoutBorders/App/Icon/notify_default.bmp diff --git a/src/modules/MouseWithoutBorders/App/Form/frmScreen.Designer.cs b/src/modules/MouseWithoutBorders/App/Form/frmScreen.Designer.cs index 7588122f0b..8b8b2376c6 100644 --- a/src/modules/MouseWithoutBorders/App/Form/frmScreen.Designer.cs +++ b/src/modules/MouseWithoutBorders/App/Form/frmScreen.Designer.cs @@ -54,7 +54,6 @@ this.dUCTDOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tRUONG2DToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.NotifyIcon = new System.Windows.Forms.NotifyIcon(this.components); - this.imgListIcon = new System.Windows.Forms.ImageList(this.components); this.picLogonLogo = new System.Windows.Forms.PictureBox(); this.MainMenu.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.picLogonLogo)).BeginInit(); @@ -228,12 +227,6 @@ this.NotifyIcon.Text = "Microsoft® Visual Studio® 2010"; this.NotifyIcon.MouseDown += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon_MouseDown); // - // imgListIcon - // - this.imgListIcon.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgListIcon.ImageStream"))); - this.imgListIcon.TransparentColor = System.Drawing.Color.Transparent; - this.imgListIcon.Images.SetKeyName(0, "Logo.ico"); - // // picLogonLogo // this.picLogonLogo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; @@ -286,7 +279,6 @@ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem dUCTDOToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem tRUONG2DToolStripMenuItem; - private System.Windows.Forms.ImageList imgListIcon; private System.Windows.Forms.ToolStripMenuItem menuSendScreenCapture; private System.Windows.Forms.ToolStripMenuItem menuSend2Myself; private System.Windows.Forms.ToolStripMenuItem menuGetScreenCapture; diff --git a/src/modules/MouseWithoutBorders/App/Form/frmScreen.cs b/src/modules/MouseWithoutBorders/App/Form/frmScreen.cs index 8decdebe35..d0d541126b 100644 --- a/src/modules/MouseWithoutBorders/App/Form/frmScreen.cs +++ b/src/modules/MouseWithoutBorders/App/Form/frmScreen.cs @@ -21,7 +21,7 @@ using Microsoft.PowerToys.Telemetry; // 2023- Included in PowerToys. // using MouseWithoutBorders.Class; -using MouseWithoutBorders.Form; +using MouseWithoutBorders.Properties; using Timer = System.Windows.Forms.Timer; [module: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "MouseWithoutBorders.frmScreen.#ShowMouseWithoutBordersUiOnWinLogonDesktop(System.Boolean)", Justification = "Dotnet port with style preservation")] @@ -617,7 +617,7 @@ namespace MouseWithoutBorders { Graphics g; Pen p; - Bitmap bm = new(imgListIcon.Images[0]); + Bitmap bm = Images.notify_default; /* if (curIcon == Common.ICON_ONE) diff --git a/src/modules/MouseWithoutBorders/App/Form/frmScreen.resx b/src/modules/MouseWithoutBorders/App/Form/frmScreen.resx index 076454b8c3..fa54f646ac 100644 --- a/src/modules/MouseWithoutBorders/App/Form/frmScreen.resx +++ b/src/modules/MouseWithoutBorders/App/Form/frmScreen.resx @@ -196,48 +196,6 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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2ARMBjQH2ATYBmQH0GAABKAGSAfUBFgGPAfYBFgGPAfYBJwGTAfYBEgGN - Afb/AEgAAR0BkQH2AR4BkAH2ARgBkAH2ARQBjgH2ATEBmAH1HgABJQGSAfYBFgGPAfYBFgGPAfYBKgGU - AfUBEgGNAfb/AEIAAR0BkQH2ARQBiwH3ARkBkAH2ARMBjgH2ATEBlwH1BgAGBAwABgQGAAElAZIB9gEW - AY8B9gEWAY8B9gEfAY8B9wESAY0B9v8APwABEgGNAfYBHwGQAfYBDgGMAfYBMwGYAfQGAAwEBgAMBAYA - ASYBkgH1AQ8BjAH2AScBlAH1ARIBjQH2/wBCAAESAY0B9gE0AZgB9QkAAwQB/wH4AfAGBAYAAwQB/wH4 - AfAGBAkAATABlgH1ARIBjQH2/wBUAAwEBgAMBP8AZgAGBAwABgT/AP8A/wD/AP8A/wD/AP8A/wD/AE4A - AUIBTQE+BwABPgMAASgDAAGAAwABIAMAAQEBAAEBBgABAhYAA/8BAAT/DAAE/wwABP8MAAT/DAAE/wwA - BP8MAAH+Av8BfwwAAfwBfwH+AT8MAAH4AT8B/AEfDAAB/AEfAfgBPwwAAf4BDwHwAX8MAAH/AQcB4AH/ - DAAB/wGDAcEB/wwAAf8BwQGDAf8tAAEBAYANAAH/AYMBwQH/DAAB/wEHAeAB/wwAAf4BDwHwAX8MAAH8 - AR8B+AE/DAAB+AEzAcwBHwwAAfgBYQGGAR8MAAH8AeEBhwE/DAAB/wHhAYcB/wwAAf8B8wHPAf8MAAT/ - DAAE/wwABP8MAAT/DAAE/wwABP8MAAs= diff --git a/src/modules/MouseWithoutBorders/App/Icon/notify_default.bmp b/src/modules/MouseWithoutBorders/App/Icon/notify_default.bmp new file mode 100644 index 0000000000000000000000000000000000000000..f0ce85ee2a8e245438b3feab470dd703b9fe72bb GIT binary patch literal 680 zcmV;Z0$2TsP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0zFAYK~z{r?NwV( z6G0elLSICMAQcrsiN-q#8VNBF2)>y3BH@X|ALE;;*ut``A_~JKxSZXU@#DxeOUHxFVm=6PJB#AZfg>h(tQYlE!<2-nd3;ceag; z$&cz3Yani%p=!^Gx$I*)@C3bemvniEg58&GLak+o6USBMAvlIfRUf&T(EcQar2MkC^nAp56 zNoyg@x#9#=;X&+I{Eo7zJ9IH@$WT|PKkjE(qIz@^9=!AofdKK`4iap zXLS5$4f9vJ`D~qjdm|=KzrV+qVcE09y3rIjBAmnsuIK^LUA6|k zu2NVWpm2RKxk^`sG!o}SS;jttfXk3YeQSW{#B$lHf6R%2w9wu?5rKGE#wuDS8xx-g zrO$B_U0uzUb%;}5aXQ3_^OJ5FcN#C6ivgc*UK=5IC;96T&faagJWZBlLqKLx%qux!gaAUUwFsI=iv} O0000 UserControl + + True + True + Images.resx + @@ -243,6 +248,12 @@ + + + ResXFileCodeGenerator + Images.Designer.cs + + True diff --git a/src/modules/MouseWithoutBorders/App/Properties/Images.Designer.cs b/src/modules/MouseWithoutBorders/App/Properties/Images.Designer.cs index 1625d54a5c..07eabb49a5 100644 --- a/src/modules/MouseWithoutBorders/App/Properties/Images.Designer.cs +++ b/src/modules/MouseWithoutBorders/App/Properties/Images.Designer.cs @@ -1,4 +1,4 @@ - +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -6,7 +6,7 @@ // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // - +//------------------------------------------------------------------------------ namespace MouseWithoutBorders.Properties { using System; @@ -600,6 +600,16 @@ namespace MouseWithoutBorders.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap notify_default { + get { + object obj = ResourceManager.GetObject("notify_default", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/src/modules/MouseWithoutBorders/App/Properties/Images.resx b/src/modules/MouseWithoutBorders/App/Properties/Images.resx index 91dad667f0..07184ecae0 100644 --- a/src/modules/MouseWithoutBorders/App/Properties/Images.resx +++ b/src/modules/MouseWithoutBorders/App/Properties/Images.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -355,4 +355,7 @@ ..\Icon\two_row_button_unchecked.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Icon\notify_default.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file