Example #1
0
        public ReferenceDao()
        {
            DatabasePath dbPath      = new DatabasePath();
            string       base_folder = dbPath.CurrentDBFile(); //System.AppDomain.CurrentDomain.BaseDirectory;

            sqlite = new Sqlite(base_folder);
        }
Example #2
0
        private void LoadConfig()
        {
            Name                = WebConfigurationManager.AppSettings["Name"];
            Title               = WebConfigurationManager.AppSettings["Title"];
            Description         = WebConfigurationManager.AppSettings["Description"];
            Footer              = WebConfigurationManager.AppSettings["Footer"];
            ModulePath          = WebConfigurationManager.AppSettings["ModulePath"];
            ConfigurationPath   = WebConfigurationManager.AppSettings["ConfigurationPath"];
            DatabaseType        = WebConfigurationManager.AppSettings["DatabaseType"];
            DatabasePath        = WebConfigurationManager.AppSettings["DatabasePath"];
            RegistrationKeyPath = WebConfigurationManager.AppSettings["RegistrationKeyPath"];

#if DEBUG
            // For debugging, change the path to the App_Data folder, where the
            // test files and databases are stored.
            ModulePath          = HttpContext.Current.Server.MapPath(ModulePath);
            ConfigurationPath   = HttpContext.Current.Server.MapPath(ConfigurationPath);
            DatabaseType        = "ESENT";
            DatabasePath        = HttpContext.Current.Server.MapPath(DatabasePath);
            RegistrationKeyPath = HttpContext.Current.Server.MapPath(RegistrationKeyPath);
#endif

            // Trim path
            ModulePath          = ModulePath.TrimEnd(new char[] { '\\', '/' });
            ConfigurationPath   = ConfigurationPath.TrimEnd(new char[] { '\\', '/' });
            DatabasePath        = DatabasePath.TrimEnd(new char[] { '\\', '/' });
            RegistrationKeyPath = RegistrationKeyPath.TrimEnd(new char[] { '\\', '/' });

            VerifyConfig();
        }
        public NtStatus GetFileInformation(Path path, out FileInformation fileInfo, IDokanFileInfo info)
        {
            fileInfo = default;
            return(path switch
            {
                // Dirs
                RootPath p => GetFileInformation(p, out fileInfo),
                DatabasePath p => GetFileInformation(p, out fileInfo),
                CollectionPath p => GetFileInformation(p, out fileInfo),
                DataDirectoryPath p => GetFileInformation(p, out fileInfo),
                QueryDirectoryPath p => GetFileInformation(p, out fileInfo),
                QueryEmptyDirectoryPath p => GetFileInformation(p, out fileInfo),

                // Files
                StatsPath p => GetFileInformation(p, out fileInfo),
                IndexesPath p => GetFileInformation(p, out fileInfo),
                CurrentOpPath p => GetFileInformation(p, out fileInfo),
                ServerStatusPath p => GetFileInformation(p, out fileInfo),
                BuildInfoPath p => GetFileInformation(p, out fileInfo),
                HostInfoPath p => GetFileInformation(p, out fileInfo),
                ListCommandsPath p => GetFileInformation(p, out fileInfo),
                DataDocumentPath p => GetFileInformation(p, out fileInfo),
                QueryDocumentPath p => GetFileInformation(p, out fileInfo),
                QueryAllDocumentsPath p => GetFileInformation(p, out fileInfo),

                var p => LogFailure(p)
            });
Example #4
0
File: Irt.cs Project: zrolfs/pwiz
 public override int GetHashCode()
 {
     unchecked
     {
         return((base.GetHashCode() * 397) ^ DatabasePath.GetHashCode());
     }
 }
Example #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         {
             return((base.GetHashCode() * 397) ^ (DatabasePath != null ? DatabasePath.GetHashCode() : 0));
         }
     }
 }
Example #6
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         result = (result * 397) ^ DatabasePath.GetHashCode();
         result = (result * 397) ^ (_database != null ? _database.GetHashCode() : 0);
         return(result);
     }
 }
Example #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         result = (result * 397) ^ DatabasePath.GetHashCode();
         // TODO: Get the code for getting a reference equality hashcode from Nick
         result = (result * 397) ^ (_database != null ? _database.GetHashCode() : 0);
         return(result);
     }
 }
Example #8
0
        public NtStatus FindFilesWithPattern(Path path, string?searchPattern, out IList <FileInformation> files,
                                             IDokanFileInfo info)
        {
            files = Array.Empty <FileInformation>();
            return(path switch
            {
                RootPath p => FindFilesWithPattern(p, searchPattern, out files),
                DatabasePath p => FindFilesWithPattern(p, searchPattern, out files),
                CollectionPath p => FindFilesWithPattern(p, searchPattern, out files),
                DataDirectoryPath p => FindFilesWithPattern(p, searchPattern, out files),
                QueryDirectoryPath p => FindFilesWithPattern(p, searchPattern, out files),
                QueryEmptyDirectoryPath p => FindFilesWithPattern(p, searchPattern, out files),

                var p => LogFailure(path)
            });
Example #9
0
        public IDictionary <string, object> ToJson()
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add(nameof(EnvironmentName), EnvironmentName);

            // Windows supports forward slashes to easy copy paste and check the path
            dictionary.Add(nameof(ContentRootPath), ContentRootPath.Replace("\\", "/"));
            dictionary.Add(nameof(WebRootPath), WebRootPath.Replace("\\", "/"));
            dictionary.Add(nameof(ApplicationBasePath), ApplicationBasePath.Replace("\\", "/"));
            dictionary.Add(nameof(AppDirectory), AppDirectory.Replace("\\", "/"));
            dictionary.Add(nameof(DatabasePath), DatabasePath.Replace("\\", "/"));
            dictionary.Add(nameof(MainAppDirectoryWebRoot), MainAppDirectoryWebRoot.Replace("\\", "/"));
            dictionary.Add(nameof(ExecutionPath), ExecutionPath.Replace("\\", "/"));
            dictionary.Add(nameof(Version), Version);
            dictionary.Add(nameof(AssemblyPath), AssemblyPath.Replace("\\", "/"));
            dictionary.Add(nameof(ContextDateTime), ContextDateTime);
            dictionary.Add(nameof(ComponentDefinition.ComponentId), ComponentInfo?.ComponentId);

            return(dictionary);
        }
 /// <summary>
 /// Serves as a hash function for a RealmConfiguration based on its path.
 /// </summary>
 /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
 /// hash table.</returns>
 public override int GetHashCode()
 {
     return(DatabasePath.GetHashCode());
 }
Example #11
0
 /// <summary>
 /// Serves as a hash function for a RealmConfiguration based on its path.
 /// </summary>
 /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
 /// hash table.</returns>
 public override int GetHashCode() => DatabasePath.GetHashCode();