Esempio n. 1
0
 public PSSyncHistoryEntry(SyncHistoryEntryData info)
 {
     this.Id                     = info.Id;
     this.SyncEntryId            = info.SyncEntryId;
     this.Flags                  = info.Flags;
     this.Result                 = info.Result;
     this.OriginalSizeOld        = info.OriginalSizeOld;
     this.EncryptedSizeOld       = info.EncryptedSizeOld;
     this.OriginalSizeNew        = info.OriginalSizeNew;
     this.EncryptedSizeNew       = info.EncryptedSizeNew;
     this.OriginalSha1HashOld    = this.GetHashString(info.OriginalSha1HashOld);
     this.EncryptedSha1HashOld   = this.GetHashString(info.EncryptedSha1HashOld);
     this.OriginalSha1HashNew    = this.GetHashString(info.OriginalSha1HashNew);
     this.EncryptedSha1HashNew   = this.GetHashString(info.EncryptedSha1HashNew);
     this.OriginalMd5HashOld     = this.GetHashString(info.OriginalMd5HashOld);
     this.EncryptedMd5HashOld    = this.GetHashString(info.EncryptedMd5HashOld);
     this.OriginalMd5HashNew     = this.GetHashString(info.OriginalMd5HashNew);
     this.EncryptedMd5HashNew    = this.GetHashString(info.EncryptedMd5HashNew);
     this.CreationDateTimeUtcOld = info.CreationDateTimeUtcOld;
     this.CreationDateTimeUtcNew = info.CreationDateTimeUtcNew;
     this.ModifiedDateTimeUtcOld = info.ModifiedDateTimeUtcOld;
     this.ModifiedDateTimeUtcNew = info.ModifiedDateTimeUtcNew;
     this.PathOld                = info.PathOld;
     this.PathNew                = info.PathNew;
 }
Esempio n. 2
0
 private void CalculateChangeMetrics(SyncHistoryEntryData entry)
 {
     if (entry.SyncEntry.Type == SyncEntryType.Directory)
     {
         if (entry.HasSyncEntryFlag(SyncEntryChangedFlags.NewDirectory))
         {
             this.ChangeMetricsList[1].Added++;
         }
         else if (entry.HasSyncEntryFlag(SyncEntryChangedFlags.Deleted))
         {
             this.ChangeMetricsList[1].Removed++;
         }
         else if (entry.HasSyncEntryFlag(SyncEntryChangedFlags.CreatedTimestamp) ||
                  entry.HasSyncEntryFlag(SyncEntryChangedFlags.ModifiedTimestamp))
         {
             this.ChangeMetricsList[1].Metadata++;
         }
     }
     else
     {
         if (entry.HasSyncEntryFlag(SyncEntryChangedFlags.NewFile))
         {
             this.ChangeMetricsList[0].Added++;
             this.ChangeMetricsList[2].Added += entry.OriginalSizeNew;
             this.BytesToCopy += entry.OriginalSizeNew;
         }
         else if (entry.HasSyncEntryFlag(SyncEntryChangedFlags.Deleted))
         {
             this.ChangeMetricsList[0].Removed++;
             this.ChangeMetricsList[2].Removed += entry.OriginalSizeNew;
         }
         else if (entry.HasSyncEntryFlag(SyncEntryChangedFlags.CreatedTimestamp) ||
                  entry.HasSyncEntryFlag(SyncEntryChangedFlags.ModifiedTimestamp))
         {
             this.ChangeMetricsList[0].Metadata++;
         }
         else if (entry.HasSyncEntryFlag(SyncEntryChangedFlags.Sha1Hash) ||
                  entry.HasSyncEntryFlag(SyncEntryChangedFlags.Md5Hash) ||
                  entry.HasSyncEntryFlag(SyncEntryChangedFlags.FileSize))
         {
             this.ChangeMetricsList[0].Modified++;
             this.ChangeMetricsList[2].Modified += entry.OriginalSizeNew;
             this.BytesToCopy += entry.OriginalSizeNew;
         }
     }
 }