本文整理汇总了C#中Symbol.Throw方法的典型用法代码示例。如果您正苦于以下问题:C# Symbol.Throw方法的具体用法?C# Symbol.Throw怎么用?C# Symbol.Throw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol.Throw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseAccess
private static MaxAccess ParseAccess(IEnumerator<Symbol> enumerator, ref Symbol temp)
{
MaxAccess access = MaxAccess.NotAccessible;
if (temp == Symbol.MaxAccess || temp == Symbol.Access)
{
temp = enumerator.NextNonEOLSymbol();
switch (temp.ToString())
{
case "not-accessible":
access = MaxAccess.NotAccessible;
break;
case "accessible-for-notify":
access = MaxAccess.AccessibleForNotify;
break;
case "read-only":
access = MaxAccess.ReadOnly;
break;
case "read-write":
access = MaxAccess.ReadWrite;
break;
case "read-create":
access = MaxAccess.ReadCreate;
break;
case "write-only":
access = MaxAccess.ReadWrite;
break;
default:
temp.Throw("Invalid access");
break;
}
}
else
{
temp.Throw("missing access");
}
temp = enumerator.NextNonEOLSymbol();
return access;
}
示例2: ParseStatus
private static Status ParseStatus(IEnumerator<Symbol> enumerator, ref Symbol temp)
{
Status status = Status.Obsolete;
temp.Expect(Symbol.Status);
temp = enumerator.NextNonEOLSymbol();
try
{
status = StatusHelper.CreateStatus(temp.ToString());
temp = enumerator.NextNonEOLSymbol();
}
catch (ArgumentException)
{
temp.Throw("Invalid status");
}
return status;
}