Esempio n. 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);
 }
Esempio n. 2
0
 private bool CompareTimeForUpdate(UpdateFile file)
 {
     DateTime nextUpdateDate = file.FileTimestamp.AddDays(DaysNextUpdate);
     if ((DateTime.Compare(nextUpdateDate, DayTimeToday)) <= 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 3
0
        private bool CompareTimeForUpdate(UpdateFile file)
        {
            DateTime nextUpdateDate = file.FileTimestamp.AddDays(DaysNextUpdate);

            if ((DateTime.Compare(nextUpdateDate, DayTimeToday)) <= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 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();
            }
        }
Esempio n. 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();
            }
        }
Esempio n. 6
0
 public UpdateDownloader(UpdateFile file)
 {
     _updateFile = file;
 }
Esempio n. 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();
            }
        }
Esempio n. 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;
 }
Esempio n. 9
0
 public void DownloadUpdate(UpdateFile file, JObject check)
 {
     UpdateDownloader UpdateDownloader = new UpdateDownloader(file);
     UpdateDownloader.downloadUpdate(check);
 }
Esempio n. 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();
           }
        }
Esempio n. 11
0
        public void DownloadUpdate(UpdateFile file, JObject check)
        {
            UpdateDownloader UpdateDownloader = new UpdateDownloader(file);

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