예제 #1
0
        public static BDbOffsetOf ReadXmlFile()
        {
            var      root     = XElement.Load("offsetof.xml");
            String   version  = root.Elements("current").Single().Attribute("version").Value;
            XElement xversion = root.Elements(version).Single();

            BDbOffsetOfCollection db    = GetOffsetOfList(xversion, "db");
            BDbOffsetOfCollection dbc   = GetOffsetOfList(xversion, "dbc");
            BDbOffsetOfCollection dbenv = GetOffsetOfList(xversion, "dbenv");

            return(new BDbOffsetOf(db, dbc, dbenv));
        }
예제 #2
0
        private BDbenvMethods(IntPtr pdbenv, BDbOffsetOfCollection offsetOfs)
        {
            foreach (BDbOffsetOfItem offsetOfItem in offsetOfs)
            {
                IntPtr funcptr = Marshal.ReadIntPtr(pdbenv + offsetOfItem.Offset);
                switch (offsetOfItem.Name)
                {
                case "close":
                    _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                    break;

                case "open":
                    _open = (open)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(open));
                    break;
                }
            }
        }
예제 #3
0
 public BDbOffsetOf(BDbOffsetOfCollection db, BDbOffsetOfCollection dbc, BDbOffsetOfCollection dbenv)
 {
     _db    = db;
     _dbc   = dbc;
     _dbenv = dbenv;
 }