public static SuspectsRepositoryManager CreateNewIn(string directoryPath)
        {
            var mnger = new SuspectsRepositoryManager(directoryPath);

            string[] directories = new string[]
            {
                mnger.GetImageDirectoryAbsolute(),
                mnger.GetBadGuyGrayDirectoryAbsolute(),
                mnger.GetBadGuyColorDirectoryAbsolute(),
                mnger.GetGoodGuyGrayDirectoryAbsolute(),
                mnger.GetGoodGuyColorDirectoryAbsolute(),
                mnger.GetSvmDirectoryAbsolute(),
                mnger.GetPcaDirectoryAbsolute(),
            };

            foreach (string dir in directories)
            {
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }
            }

            File.WriteAllText(GetConfigIniPathAbsolute(directoryPath), Properties.Resource.config);
            return mnger;
        }
        public static SuspectsRepositoryManager Load()
        {
            SuspectsRepositoryManager repo = new SuspectsRepositoryManager();

            loadInternal(repo.storage);
            return repo;
        }
        public static SuspectsRepositoryManager CreateNewIn(string directoryPath)
        {
            var mnger = new SuspectsRepositoryManager(directoryPath);

            string[] directories = new string[]
            {
                mnger.GetImageDirectoryAbsolute(),
                     mnger.GetBadGuyGrayDirectoryAbsolute(),
                     mnger.GetBadGuyColorDirectoryAbsolute(),
                     mnger.GetGoodGuyGrayDirectoryAbsolute(),
                     mnger.GetGoodGuyColorDirectoryAbsolute(),
                     mnger.GetSvmDirectoryAbsolute(),
                     mnger.GetPcaDirectoryAbsolute(),
            };


            foreach (string dir in directories)
            {
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }
            }

            File.WriteAllText(GetConfigIniPathAbsolute(directoryPath), Properties.Resource.config);
            return(mnger);
        }
Пример #4
0
        public static SuspectsRepositoryManager Load()
        {
            SuspectsRepositoryManager repo = new SuspectsRepositoryManager();

            loadInternal(repo.storage);
            return(repo);
        }
        public static SuspectsRepositoryManager LoadFrom(string filePath)
        {
            if (String.IsNullOrEmpty(filePath))
            {
                throw new ArgumentException("fileName is null or empty.", "fileName");
            }

            string absoluteFilePath = filePath;
            string reason;

            if (!PathHelper.IsValidAbsolutePath(filePath, out reason))
            {
                absoluteFilePath = Path.Combine(Directory.GetCurrentDirectory(), filePath);
            }

            var mnger = new SuspectsRepositoryManager(absoluteFilePath);

            mnger.Load();

            return(mnger);
        }
        public static SuspectsRepositoryManager LoadFrom(string filePath)
        {
            if (String.IsNullOrEmpty(filePath))
                throw new ArgumentException("fileName is null or empty.", "fileName");

            string absoluteFilePath = filePath;
            string reason;
            if (!PathHelper.IsValidAbsolutePath(filePath, out reason))
            {
                absoluteFilePath = Path.Combine(Directory.GetCurrentDirectory(), filePath);
            }

            var mnger = new SuspectsRepositoryManager(absoluteFilePath);
            mnger.Load();

            return mnger;
        }
Пример #7
0
 private void OpenExisted(string directory)
 {
     this.RootDirectoryForImageRepository = directory;
     this.mnger = SuspectsRepositoryManager.LoadFrom(this.RootDirectoryForImageRepository);
     UpdateFormText();
     EnableButtons();
 }
Пример #8
0
 private void CreateNew(string directory)
 {
     this.RootDirectoryForImageRepository = directory;
     this.mnger = SuspectsRepositoryManager.CreateNewIn(this.RootDirectoryForImageRepository);
     UpdateFormText();
     EnableButtons();
 }