本文整理汇总了C#中IObjectSpace.CreateNestedObjectSpace方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectSpace.CreateNestedObjectSpace方法的具体用法?C# IObjectSpace.CreateNestedObjectSpace怎么用?C# IObjectSpace.CreateNestedObjectSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjectSpace
的用法示例。
在下文中一共展示了IObjectSpace.CreateNestedObjectSpace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateListView
public ListView CreateListView(XafApplication application, IObjectSpace objectSpace, ISupportSequenceObject supportSequenceObject) {
var nestedObjectSpace = (XPNestedObjectSpace)objectSpace.CreateNestedObjectSpace();
var objectType = XafTypesInfo.Instance.FindBussinessObjectType<ISequenceReleasedObject>();
var collectionSource = application.CreateCollectionSource(nestedObjectSpace, objectType, application.FindListViewId(objectType));
collectionSource.Criteria["ShowReleasedSequences"] = CriteriaOperator.Parse("TypeName=?", supportSequenceObject.Prefix + supportSequenceObject.ClassInfo.FullName);
return application.CreateListView(nestedObjectSpace, objectType, true);
}
示例2: ImportObjects
int ImportObjects(XDocument document, IObjectSpace objectSpace) {
_objectSpace = objectSpace;
if (document.Root != null) {
foreach (XElement element in document.Root.Nodes().OfType<XElement>()) {
using (IObjectSpace nestedObjectSpace = objectSpace.CreateNestedObjectSpace()) {
ITypeInfo typeInfo = GetTypeInfo(element);
if (typeInfo != null) {
var keys = GetKeys(element);
CriteriaOperator objectKeyCriteria = GetObjectKeyCriteria(typeInfo, keys);
if (!ReferenceEquals(objectKeyCriteria, null)) {
CreateObject(element, nestedObjectSpace, typeInfo, objectKeyCriteria);
nestedObjectSpace.CommitChanges();
}
}
}
}
objectSpace.CommitChanges();
}
return 0;
}