Esempio n. 1
0
 public EnvConfig(String dbHome, bool useTempIfFault, BerkeleyDbEnvOpen openFlags, BerkeleyDbEnvClose closeFlags)
 {
     _dbHome         = dbHome;
     _useTempIfFault = useTempIfFault;
     _openFlags      = openFlags;
     _closeFlags     = closeFlags;
 }
Esempio n. 2
0
 public EnvConfig(String dbHome, bool useTempIfFault, BerkeleyDbEnvOpen openFlags, BerkeleyDbEnvClose closeFlags)
 {
     _dbHome = dbHome;
     _useTempIfFault = useTempIfFault;
     _openFlags = openFlags;
     _closeFlags = closeFlags;
 }
Esempio n. 3
0
        public static EnvConfig ReadXmlFile()
        {
            var      root  = XElement.Load("envconfig.xml");
            XElement xopen = root.Elements("open").Single();

            XElement xdbhome = xopen.Elements("dbhome").Single();
            bool     useTempIfFault;

            Boolean.TryParse(xdbhome.Attribute("useTempIfFault").Value, out useTempIfFault);

            BerkeleyDbEnvOpen openFlags = BerkeleyEnumParser.EnvOpenFlags(xopen.Element("flags").Value.Trim());

            XElement           xclose     = root.Elements("close").Single();
            BerkeleyDbEnvClose closeFlags = BerkeleyEnumParser.EnvCloseFlags(xclose.Element("flags").Value.Trim());

            return(new EnvConfig(xdbhome.Value.Trim(), useTempIfFault, openFlags, closeFlags));
        }
Esempio n. 4
0
        public static String ToStringEx(this BerkeleyDbEnvClose flags)
        {
            switch (flags)
            {
            case 0:
                return("0");

            case BerkeleyDbEnvClose.DB_FORCESYNC:
                return("db_forcesync");

            case BerkeleyDbEnvClose.DB_FORCESYNCENV:
                return("db_forcesyncenv");

            default:
                throw new ArgumentOutOfRangeException(flags.ToString());
            }
        }
Esempio n. 5
0
 public BerkeleyDbError Close(IntPtr pdbenv, BerkeleyDbEnvClose flag)
 {
     return((BerkeleyDbError)_close(pdbenv, (uint)flag));
 }
Esempio n. 6
0
 public BerkeleyDbError Close(IntPtr pdbenv, BerkeleyDbEnvClose flag)
 {
     return (BerkeleyDbError)_close(pdbenv, (uint)flag);
 }