本文整理汇总了C#中IObjectContainer.Activate方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectContainer.Activate方法的具体用法?C# IObjectContainer.Activate怎么用?C# IObjectContainer.Activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjectContainer
的用法示例。
在下文中一共展示了IObjectContainer.Activate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActivateList
static void ActivateList(IObjectContainer db, IList list)
{
foreach (var obj in list)
{
db.Activate(obj, int.MaxValue);
}
}
示例2: RetrieveSnapshotsSequentiallyImproved
public static void RetrieveSnapshotsSequentiallyImproved(IObjectContainer db)
{
IObjectSet result = db.QueryByExample(typeof(Car));
Car car = (Car)result.Next();
SensorReadout readout = car.GetHistory();
while (readout != null)
{
db.Activate(readout, 1);
Console.WriteLine(readout);
readout = readout.Next;
}
}
示例3: AddFolderToDatabase
internal void AddFolderToDatabase(FavouriteFolder favFolder)
{
try
{
container = Db4oClient.RecentConn;
if (m_lstFavfolder != null)
{
FavouriteList favList = FetchAllFavouritesForAConnection();
if (favList == null)
{
favList = new FavouriteList(m_connParam);
List<FavouriteFolder> lstFavfolder = new List<FavouriteFolder>();
favList.m_TimeOfCreation = Sharpen.Runtime.CurrentTimeMillis();
lstFavfolder.Add(favFolder);
container.Store(favList);
container.Commit();
return;
}
container.Activate(favList, 5);
List<FavouriteFolder> lstFavFolder = favList.lstFavFolder;
bool check = false;
FavouriteFolder temp = null;
foreach (FavouriteFolder str in lstFavFolder)
{
if (str != null)
{
if (str.FolderName.Equals(favFolder.FolderName))
{
temp = str;
check = true;
break;
}
}
}
if (check == false)
{
lstFavFolder.Add(favFolder);
}
else
{
lstFavFolder.Remove(temp);
lstFavFolder.Add(favFolder);
container.Delete(temp);
}
favList.lstFavFolder = lstFavFolder;
container.Ext().Store(favList, 5);
container.Commit();
}
}
catch (Exception oEx)
{
LoggingHelper.HandleException(oEx);
}
}