本文整理汇总了C#中IExtObjectContainer.Deactivate方法的典型用法代码示例。如果您正苦于以下问题:C# IExtObjectContainer.Deactivate方法的具体用法?C# IExtObjectContainer.Deactivate怎么用?C# IExtObjectContainer.Deactivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExtObjectContainer
的用法示例。
在下文中一共展示了IExtObjectContainer.Deactivate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Conc
public virtual void Conc(IExtObjectContainer oc)
{
IQuery q = oc.Query();
q.Constrain(typeof(CascadeOnActivateTestCase.Item));
q.Descend("name").Constrain("1");
IObjectSet os = q.Execute();
CascadeOnActivateTestCase.Item item = (CascadeOnActivateTestCase.Item)os.Next();
CascadeOnActivateTestCase.Item item3 = item.child.child;
Assert.AreEqual("3", item3.name);
oc.Deactivate(item, int.MaxValue);
Assert.IsNull(item3.name);
oc.Activate(item, 1);
Assert.AreEqual("3", item3.name);
}
示例2: Conc
public virtual void Conc(IExtObjectContainer oc)
{
var q = oc.Query();
q.Constrain(typeof (Item));
q.Descend("name").Constrain("1");
var os = q.Execute();
var item = (Item) os.Next();
var item3 = item.child.child;
Assert.AreEqual("3", item3.name);
oc.Deactivate(item, int.MaxValue);
Assert.IsNull(item3.name);
oc.Activate(item, 1);
Assert.AreEqual("3", item3.name);
}
示例3: Conc
public virtual void Conc(IExtObjectContainer oc)
{
ExtMethodsTestCase em = new ExtMethodsTestCase();
oc.Store(em);
Assert.IsFalse(oc.IsClosed());
Assert.IsTrue(oc.IsActive(em));
Assert.IsTrue(oc.IsStored(em));
oc.Deactivate(em, 1);
Assert.IsTrue(!oc.IsActive(em));
oc.Activate(em, 1);
Assert.IsTrue(oc.IsActive(em));
long id = oc.GetID(em);
Assert.IsTrue(oc.IsCached(id));
oc.Purge(em);
Assert.IsFalse(oc.IsCached(id));
Assert.IsFalse(oc.IsStored(em));
Assert.IsFalse(oc.IsActive(em));
oc.Bind(em, id);
Assert.IsTrue(oc.IsCached(id));
Assert.IsTrue(oc.IsStored(em));
Assert.IsTrue(oc.IsActive(em));
ExtMethodsTestCase em2 = (ExtMethodsTestCase)oc.GetByID(id);
Assert.AreSame(em, em2);
// Purge all and try again
oc.Purge();
Assert.IsTrue(oc.IsCached(id));
Assert.IsTrue(oc.IsStored(em));
Assert.IsTrue(oc.IsActive(em));
em2 = (ExtMethodsTestCase)oc.GetByID(id);
Assert.AreSame(em, em2);
oc.Delete(em2);
oc.Commit();
Assert.IsFalse(oc.IsCached(id));
Assert.IsFalse(oc.IsStored(em2));
Assert.IsFalse(oc.IsActive(em2));
// Null checks
Assert.IsFalse(oc.IsStored(null));
Assert.IsFalse(oc.IsActive(null));
Assert.IsFalse(oc.IsCached(0));
}