From 237983ff8878aede907e40f7e0e37f827e665ed6 Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Fri, 9 Aug 2024 03:02:14 -0400 Subject: [PATCH 1/2] Remove unused project --- BLAZAM/BLAZAM.csproj | 2 +- BLAZAMExtensions/BLAZAMExtensions.csproj | 21 ----- BLAZAMExtensions/CommonExtensionMethods.cs | 22 ----- BLAZAMExtensions/NetworkTools.cs | 63 ------------- BLAZAMExtensions/StringHelpers.cs | 100 --------------------- 5 files changed, 1 insertion(+), 207 deletions(-) delete mode 100644 BLAZAMExtensions/BLAZAMExtensions.csproj delete mode 100644 BLAZAMExtensions/CommonExtensionMethods.cs delete mode 100644 BLAZAMExtensions/NetworkTools.cs delete mode 100644 BLAZAMExtensions/StringHelpers.cs diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index ad70ff6e..086d0782 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.0 - 2024.08.08.2253 + 2024.08.09.0701 false BLAZAM False diff --git a/BLAZAMExtensions/BLAZAMExtensions.csproj b/BLAZAMExtensions/BLAZAMExtensions.csproj deleted file mode 100644 index 0d751fdd..00000000 --- a/BLAZAMExtensions/BLAZAMExtensions.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - BLAZAM.Extensions - - - - - - - - - - - - - - diff --git a/BLAZAMExtensions/CommonExtensionMethods.cs b/BLAZAMExtensions/CommonExtensionMethods.cs deleted file mode 100644 index 7e474900..00000000 --- a/BLAZAMExtensions/CommonExtensionMethods.cs +++ /dev/null @@ -1,22 +0,0 @@ - -using BLAZAM.FileSystem; -using System.Collections; -using System.IO.Compression; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security.Principal; - -namespace BLAZAM.Extensions - -{ - public static class CommonExtensions - { - - - - - - - - } -} diff --git a/BLAZAMExtensions/NetworkTools.cs b/BLAZAMExtensions/NetworkTools.cs deleted file mode 100644 index 45a8f462..00000000 --- a/BLAZAMExtensions/NetworkTools.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Net; -using System.Net.NetworkInformation; -using System.Net.Sockets; - -namespace BLAZAM.Extensions -{ - public class NetworkTools - { - - public static bool PingHost(string hostNameOrAddress) - { - bool pingable = false; - Ping pinger = new Ping(); - try - { - PingReply reply = pinger.Send(hostNameOrAddress, 1000, new byte[32]); - pingable = reply.Status == IPStatus.Success; - } - catch (PingException) - { - // Ignore exception and return false - } - return pingable; - } - - public static bool IsPortOpen(string hostNameOrAddress, int port) - { - return IsAnyPortOpen(hostNameOrAddress, new int[] { port }); - } - public static bool IsAnyPortOpen(string hostNameOrAddress, int[] ports) - { - bool portOpen = false; - IPAddress ip; - IPAddress.TryParse(hostNameOrAddress, out ip); - - foreach (int port in ports) - { - using (TcpClient client = new TcpClient()) - { - try - { - if (ip != null) - client.Connect(ip, port); - else - client.Connect(hostNameOrAddress, port); - portOpen = true; - break; - } - catch (SocketException) - { - // Ignore exception and try the next port or return false - } - finally - { - client.Close(); - } - } - } - - return portOpen; - } - } -} diff --git a/BLAZAMExtensions/StringHelpers.cs b/BLAZAMExtensions/StringHelpers.cs deleted file mode 100644 index 3aa17bbc..00000000 --- a/BLAZAMExtensions/StringHelpers.cs +++ /dev/null @@ -1,100 +0,0 @@ - -using Microsoft.AspNetCore.Components; -using System.Net; -using System.Runtime.InteropServices; -using System.Security; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace BLAZAM.Helpers -{ - public static class StringHelpers - { - public static MarkupString ToMarkupString(this string input) - { - return (MarkupString)input.Replace("\r\n","
").Replace("\n","
"); - } - public static int GetAppHashCode(this string input) - { - unchecked // Overflow is fine, just wrap - { - int hash = 17; - foreach (char c in input) - { - hash = hash * 23 + c; - } - return hash; - } - } - - public static bool IsNullOrEmpty(this string? str) - { - return str == null || str.Length < 1; - } - - public static bool IsUrlLocalToHost(this string url) - { - if (url.StartsWith("https://localhost")) return true; - if (url == "") return true; - return url[0] == '/' && (url.Length == 1 || - url[1] != '/' && url[1] != '\\') || // "/" or "/foo" but not "//" or "/\" - url.Length > 1 && - url[0] == '~' && url[1] == '/'; // "~/" or "~/foo" - } - - public static string ToPlainText(this SecureString? secureString) - { - if (secureString == null) return string.Empty; - IntPtr bstrPtr = Marshal.SecureStringToBSTR(secureString); - try - { - var plainText = Marshal.PtrToStringBSTR(bstrPtr); - if (plainText == null) - plainText = string.Empty; - return plainText; - - } - finally - { - Marshal.ZeroFreeBSTR(bstrPtr); - } - } - public static SecureString ToSecureString(this string plainText) - { - return new NetworkCredential("", plainText).SecurePassword; - } - - public static string? ToPrettyOu(this string? ou) - { - if (ou == null) return null; - var ouComponents = Regex.Matches(ou, @"OU=([^,]*)") - .Select(m => m.Groups[1].Value) - .ToList(); - ouComponents.Reverse(); - return "/"+string.Join("/", ouComponents); - } - public static string FqdnToDN(this string fqdn) - { - // Split the FQDN into its domain components - string[] domainComponents = fqdn.Split('.'); - - - - // Build the DN by appending each reversed domain component as a RDN (relative distinguished name) - StringBuilder dnBuilder = new StringBuilder(); - foreach (string dc in domainComponents) - { - dnBuilder.Append("DC="); - dnBuilder.Append(dc); - dnBuilder.Append(","); - } - - // Remove the last comma - dnBuilder.Length--; - - // Return the DN - return dnBuilder.ToString(); - } - } -} From b4e82fa492f666d6c9ee7dda6c2ebd9fa97a7dac Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Fri, 9 Aug 2024 12:26:31 -0400 Subject: [PATCH 2/2] Bump MudBlazor to 7.6.0 --- BLAZAM/BLAZAM.csproj | 4 ++-- BLAZAMEmailMessage/BLAZAMEmailMessage.csproj | 2 +- BLAZAMGui/BLAZAMGui.csproj | 2 +- BLAZAMJobs/BLAZAMJobs.csproj | 2 +- BLAZAMNotifications/BLAZAMNotifications.csproj | 2 +- BLAZAMThemes/BLAZAMThemes.csproj | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 086d0782..7490a662 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -77,7 +77,7 @@ - + diff --git a/BLAZAMEmailMessage/BLAZAMEmailMessage.csproj b/BLAZAMEmailMessage/BLAZAMEmailMessage.csproj index d6a17c55..10fa9813 100644 --- a/BLAZAMEmailMessage/BLAZAMEmailMessage.csproj +++ b/BLAZAMEmailMessage/BLAZAMEmailMessage.csproj @@ -14,7 +14,7 @@ - + diff --git a/BLAZAMGui/BLAZAMGui.csproj b/BLAZAMGui/BLAZAMGui.csproj index 73057bee..42e649ee 100644 --- a/BLAZAMGui/BLAZAMGui.csproj +++ b/BLAZAMGui/BLAZAMGui.csproj @@ -27,7 +27,7 @@ - + diff --git a/BLAZAMJobs/BLAZAMJobs.csproj b/BLAZAMJobs/BLAZAMJobs.csproj index 0a866c09..f6fc644d 100644 --- a/BLAZAMJobs/BLAZAMJobs.csproj +++ b/BLAZAMJobs/BLAZAMJobs.csproj @@ -8,7 +8,7 @@ - + diff --git a/BLAZAMNotifications/BLAZAMNotifications.csproj b/BLAZAMNotifications/BLAZAMNotifications.csproj index 0beef6e1..8c756e5e 100644 --- a/BLAZAMNotifications/BLAZAMNotifications.csproj +++ b/BLAZAMNotifications/BLAZAMNotifications.csproj @@ -8,7 +8,7 @@ - + diff --git a/BLAZAMThemes/BLAZAMThemes.csproj b/BLAZAMThemes/BLAZAMThemes.csproj index ea50aae3..0664ec01 100644 --- a/BLAZAMThemes/BLAZAMThemes.csproj +++ b/BLAZAMThemes/BLAZAMThemes.csproj @@ -8,7 +8,7 @@ - +