Exemplo n.º 1
0
        public DatabaseAccessToken(DatabaseInterface databaseInterface, DatabaseAuthentication databaseAuthentication)
        {
            if (databaseInterface.DatabaseID != databaseAuthentication.DatabaseID)
            {
                throw new ArgumentException(String.Format(@"Database ID mismatch between interface '{0}' and authentication '{1}'.", databaseInterface.DatabaseID, databaseAuthentication.DatabaseID));
            }

            this.DatabaseID = databaseInterface.DatabaseID;
            this.Interface = databaseInterface;
            this.Authentication = databaseAuthentication;
        }
Exemplo n.º 2
0
        public static Dictionary<string, DatabaseInterface> LoadDatabaseInterfaces(string fileRootedPath)
        {
            DatabaseInterfacesListXmlType xmlInterfaces = XmlSerializer<DatabaseInterfacesListXmlType>.DeserializeFromRootedPath(fileRootedPath);

            Dictionary<string, DatabaseInterface> retValue = new Dictionary<string, DatabaseInterface>();
            foreach (DatabaseInterfaceXmlType xmlInterface in xmlInterfaces.DatabaseInterfaceDefinition)
            {
                DatabaseInterface curInterface = new DatabaseInterface(xmlInterface);
                retValue.Add(curInterface.DatabaseID, curInterface);
            }

            return retValue;
        }