Exemple #1
0
        public Watcher(DoRecord log, ConfigManager config)
        {
            MakeRecord += log;

            var paths = config.GetConfiguration <PathOptions>() as PathOptions;

            watcher          = new FileSystemWatcher(paths.SourceDirectory);
            watcher.Deleted += ElementDeleted;
            watcher.Created += ElementCreated;
            //watcher.Changed += ElementChanged;
            watcher.Renamed += ElementRenamed;
            watcher.Filter   = "*.xml";

            targetDir        = paths.TargetDirectory;
            enableArchiveDir = paths.EnableArchivation;
            archivedFilesDir = paths.ArchiveDirectory;
            if (!Directory.Exists(archivedFilesDir) && enableArchiveDir)
            {
                try
                {
                    Directory.CreateDirectory(archivedFilesDir);
                }
                catch
                {
                    archivedFilesDir = targetDir + "\\archive";
                    Directory.CreateDirectory(archivedFilesDir);
                    MakeRecord($"Couldn't find directory for archive files, so created this one {archivedFilesDir}.\n");
                }
            }
            enableEncrypting = (config.GetConfiguration <EncryptionOptions>() as EncryptionOptions).EnableEncryption;
            archiveOptions   = config.GetConfiguration <ArchiveOptions>() as ArchiveOptions;
        }
        private void MakeAppoint(object record)
        {
            InfoAppoint myRecord = (InfoAppoint)record;

            if (myRecord.Text == "Free" || myRecord.Text == "Booked")
            {
                DoRecord dr = new DoRecord(myRecord);
                dr.ShowDialog();
            }
            else
            {
                MessageBox.Show("Record anavailable");
            }
        }
Exemple #3
0
 public MockBillReaderWriter(DoGetAllBills doGetAll, DoRecord doRecord)
 {
     _doGetAllBills = doGetAll;
     _doRecord      = doRecord;
 }