Beispiel #1
0
        private void DoBackup()
        {
            buttonBackup.Enabled = false;
            FileInfo[] files = null;

            if (recordingState == RecordingState.Started)
            {
                StopRecording();
                files = FileInfoSorter.Get(Program.settings.PathForVideo);
                StartRecording();
            }
            else
            {
                files = FileInfoSorter.Get(Program.settings.PathForVideo);
            }

            VideoBackuper backuper = new VideoBackuper
                                     (
                files,
                BackupProgressChanged,
                BackupFinished
                                     );

            backuper.Do();
        }
Beispiel #2
0
        private void DeleteOldFiles()
        {
            FileInfo[] files = FileInfoSorter.Get(Program.settings.PathForVideo);

            for (int index = Program.settings.AmountOfFiles + 1; index < files.Length; ++index)
            {
                try
                {
                    File.Delete(files[index].FullName);
                }
                catch { }
            }
        }