LongoMatch.DB.DataBase.Exists C# (CSharp) Method

Exists() public method

public Exists ( Project project ) : bool
project Project
return bool
        public bool Exists(Project project)
        {
            bool ret = false;
            if (projectsDB.ProjectsDict.ContainsKey (project.ID)) {
                if (File.Exists (Path.Combine (dbDirPath, project.ID.ToString ()))) {
                    ret = true;
                }
            }
            return ret;
        }

Usage Example

Example #1
0
 public void TestExists()
 {
     string dbdir = Path.Combine (tmpdir, "test.ldb");
     DataBase db = new DataBase (dbdir);
     ProjectDescriptionLongoMatch pd1 = new ProjectDescriptionLongoMatch ();
     ProjectLongoMatch p1 = new ProjectLongoMatch {Description = pd1};
     Assert.IsFalse (db.Exists (p1));
     db.AddProject (p1);
     Assert.IsTrue (db.Exists (p1));
 }