本文整理汇总了C#中Name.HasSelf方法的典型用法代码示例。如果您正苦于以下问题:C# Name.HasSelf方法的具体用法?C# Name.HasSelf怎么用?C# Name.HasSelf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Name
的用法示例。
在下文中一共展示了Name.HasSelf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemovePropertyPerspective
private Name RemovePropertyPerspective(Name property, List<Name> ToMList)
{
var self = ToMList.Last();
if (self.IsUniversal && property.HasSelf())
throw new InvalidOperationException($"Cannot evaluate a property containing SELF in the Universal context of the {nameof(KB)}");
if (self == Name.SELF_SYMBOL)
self = Perspective;
var p = property.RemovePerspective(self);
return p;
}
示例2: SaveEventHelper
private BaseEvent SaveEventHelper(uint eventId, Name eventName, ulong timestamp)
{
AssertEventNameValidity(eventName);
if (eventName.HasSelf())
throw new Exception("Cannot record an event name containing \"Self\" keywords");
BaseEvent eventRecord;
if (ActionEvent.IsActionEvent(eventName))
{
eventRecord = new ActionEvent(eventId, eventName, timestamp);
}
else if (PropertyChangeEvent.IsPropertyChangeEvent(eventName))
{
eventRecord = new PropertyChangeEvent(eventId, eventName, timestamp);
}else
throw new Exception("Unknown Event Type");
AddRecord(eventRecord);
return eventRecord;
}