示例#1
0
        private void CheckPaths()
        {
            this.ListofMaps = new ObservableCollection <object>((List <FileMap>) this._resourceManager.GetResourcePayload(ResourceName.Mapping_Import));

            this._Logger.LogMessage("Checking Paths Maps");
            if (string.IsNullOrWhiteSpace(this.RemoteImportPath) || string.IsNullOrWhiteSpace(this.ExportPath))
            {
                throw new Exception("Unable to Process paths are null or white space");
            }
            if (Directory.Exists(this.RemoteImportPath) == false)
            {
                throw new Exception("Import Path Doesn't Exist");
            }
            if (Directory.Exists(this.ExportPath) == false)
            {
                this._Logger.LogMessage("Export Path Doesn't Exist Creating");
                Directory.CreateDirectory(this.ExportPath);
            }
            if (Directory.EnumerateFiles(this.RemoteImportPath).Count() == 0)
            {
                throw new Exception("Import Path has no Files");
            }
            FileChecker FC = new FileChecker();

            this.ListofImportFiles = new ObservableCollection <object>(FC.GetLastestFile(this.RemoteImportPath, GetSearchStrings()));// new string[] { "student", "timetable", "class" }));


            this.ListofExportTemplates = new ObservableCollection <object>((List <ExportMap>) this._resourceManager.GetResourcePayload(ResourceName.Mapping_Export));

            if (this.ListofImportFiles.Count() < 3)
            {
                throw new Exception("Not engough Import files found");
            }
        }