Example #1
0
 public UpdateFile ReadUpdateFile(UpdateFile file)
 {
     using (StreamReader reader = new StreamReader(file.filepath))
     {
         string line = reader.ReadToEnd();
         file.FileTimestamp = Convert.ToDateTime(line);
         reader.Close();
     }
     return(file);
 }
Example #2
0
 private bool CompareTimeForUpdate(UpdateFile file)
 {
     DateTime nextUpdateDate = file.FileTimestamp.AddDays(DaysNextUpdate);
     if ((DateTime.Compare(nextUpdateDate, DayTimeToday)) <= 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Example #3
0
        private bool CompareTimeForUpdate(UpdateFile file)
        {
            DateTime nextUpdateDate = file.FileTimestamp.AddDays(DaysNextUpdate);

            if ((DateTime.Compare(nextUpdateDate, DayTimeToday)) <= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #4
0
        public void createUpdateFile(UpdateFile file)
        {
            using (FileStream fs = File.Create(file.filepath))
            {
                fs.Close();
            }

            using (StreamWriter sw = new StreamWriter(file.filepath))
            {
                DateTime timeStamp = new DateTime(file.FileTimestamp.Ticks);
                sw.Write(timeStamp);
                DirectoryInfo dInfo = new DirectoryInfo(file.filepath);
                File.SetAttributes(file.filepath, FileAttributes.Hidden);
                sw.Close();
            }
        }
Example #5
0
        public void WriteUpdateFile(UpdateFile file)
        {
            try
            {
                File.Delete(file.filepath);
            }
            catch (Exception e)
            {
                throw new Exception(e.StackTrace);
            }

            DirectoryInfo dInfo = new DirectoryInfo(file.filepath);

            using (StreamWriter writer = new StreamWriter(file.filepath, true))
            {
                writer.Write(file.FileTimestamp);
                writer.Close();
            }
        }
Example #6
0
 public UpdateDownloader(UpdateFile file)
 {
     _updateFile = file;
 }
Example #7
0
        public void WriteUpdateFile(UpdateFile file)
        {
            try
            {
                File.Delete(file.filepath);
            }
            catch (Exception e)
            {
                throw new Exception(e.StackTrace);
            }

            DirectoryInfo dInfo = new DirectoryInfo(file.filepath);
            using (StreamWriter writer = new StreamWriter(file.filepath, true))
            {
                writer.Write(file.FileTimestamp);
                writer.Close();
            }
        }
Example #8
0
 public UpdateFile ReadUpdateFile(UpdateFile file)
 {
     using (StreamReader reader = new StreamReader(file.filepath))
     {
         string line = reader.ReadToEnd();
         file.FileTimestamp = Convert.ToDateTime(line);
         reader.Close();
     }
     return file;
 }
Example #9
0
 public void DownloadUpdate(UpdateFile file, JObject check)
 {
     UpdateDownloader UpdateDownloader = new UpdateDownloader(file);
     UpdateDownloader.downloadUpdate(check);
 }
Example #10
0
        public void createUpdateFile(UpdateFile file)
        {
            using (FileStream fs = File.Create(file.filepath))
            {
                fs.Close();
            }

            using (StreamWriter sw = new StreamWriter(file.filepath))
            {
                DateTime timeStamp = new DateTime(file.FileTimestamp.Ticks);
                sw.Write(timeStamp);
                DirectoryInfo dInfo = new DirectoryInfo(file.filepath);
                File.SetAttributes(file.filepath, FileAttributes.Hidden);
                sw.Close();
           }
        }
Example #11
0
        public void DownloadUpdate(UpdateFile file, JObject check)
        {
            UpdateDownloader UpdateDownloader = new UpdateDownloader(file);

            UpdateDownloader.downloadUpdate(check);
        }
Example #12
0
 public UpdateDownloader(UpdateFile file)
 {
     _updateFile = file;
 }