person-key-to-immich-import birthday json (Day-Helper-2024-05-18)
csharp_prefer_braces = true
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
|
||||
using IFX.Shared.PasteSpecialXml.EAF.XML.API.Envelope;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
@ -6,10 +8,6 @@ using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using IFX.Shared.PasteSpecialXml.EAF.XML.API.Envelope;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace File_Folder_Helper.ADO2025.PI6;
|
||||
|
||||
internal static partial class Helper20250601 {
|
||||
@ -33,6 +31,24 @@ internal static partial class Helper20250601 {
|
||||
string StopTime,
|
||||
string Text);
|
||||
|
||||
private static T? ParseXML<T>(string value, bool throwExceptions) where T : class {
|
||||
object? result = null;
|
||||
try {
|
||||
Stream stream = ToStream(value.Trim());
|
||||
XmlReader xmlReader = XmlReader.Create(stream, new XmlReaderSettings() { ConformanceLevel = ConformanceLevel.Document });
|
||||
#pragma warning disable IL2026, IL2090
|
||||
XmlSerializer xmlSerializer = new(typeof(T), typeof(T).GetNestedTypes());
|
||||
result = xmlSerializer.Deserialize(xmlReader);
|
||||
#pragma warning restore IL2026, IL2090
|
||||
stream.Dispose();
|
||||
} catch (Exception) {
|
||||
if (throwExceptions) {
|
||||
throw;
|
||||
}
|
||||
}
|
||||
return result as T;
|
||||
}
|
||||
|
||||
internal static void EquipmentAutomationFrameworkStatus(ILogger<Worker> logger, List<string> args) {
|
||||
Status status;
|
||||
Record? record;
|
||||
@ -141,41 +157,6 @@ internal static partial class Helper20250601 {
|
||||
return results;
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<string> GetUrls(bool development, bool staging, bool production) {
|
||||
List<string> results = [];
|
||||
if (development) {
|
||||
results.Add("eaf-dev.mes.infineon.com:9003");
|
||||
}
|
||||
if (staging) {
|
||||
results.Add("eaf-staging.mes.infineon.com:9003");
|
||||
}
|
||||
if (production) {
|
||||
results.Add("eaf-prod.mes.infineon.com:9003");
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private static List<UnicodeCategory> GetUnicodeCategory() {
|
||||
List<UnicodeCategory> unicodeCategories = [
|
||||
// UnicodeCategory.Control, // 33 - <20>
|
||||
UnicodeCategory.UppercaseLetter, // 25 - ABCDEFGHIJKLMNOPQRSTUVWXY
|
||||
UnicodeCategory.LowercaseLetter, // 25 - abcdefghiklmnopqrstuvwxyz
|
||||
UnicodeCategory.DecimalDigitNumber, // 10 - 0123456789
|
||||
UnicodeCategory.OtherPunctuation, // 10 - !"#%&,./:@
|
||||
UnicodeCategory.ClosePunctuation, // 2 - )]
|
||||
UnicodeCategory.MathSymbol, // 2 - |؈
|
||||
UnicodeCategory.OpenPunctuation, // 2 - ([
|
||||
// UnicodeCategory.OtherSymbol, // 1 - <20>
|
||||
UnicodeCategory.DashPunctuation, // 1 - -
|
||||
UnicodeCategory.ConnectorPunctuation, // 1 - _
|
||||
UnicodeCategory.ModifierSymbol, // 1 - `
|
||||
UnicodeCategory.NonSpacingMark, // 1 - ̵
|
||||
UnicodeCategory.SpaceSeparator, // 1 -
|
||||
UnicodeCategory.CurrencySymbol, // 1 - $
|
||||
];
|
||||
return unicodeCategories;
|
||||
}
|
||||
|
||||
private static void EquipmentAutomationFrameworkCellInstanceParseCheck() {
|
||||
Envelope? envelope;
|
||||
string xmlStart621 = "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://www.w3.org/2005/08/addressing\"><s:Header><a:Action s:mustUnderstand=\"1\">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse</a:Action><a:RelatesTo>urn:uuid:6eb7a538-0b2b-4d04-8f2a-ab50e1e5338a</a:RelatesTo></s:Header><s:Body><CreateSequenceResponse xmlns=\"http://schemas.xmlsoap.org/ws/2005/02/rm\"><Identifier>urn:uuid:31c290af-2312-4b00-a57c-d5e1ab51e02a</Identifier><Accept><AcksTo><a:Address>http://eaf-prod.mes.infineon.com:9003/CellControllerManager</a:Address></AcksTo></Accept></CreateSequenceResponse></s:Body></s:Envelope>";
|
||||
@ -196,33 +177,6 @@ internal static partial class Helper20250601 {
|
||||
}
|
||||
}
|
||||
|
||||
private static T? ParseXML<T>(string value, bool throwExceptions) where T : class {
|
||||
object? result = null;
|
||||
try {
|
||||
Stream stream = ToStream(value.Trim());
|
||||
XmlReader xmlReader = XmlReader.Create(stream, new XmlReaderSettings() { ConformanceLevel = ConformanceLevel.Document });
|
||||
#pragma warning disable IL2026, IL2090
|
||||
XmlSerializer xmlSerializer = new(typeof(T), typeof(T).GetNestedTypes());
|
||||
result = xmlSerializer.Deserialize(xmlReader);
|
||||
#pragma warning restore IL2026, IL2090
|
||||
stream.Dispose();
|
||||
} catch (Exception) {
|
||||
if (throwExceptions) {
|
||||
throw;
|
||||
}
|
||||
}
|
||||
return result as T;
|
||||
}
|
||||
|
||||
private static Stream ToStream(string value) {
|
||||
MemoryStream memoryStream = new();
|
||||
StreamWriter streamWriter = new(memoryStream);
|
||||
streamWriter.Write(value);
|
||||
streamWriter.Flush();
|
||||
memoryStream.Position = 0;
|
||||
return memoryStream;
|
||||
}
|
||||
|
||||
private static Dictionary<char, char> GetUnicodeReplaces() {
|
||||
Dictionary<char, char> results = new() {
|
||||
{ '\u0000', ' ' },
|
||||
@ -295,6 +249,41 @@ internal static partial class Helper20250601 {
|
||||
return results;
|
||||
}
|
||||
|
||||
private static List<UnicodeCategory> GetUnicodeCategory() {
|
||||
List<UnicodeCategory> unicodeCategories = [
|
||||
// UnicodeCategory.Control, // 33 - <20>
|
||||
UnicodeCategory.UppercaseLetter, // 25 - ABCDEFGHIJKLMNOPQRSTUVWXY
|
||||
UnicodeCategory.LowercaseLetter, // 25 - abcdefghiklmnopqrstuvwxyz
|
||||
UnicodeCategory.DecimalDigitNumber, // 10 - 0123456789
|
||||
UnicodeCategory.OtherPunctuation, // 10 - !"#%&,./:@
|
||||
UnicodeCategory.ClosePunctuation, // 2 - )]
|
||||
UnicodeCategory.MathSymbol, // 2 - |؈
|
||||
UnicodeCategory.OpenPunctuation, // 2 - ([
|
||||
// UnicodeCategory.OtherSymbol, // 1 - <20>
|
||||
UnicodeCategory.DashPunctuation, // 1 - -
|
||||
UnicodeCategory.ConnectorPunctuation, // 1 - _
|
||||
UnicodeCategory.ModifierSymbol, // 1 - `
|
||||
UnicodeCategory.NonSpacingMark, // 1 - ̵
|
||||
UnicodeCategory.SpaceSeparator, // 1 -
|
||||
UnicodeCategory.CurrencySymbol, // 1 - $
|
||||
];
|
||||
return unicodeCategories;
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<string> GetUrls(bool development, bool staging, bool production) {
|
||||
List<string> results = [];
|
||||
if (development) {
|
||||
results.Add("eaf-dev.mes.infineon.com:9003");
|
||||
}
|
||||
if (staging) {
|
||||
results.Add("eaf-staging.mes.infineon.com:9003");
|
||||
}
|
||||
if (production) {
|
||||
results.Add("eaf-prod.mes.infineon.com:9003");
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private static Status EquipmentAutomationFrameworkCellInstanceStatus(string cellInstanceName, Record record) {
|
||||
Status result;
|
||||
bool stop = false;
|
||||
@ -390,4 +379,13 @@ internal static partial class Helper20250601 {
|
||||
return results;
|
||||
}
|
||||
|
||||
private static Stream ToStream(string value) {
|
||||
MemoryStream memoryStream = new();
|
||||
StreamWriter streamWriter = new(memoryStream);
|
||||
streamWriter.Write(value);
|
||||
streamWriter.Flush();
|
||||
memoryStream.Position = 0;
|
||||
return memoryStream;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user