本文整理汇总了C#中IObjectSpace.GetObjectKey方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectSpace.GetObjectKey方法的具体用法?C# IObjectSpace.GetObjectKey怎么用?C# IObjectSpace.GetObjectKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjectSpace
的用法示例。
在下文中一共展示了IObjectSpace.GetObjectKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetObjectKey
object GetObjectKey(IObjectSpace objectSpace, Type type, ViewShortcut shortcut) {
object objectKey = null;
if (string.IsNullOrEmpty(shortcut.ObjectKey))
return null;
try {
objectKey = objectSpace.GetObjectKey(type, shortcut.ObjectKey);
} catch {
}
return objectKey;
}
示例2: GetObjectKeyCore
object GetObjectKeyCore(IObjectSpace objectSpace, Type type, string objectKeyString) {
if (objectKeyString.CanChange(((XPObjectSpace) objectSpace).GetObjectKeyType(type))) {
try {
return objectSpace.GetObjectKey(type, objectKeyString);
} catch {
}
}
var criteriaOperator = CriteriaOperator.TryParse(objectKeyString);
if (!ReferenceEquals(criteriaOperator , null))
return criteriaOperator;
throw new ArgumentException(objectKeyString, "objectKeyString");
}
示例3: ProcessDeletedObjects
protected virtual void ProcessDeletedObjects(IObjectSpace objectSpace, ICollection deletedObjects)
{
HistoryItem<ViewShortcut> currentItem = navigationHistory.CurrentPosition;
if (IsNavigationAllowed())
{
foreach (Object obj in deletedObjects)
{
for (int i = navigationHistory.Count - 1; i > -1; i--)
{
navigationHistory.CurrentPositionIndex = i;
ViewShortcut itemShortcut = navigationHistory.CurrentPosition.Item;
if (!string.IsNullOrEmpty(itemShortcut.ObjectKey))
{
Object objectKey = objectSpace.GetObjectKey(itemShortcut.ObjectClass, itemShortcut.ObjectKey);
ITypeInfo typeInfo = XafTypesInfo.Instance.FindTypeInfo(obj.GetType());
if ((itemShortcut.ObjectClass == typeInfo.Type) &&
(itemShortcut.ObjectKey != null) &&
objectKey.Equals(objectSpace.GetKeyValue(obj)))
{
RemoveShortcutFromStack(navigationHistory.CurrentPosition.Item);
navigationHistory.DeleteCurrentItem();
}
}
}
}
}
if (navigationHistory.IndexOf(currentItem.Item) != -1)
{
navigationHistory.SetCurrentPosition(currentItem.Item);
}
else
{
navigationHistory.CurrentPositionIndex = navigationHistory.Count - 1;
}
}