[Chore] Run solution code cleanup (#20584)

This commit is contained in:
Andrey Nekrasov
2022-09-16 11:54:58 +03:00
committed by GitHub
parent 09f4dead7f
commit ca3c758046
133 changed files with 108 additions and 359 deletions

View File

@@ -159,7 +159,7 @@ public class PowerAccent : IDisposable
public Point GetDisplayCoordinates(Size window)
{
var activeDisplay = WindowsFunctions.GetActiveDisplay();
(Point Location, Size Size, double Dpi) activeDisplay = WindowsFunctions.GetActiveDisplay();
Rect screen = new Rect(activeDisplay.Location, activeDisplay.Size) / activeDisplay.Dpi;
Position position = _settingService.Position;

View File

@@ -10,8 +10,8 @@ namespace PowerAccent.Core.Tools
{
public static Point GetRawCoordinatesFromCaret(Point caret, Rect screen, Size window)
{
var left = caret.X - (window.Width / 2);
var top = caret.Y - window.Height - 20;
double left = caret.X - (window.Width / 2);
double top = caret.Y - window.Height - 20;
return new Point(
left < screen.X ? screen.X : (left + window.Width > (screen.X + screen.Width) ? (screen.X + screen.Width) - window.Width : left),

View File

@@ -2,7 +2,6 @@
// 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.Diagnostics;
using System.Globalization;
using System.IO;
@@ -24,7 +23,7 @@ namespace PowerAccent.Core.Tools
}
// Using InvariantCulture since this is used for a log file name
var logFilePath = _fileSystem.Path.Combine(ApplicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".txt");
string logFilePath = _fileSystem.Path.Combine(ApplicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".txt");
Trace.Listeners.Add(new TextWriterTraceListener(logFilePath));
@@ -71,8 +70,8 @@ namespace PowerAccent.Core.Tools
{
StackTrace stackTrace = new StackTrace();
var methodName = stackTrace.GetFrame(3)?.GetMethod();
var className = methodName?.DeclaringType?.Name;
System.Reflection.MethodBase methodName = stackTrace.GetFrame(3)?.GetMethod();
string className = methodName?.DeclaringType?.Name;
return "[Method]: " + methodName?.Name + " [Class]: " + className;
}
}