本文整理汇总了C#中IObjectContainer.Get方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectContainer.Get方法的具体用法?C# IObjectContainer.Get怎么用?C# IObjectContainer.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjectContainer
的用法示例。
在下文中一共展示了IObjectContainer.Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitConfig
public override void InitConfig()
{
try
{
db = Db4oFactory.OpenFile("openuser.yap");
IObjectSet result = db.Get(typeof(DbUserConfig));
if (result.Count == 1)
{
m_log.Info("[DBUSERCONFIG]: DbUserConfig.cs:InitConfig() - Found a UserConfig object in the local database, loading");
foreach (DbUserConfig cfg in result)
{
this.GridServerURL=cfg.GridServerURL;
this.GridSendKey=cfg.GridSendKey;
this.GridRecvKey=cfg.GridRecvKey;
this.DefaultStartupMsg=cfg.DefaultStartupMsg;
}
}
else
{
m_log.Info("[DBUSERCONFIG]: DbUserConfig.cs:InitConfig() - Could not find object in database, loading precompiled defaults");
LoadDefaults();
m_log.Info("[DBUSERCONFIG]: Writing out default settings to local database");
db.Set(this);
db.Close();
}
}
catch(Exception e)
{
m_log.Warn("DbUserConfig.cs:InitConfig() - Exception occured");
m_log.Warn(e.ToString());
}
m_log.Info("[DBUSERCONFIG]: User settings loaded:");
m_log.Info("[DBUSERCONFIG]: Default startup message: " + this.DefaultStartupMsg);
m_log.Info("[DBUSERCONFIG]: Grid server URL: " + this.GridServerURL);
m_log.Info("[DBUSERCONFIG]: Key to send to grid: " + this.GridSendKey);
m_log.Info("[DBUSERCONFIG]: Key to expect from grid: " + this.GridRecvKey);
}