Skip to content

Commit

Permalink
Mark static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
daleghent committed Mar 1, 2024
1 parent 84a470a commit b5dbdd9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 16 additions & 16 deletions GroundStation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override async Task Teardown() {
}

[RelayCommand]
private async Task<bool> PushoverTest(object arg) {
private static async Task<bool> PushoverTest(object arg) {
var send = new SendToPushover.SendToPushover() {
Message = "Test Message",
Title = "Test Title",
Expand All @@ -85,7 +85,7 @@ private async Task<bool> PushoverTest(object arg) {
}

[RelayCommand]
private async Task<bool> EmailTest(object arg) {
private static async Task<bool> EmailTest(object arg) {
var send = new SendToEmail.SendToEmail() {
Subject = "Test Subject",
Body = "Test Body",
Expand All @@ -109,7 +109,7 @@ private async Task<bool> EmailTest(object arg) {
}

[RelayCommand]
private async Task<bool> TelegramTest(object arg) {
private static async Task<bool> TelegramTest(object arg) {
var send = new SendToTelegram.SendToTelegram() {
Message = "Test Message",
Attempts = 1
Expand All @@ -127,7 +127,7 @@ private async Task<bool> TelegramTest(object arg) {
}

[RelayCommand]
private async Task<bool> MQTTTest(object arg) {
private static async Task<bool> MQTTTest(object arg) {
var send = new SendToMqtt.SendToMqtt() {
Topic = "Test Topic",
Payload = "Test Payload",
Expand All @@ -146,7 +146,7 @@ private async Task<bool> MQTTTest(object arg) {
}

[RelayCommand]
private async Task<bool> IFTTTTest(object arg) {
private static async Task<bool> IFTTTTest(object arg) {
var send = new SendToIftttWebhook.SendToIftttWebhook() {
Value1 = "Test Value1",
Value2 = "Test Value2",
Expand Down Expand Up @@ -267,9 +267,9 @@ public string PushoverUserKey {
}
}

public Priority[] PushoverPriorities => Enum.GetValues(typeof(Priority)).Cast<Priority>().ToArray();
public static Priority[] PushoverPriorities => Enum.GetValues(typeof(Priority)).Cast<Priority>().ToArray();

public NotificationSound[] PushoverNotificationSounds => Enum.GetValues(typeof(NotificationSound)).Cast<NotificationSound>().Where(p => p != NotificationSound.NotSet).ToArray();
public static NotificationSound[] PushoverNotificationSounds => Enum.GetValues(typeof(NotificationSound)).Cast<NotificationSound>().Where(p => p != NotificationSound.NotSet).ToArray();

public NotificationSound PushoverDefaultNotificationSound {
get => Enum.Parse<NotificationSound>(Properties.Settings.Default.PushoverDefaultNotificationSound);
Expand Down Expand Up @@ -629,15 +629,15 @@ public string PlaySoundDefaultFailureFile {
}
}

public IList<string> QoSLevels => MqttCommon.QoSLevels;
public static IList<string> QoSLevels => MqttCommon.QoSLevels;

public string TokenDate => DateTime.Now.ToString("d");
public string TokenTime => DateTime.Now.ToString("T");
public string TokenDateTime => DateTime.Now.ToString("G");
public string TokenDateUtc => DateTime.UtcNow.ToString("d");
public string TokenTimeUtc => DateTime.UtcNow.ToString("T");
public string TokenDateTimeUtc => DateTime.UtcNow.ToString("G");
public string TokenUnixEpoch => Utilities.Utilities.UnixEpoch().ToString();
public static string TokenDate => DateTime.Now.ToString("d");
public static string TokenTime => DateTime.Now.ToString("T");
public static string TokenDateTime => DateTime.Now.ToString("G");
public static string TokenDateUtc => DateTime.UtcNow.ToString("d");
public static string TokenTimeUtc => DateTime.UtcNow.ToString("T");
public static string TokenDateTimeUtc => DateTime.UtcNow.ToString("G");
public static string TokenUnixEpoch => Utilities.Utilities.UnixEpoch().ToString();

public void SetSmtpPassword(SecureString s) {
SmtpPassword = SecureStringToString(s);
Expand All @@ -647,7 +647,7 @@ public void SetMqttPassword(SecureString s) {
MqttPassword = SecureStringToString(s);
}

private string SecureStringToString(SecureString value) {
private static string SecureStringToString(SecureString value) {
IntPtr valuePtr = IntPtr.Zero;
try {
valuePtr = Marshal.SecureStringToGlobalAllocUnicode(value);
Expand Down
4 changes: 2 additions & 2 deletions Pushover/SendToPushover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ public NotificationSound NotificationSound {
}
}

public Priority[] Priorities => Enum.GetValues(typeof(Priority)).Cast<Priority>().ToArray();
public NotificationSound[] NotificationSounds => Enum.GetValues(typeof(NotificationSound)).Cast<NotificationSound>().Where(p => p != NotificationSound.NotSet).ToArray();
public static Priority[] Priorities => Enum.GetValues(typeof(Priority)).Cast<Priority>().ToArray();
public static NotificationSound[] NotificationSounds => Enum.GetValues(typeof(NotificationSound)).Cast<NotificationSound>().Where(p => p != NotificationSound.NotSet).ToArray();

public override async Task Execute(IProgress<ApplicationStatus> progress, CancellationToken ct) {
var title = Utilities.Utilities.ResolveTokens(Title, this, metadata);
Expand Down

0 comments on commit b5dbdd9

Please sign in to comment.