本文整理汇总了C#中Session.GetObjectType方法的典型用法代码示例。如果您正苦于以下问题:C# Session.GetObjectType方法的具体用法?C# Session.GetObjectType怎么用?C# Session.GetObjectType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session.GetObjectType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetClassTypeFilter
public static CriteriaOperator GetClassTypeFilter(this Type type, Session session) {
XPClassInfo xpClassInfo = session.GetClassInfo(type);
XPObjectType xpObjectType = session.GetObjectType(xpClassInfo);
return XPObject.Fields.ObjectType.IsNull() |
XPObject.Fields.ObjectType == new OperandValue(xpObjectType.Oid);
}
示例2: GetAuditTrail
XPBaseCollection GetAuditTrail(Session session, XPBaseObject xpBaseObject, Type auditedObjectWeakReferenceType) {
var binaryOperator = new BinaryOperator("TargetType", session.GetObjectType(xpBaseObject));
var operands = new BinaryOperator("TargetKey", XPWeakReference.KeyToString(session.GetKeyValue(xpBaseObject)));
var auditObjectWR = (XPWeakReference) session.FindObject(auditedObjectWeakReferenceType,new GroupOperator(binaryOperator,operands));
if (auditObjectWR != null) {
var baseCollection = (XPBaseCollection) auditObjectWR.ClassInfo.GetMember("AuditDataItems").GetValue(auditObjectWR);
baseCollection.BindingBehavior = CollectionBindingBehavior.AllowNone;
return baseCollection;
}
return null;
}
示例3: GetAuditTrail
public static XPCollection<XpandAuditDataItemPersistent> GetAuditTrail(Session session, object obj){
var auditObjectWr = session.FindObject<XpandAuditedObjectWeakReference>(
new GroupOperator(
new BinaryOperator("TargetType", session.GetObjectType(obj)),
new BinaryOperator("TargetKey", KeyToString(session.GetKeyValue(obj)))
));
if (auditObjectWr != null){
auditObjectWr.AuditDataItems.BindingBehavior = CollectionBindingBehavior.AllowNone;
return auditObjectWr.AuditDataItems;
}
return null;
}