Skip to content

Commit

Permalink
MessageSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
netquick committed Jul 14, 2024
1 parent 4636245 commit 748df13
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions DeFRaG_Helper/MessageHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DeFRaG_Helper
{
internal class MessageHelper
{
//method to show message in MainWindow showmessage method
public static void ShowMessage(string message)
{
App.Current.Dispatcher.Invoke(() => { MainWindow.Instance.ShowMessage(message); });
SimpleLogger.Log(message);
}
public static void ShowMessageAsync(string message)
{
App.Current.Dispatcher.Invoke(() => { MainWindow.Instance.ShowMessage(message); });
SimpleLogger.Log(message);
}

public static void LogMessage(string message)
{
SimpleLogger.Log(message);
}

public static async Task LogMessageAsync(string message)
{
await SimpleLogger.LogAsync(message);
}

public static void LogException(Exception ex)
{
SimpleLogger.Log($"Exception: {ex.Message}, {ex.StackTrace}");
}

public static async Task LogExceptionAsync(Exception ex)
{
await SimpleLogger.LogAsync($"Exception: {ex.Message}, {ex.StackTrace}");
}

public static void VerboseLog(string message)
{
SimpleLogger.Log($"Verbose: {message}");
}
public static async Task VerboseLogAsync(string message)
{
await SimpleLogger.LogAsync($"Verbose: {message}");
}
}
}
File renamed without changes.

0 comments on commit 748df13

Please sign in to comment.