aboutsummaryrefslogtreecommitdiffstats
path: root/WarframeClock
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2019-04-02 21:37:02 +0900
committerKazuki Yamaguchi <k@rhe.jp>2019-04-02 21:46:12 +0900
commitb78592b0cf44a3973ef1cc904a0947710d93b9df (patch)
tree834c5d82794de6be0f471496d078d08cdd816018 /WarframeClock
parent9ebf7381bbb0e08e7d09e81e8cc56e1e8df70fcb (diff)
downloadwf-clock-b78592b0cf44a3973ef1cc904a0947710d93b9df.tar.gz
use Trace.WriteLine() instead of Console.WriteLine()
Diffstat (limited to 'WarframeClock')
-rw-r--r--WarframeClock/App.xaml.cs8
-rw-r--r--WarframeClock/OverlayWindow.xaml.cs2
-rw-r--r--WarframeClock/OverlayWindowBase.cs25
-rw-r--r--WarframeClock/WorldState.cs2
4 files changed, 17 insertions, 20 deletions
diff --git a/WarframeClock/App.xaml.cs b/WarframeClock/App.xaml.cs
index 9de5aae..91c86d4 100644
--- a/WarframeClock/App.xaml.cs
+++ b/WarframeClock/App.xaml.cs
@@ -69,13 +69,13 @@ namespace WarframeClock
if (reset < DateTime.UtcNow)
return;
OverlayWindowViewModel.NextBountiesReset = reset;
- Console.WriteLine($"EE.log: Next bounties reset: {reset}");
+ Trace.WriteLine($"EE.log: Next bounties reset: {reset}");
return;
}
if ((match = regexCetusJoin.Match(args.Content)).Success)
{
- Console.WriteLine($"EE.log: Loaded Cetus: {match.Groups[1].Value}");
+ Trace.WriteLine($"EE.log: Loaded Cetus: {match.Groups[1].Value}");
return;
}
};
@@ -93,8 +93,8 @@ namespace WarframeClock
}
catch (Exception ex)
{
- Console.WriteLine($"EE.log: Failed to parse EE.log: {ex}");
- Console.WriteLine(ex.StackTrace);
+ Trace.WriteLine($"EE.log: Failed to parse EE.log: {ex}");
+ Trace.WriteLine(ex.StackTrace);
}
}, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
}
diff --git a/WarframeClock/OverlayWindow.xaml.cs b/WarframeClock/OverlayWindow.xaml.cs
index 98c7750..3ecf918 100644
--- a/WarframeClock/OverlayWindow.xaml.cs
+++ b/WarframeClock/OverlayWindow.xaml.cs
@@ -125,7 +125,7 @@ namespace WarframeClock
{
Font = new System.Drawing.Font(
new System.Drawing.FontFamily(Settings.FontFamilyName),
- (float) (Settings.FontSize * 72.0 / 96.0))
+ (float)(Settings.FontSize * 72.0 / 96.0))
};
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
diff --git a/WarframeClock/OverlayWindowBase.cs b/WarframeClock/OverlayWindowBase.cs
index 87cea8a..27d06fe 100644
--- a/WarframeClock/OverlayWindowBase.cs
+++ b/WarframeClock/OverlayWindowBase.cs
@@ -26,7 +26,7 @@ namespace WarframeClock
{
if (IsVisible)
{
- Logging("Hide overlay; target window disappeared");
+ Trace.WriteLine("OverlayWindowBase: Hide overlay; target window disappeared");
Hide();
}
return false;
@@ -44,16 +44,16 @@ namespace WarframeClock
// So, let's use SetWindowPos directly instead.
if (currentActiveWindow == _targetWindowHandle)
{
- Logging("Overlay is now top-most");
+ Trace.WriteLine("OverlayWindowBase: Overlay is now top-most");
_xTopmost = true;
}
else
{
- Logging($"Overlay is now non-top-most, behind {currentActiveWindow}");
+ Trace.WriteLine($"OverlayWindowBase: Overlay is now non-top-most, behind {currentActiveWindow}");
_xTopmost = false;
}
- uint flags =
+ const uint flags =
0x0001 /* SWP_NOSIZE */ |
0x0002 /* SWP_NOMOVE */ |
0x0008 /* SWP_NOREDRAW */ |
@@ -75,13 +75,14 @@ namespace WarframeClock
// Do not use window.Left (and so on) because they're DPI-aware.
// We don't want that....
- Logging($"Move overlay to: l={_parentBounds.Left};t={_parentBounds.Top};w={width};h={height}");
+ Trace.WriteLine("OverlayWindowBase: Move overlay to: " +
+ $"l={_parentBounds.Left};t={_parentBounds.Top};w={width};h={height}");
Native.SetWindowPos(_windowHandle, IntPtr.Zero, _parentBounds.Left, _parentBounds.Top, width, height,
0x0004 /* SWP_NOZORDER */);
}
if (!IsVisible)
{
- Logging("Show overlay");
+ Trace.WriteLine("OverlayWindowBase: Show overlay");
Show();
}
@@ -102,8 +103,9 @@ namespace WarframeClock
_targetWindowHandle = process.MainWindowHandle;
if (_targetWindowHandle != IntPtr.Zero)
{
- Logging($"Found a process with name={process.ProcessName}; " +
- $"MainWindowHandle={_targetWindowHandle}");
+ string message = $"Found a process with name={process.ProcessName}; " +
+ $"MainWindowHandle={_targetWindowHandle}";
+ Trace.WriteLine($"OverlayWindowBase: {message}");
}
}
catch (Exception)
@@ -125,17 +127,12 @@ namespace WarframeClock
if (!Native.GetWindowRect(_targetWindowHandle, out bounds))
{
- Logging("GetWindowRect failed; aborting this cycle");
+ Trace.WriteLine("OverlayWindowBase: GetWindowRect failed; aborting this cycle");
_targetWindowHandle = IntPtr.Zero;
return false;
}
return true;
}
-
- private static void Logging(string message)
- {
- Console.WriteLine($"OverlayWindowBase: {message}");
- }
}
}
diff --git a/WarframeClock/WorldState.cs b/WarframeClock/WorldState.cs
index 0b87374..a57132f 100644
--- a/WarframeClock/WorldState.cs
+++ b/WarframeClock/WorldState.cs
@@ -48,7 +48,7 @@ namespace WarframeClock
var body = await res.Content.ReadAsStreamAsync();
var serializer = new DataContractJsonSerializer(typeof(WorldState));
- return (WorldState) serializer.ReadObject(body);
+ return (WorldState)serializer.ReadObject(body);
}
}
}