AccessConfig.cs
Description du code
AccessConfig.cs est un fichier du projet BiblioBrol.Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/src/.
Projet BiblioBrol :
Gestion de media en CSharp.
Pour plus d'infos, vous pouvez consulter la brève analyse.
Code source ou contenu du fichier
Code c# (AccessConfig.cs) (112 lignes)
using System; using System.Collections.Generic; using System.Text; using be.gaudry.bibliobrol.model.enums; using be.gaudry.model.config; using be.gaudry.bibliobrol.config; namespace be.gaudry.bibliobrol.model.dao.config { public class AccessConfig : AbstractDBConfig { #region declarations and constructor private ACCESS_VERSION accessVersion; private string dbPath; private string dbName; private string pathSetting = "persistance/Access/path"; private string nameSetting = "persistance/Access/filename"; private string versionSetting = "persistance/Access/version"; //public AccessConfig() : base() { } #endregion #region public methods public override void load() { dbPath = brolSettings.getSetting(pathSetting, ""); dbName = brolSettings.getSetting(nameSetting, "data.bdb"); try { accessVersion = (ACCESS_VERSION)brolSettings.getSetting( versionSetting, (int)ACCESS_VERSION.Access03 ); } catch (ArgumentException) { accessVersion = ACCESS_VERSION.Access03; } } public override void save() { brolSettings.putSetting(pathSetting, dbPath, false); brolSettings.putSetting(nameSetting, dbName, false); brolSettings.putSetting(versionSetting, (int)accessVersion, false); brolSettings.save(); } /// <summary> /// MS Access version. /// </summary> public ACCESS_VERSION AccessVersion { get { return accessVersion; } set { accessVersion = value; } } /// <summary> /// Path of the db file without file name. /// If BiblioBrol is executed from a removable storage, /// dbPath setting is an empty string. /// </summary> public string DBPath { get { return dbPath; } set { dbPath = value; } } /// <summary> /// Name and extension of the db file (without path). /// </summary> public string DBFileName { get { return dbName; } set { dbName = value; } } /// <summary> /// Returns the adapted path of the database directory. /// /// A "bibliobrol" directory in the user documents is used by default. /// If this BrolDev application is executed from a removable storage, /// the path is generated from the application path. /// </summary> public string getAdaptedPath() { return System.IO.Path.Combine( getAdaptedDirectory(), dbName ); } /// <summary> /// Returns the adapted path of the database directory. /// /// A "bibliobrol" directory in the user documents is used by default. /// If this BrolDev application is executed from a removable storage, /// the path is generated from the application path. /// </summary> public string getAdaptedDirectory() { if (string.Empty.Equals(dbPath)) { // The db file is in the data directory (user's documents dir or custom dir) return Config.DataDirectory; } else { // The db file is not in the general data directory return dbPath; } } #endregion } }
Structure et Fichiers du projet
Afficher/masquer...Icône | Nom | Taille | Modification |
Pas de sous-répertoires. | |||
Icône | Nom | Taille | Modification |
| _ | Répertoire parent | 0 octets | 1731760878 16/11/2024 13:41:18 |
Utilisation de l'explorateur de code
- Navigation :
- Un clic sur une icône de répertoire ouvre ce répertoire pour en afficher les fichiers.
- Lorsque le répertoire en cours ne contient pas de sous-répertoires il est possible de remonter vers le répertoire parent.
- La structure de répertoires en treetable (tableau en forme d'arborescence) n'est plus possibledans cette version.
- Un clic sur une icône de fichier ouvre ce fichier pour en afficher le code avec la coloration syntaxique adaptée en fonction du langage principal utilisé dans le fichier.
- Affichage :
- Il est possible de trier les répertoires ou les fichiers selon certains critères (nom, taille, date).
- Actions :
- Les actions possible sur les fichiers dépendent de vos droits d'utilisateur sur le site. Veuillez activer le mode utilisateur pour activer les actions.
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 16/10/2009, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/cs-bibliobrol-source-rf-model/dao/config/AccessConfig.cs.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.