コード例 #1
0
 public Package Pack(byte[] data, EncryptionAlgorithmType encryptionAlgType, PayloadDataType dataType, DateTime timeStamp)
 {
     return(new Package
     {
         DataType = dataType,
         EncryptionAlgorithm = encryptionAlgType,
         Retention = -1,
         TimeStamp = timeStamp,
         Payload = data
     });
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 public static Package PreaparePackage(byte[] serializedData, EncryptionAlgorithmType encryptionAlgType, PayloadDataType dataType, DateTime timeStamp)
 {
     return(_pm.Pack(serializedData, encryptionAlgType, dataType, timeStamp));
 }
コード例 #4
0
 public NumberOrString(int?intValue, string?stringValue, PayloadDataType type)
 {
     IntValue    = intValue;
     StringValue = stringValue;
     Type        = type;
 }