Example #1
0
 /// <summary>
 /// Constructor for FileData that got from Remote.
 /// </summary>
 /// <param name="relativepath">Relative path got from Host.</param>
 /// <param name="hashmd5">Hash got from Host.</param>
 /// <param name="fileSize">Size of the Host file in bytes.</param>
 /// <param name="lastWriteTime">"MM/dd/yyyy HH:mm" format of time file was last modified.</param>
 public FileData(string relativepath, string hashmd5, long fileSize, string lastWriteTime)
 {
     localPath    = "";
     relativePath = relativepath;
     hashMD5      = hashmd5;
     fms          = FileModifiedStatus.Untouched;
     ts           = new TimeSize(fileSize, lastWriteTime);
 }
Example #2
0
        /// <summary>
        /// Constructor for FileData that got from Local.
        /// </summary>
        /// <param name="SyncPath">Path to the directory that has to be syncronized.</param>
        /// <param name="localpath">Local path to a file.</param>
        public FileData(string SyncPath, string localpath)
        {
            localPath    = localpath;
            relativePath = localPath.Replace(SyncPath, "");
            hashMD5      = "";
            fms          = FileModifiedStatus.Untouched;

            FileInfo fi = new FileInfo(localpath);

            ts = new TimeSize(fi.Length, fi.LastWriteTime.ToString("MM/dd/yyyy HH:mm"));
        }
Example #3
0
 /// <summary>
 /// Function that changes FileData based on based Relative path.
 /// </summary>
 /// <param name="rel">Relative path to file.</param>
 /// <param name="f">Status that has to be set.</param>
 public void ChangeFileModifiedStatusByRelativePath(string rel, FileModifiedStatus f)
 {
     for (int i = 0; i < FilesData.Count; i++)
     {
         if (FilesData[i].relativePath == rel)
         {
             FilesData[i].fms = f;
             return;
         }
     }
 }