当前位置: 首页>>代码示例>>C#>>正文


C# IObjectContainer.Set方法代码示例

本文整理汇总了C#中IObjectContainer.Set方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectContainer.Set方法的具体用法?C# IObjectContainer.Set怎么用?C# IObjectContainer.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IObjectContainer的用法示例。


在下文中一共展示了IObjectContainer.Set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

		public void SetUp()
		{
			_filePath = Path.GetTempFileName();
			//Db4objects.Db4o.Config.IConfiguration db4oConfiguration = Db4oFactory.Configure();
			//Db4objects.Db4o.Config.IObjectClass objectClass = db4oConfiguration.ObjectClass(typeof(LanguageForm));
			// objectClass.ObjectField("_writingSystemId").Indexed(true);
			// objectClass.ObjectField("_form").Indexed(true);

			_db = Db4oFactory.OpenFile(_filePath);
			((YapStream) _db).GetNativeQueryHandler().QueryOptimizationFailure +=
					OnQueryOptimizationFailure;

			for (int i = 0;i < 10000;i++)
			{
				Entry e = new Entry();
				e.name = new MultiText();
				e.name._forms[0] = new LanguageForm("en", "en-" + i);
				//e.name._forms[1] = new LanguageForm("fr", "fr-"+i);
				e.name._singleForm = new LanguageForm("en", i.ToString());
				_db.Set(e);
			}

			_db.Commit();
			_db.Dispose();
			_db = Db4oFactory.OpenFile(_filePath);
		}
开发者ID:bbriggs,项目名称:wesay,代码行数:26,代码来源:Db4oQueryPerformance.cs

示例2: 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);
        }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:38,代码来源:DbUserConfig.cs


注:本文中的IObjectContainer.Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。