This commit is contained in:
Eugenio Chiodo committed 2022-02-14 01:51:52 +01:00
1 parent ba4a4b14c8
commit 5cba76554a
84 files changed
+18148 -11553

No files matched your search

+2 -40
View File
@@ -1,10 +1,6 @@
using collAnon.Shared;
using System;
using System.IO;
using System.Net.Mail;
using System.Text.Json;
using System.Net.Mail;
namespace collAnon.Client.Helpers
namespace decePubClient.Helpers
{
public static class SUtility
{
@@ -27,12 +23,6 @@ namespace collAnon.Client.Helpers
return !(end < now && now < start);
}
public static bool CacheHasExpired(long? lastTimeCacheTimeTicks)
{
if (!lastTimeCacheTimeTicks.HasValue) return true;
return (DateTime.Now.Ticks - lastTimeCacheTimeTicks.Value) > VConstants.CacheExpirationPeriod.Ticks;
}
public static string GetFileIcon(string fileName)
{
switch (Path.GetExtension(fileName))
@@ -62,21 +52,6 @@ namespace collAnon.Client.Helpers
}
}
public static string GetMissingMimeType(string fileName)
{
switch (Path.GetExtension(fileName))
{
case ".docx":
return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
case ".xlsx":
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
default:
return string.Empty;
}
}
public static bool IsValidEmail(string email)
{
try
@@ -89,18 +64,5 @@ namespace collAnon.Client.Helpers
return false;
}
}
public static string GetQrCodeBase64(string base64String) => $"data:image/png;base64,{base64String}";
public static int GetRand()
{
var random = new Random(DateTime.Now.Millisecond);
return random.Next(0, random.Next(10, 1000));
}
public static T Deserialize<T>(string value)
{
return JsonSerializer.Deserialize<T>(value, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
}
}
}