public Package Pack(byte[] data, EncryptionAlgorithmType encryptionAlgType, PayloadDataType dataType, DateTime timeStamp) { return(new Package { DataType = dataType, EncryptionAlgorithm = encryptionAlgType, Retention = -1, TimeStamp = timeStamp, Payload = data }); }
private bool SaveToFile(string data, PayloadDataType dataType, DateTime timeStamp) { string basePath = AppDomain.CurrentDomain.BaseDirectory; string fileName = Path.Combine(Path.GetDirectoryName(basePath), "ReceivedPackages", dataType.ToString() + "_" + timeStamp.ToString("yyyy-MM-dd HH_mm_ss_fff tt") + "_tick_" + DateTime.UtcNow.Ticks + ".json"); try { File.WriteAllText(fileName, data); } catch { return(false); } return(true); }
public static Package PreaparePackage(byte[] serializedData, EncryptionAlgorithmType encryptionAlgType, PayloadDataType dataType, DateTime timeStamp) { return(_pm.Pack(serializedData, encryptionAlgType, dataType, timeStamp)); }
public NumberOrString(int?intValue, string?stringValue, PayloadDataType type) { IntValue = intValue; StringValue = stringValue; Type = type; }