本文整理汇总了C#中TOKEN类的典型用法代码示例。如果您正苦于以下问题:C# TOKEN类的具体用法?C# TOKEN怎么用?C# TOKEN使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TOKEN类属于命名空间,在下文中一共展示了TOKEN类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddNewTokenToDatabase
public string AddNewTokenToDatabase(TOKEN token)
{
_tokens.InsertOnSubmit(token);
try
{
_dataContext.SubmitChanges();
}
catch (Exception ex)
{
_log.Error(ex.Message);
return "Token has not been generated";
}
return token.UserToken;
}
示例2: ParseByToken
object ParseByToken(TOKEN token) {
switch (token) {
case TOKEN.STRING:
return ParseString();
case TOKEN.NUMBER:
return ParseNumber();
case TOKEN.CURLY_OPEN:
return ParseObject();
case TOKEN.SQUARED_OPEN:
return ParseArray();
case TOKEN.TRUE:
return true;
case TOKEN.FALSE:
return false;
case TOKEN.NULL:
return null;
default:
return null;
}
}
示例3: OpenProcessToken
public static extern bool OpenProcessToken(IntPtr ProcessHandle, TOKEN DesiredAccess, out IntPtr TokenHandle);
示例4: RemoveTokenFromDatabase
public void RemoveTokenFromDatabase(TOKEN tokenToRemove)
{
System.Diagnostics.Contracts.Contract.Requires(tokenToRemove != null);
}
示例5: AddNewTokenToDatabase
public string AddNewTokenToDatabase(TOKEN token)
{
System.Diagnostics.Contracts.Contract.Requires(token != null);
return System.Diagnostics.Contracts.Contract.Result<string>();
}
示例6: Expect
private void Expect(TOKEN token)
{
if (PeekNextToken() != token) throw new InvalidDataException(token + " expected");
index++; //move index
}
示例7: ParseByToken
object ParseByToken(TOKEN token)
{
switch (token)
{
case TOKEN.STRING:
{
return ParseString();
}
case TOKEN.NUMBER:
{
return ParseNumber();
}
case TOKEN.CURLY_OPEN:
{
return ParseObject();
}
case TOKEN.SQUARED_OPEN:
{
return ParseArray();
}
case TOKEN.TRUE:
{
return true;
}
case TOKEN.FALSE:
{
return false;
}
case TOKEN.NULL:
{
return null;
}
case TOKEN.NONE:
{
TOKEN nextToken =NextToken;
return ParseByToken(nextToken);
}
default:
{
return null;
}
}
}
示例8: ParseByTokenAsync
IEnumerator ParseByTokenAsync(TOKEN token)
{
switch (token) {
case TOKEN.STRING:
yield return ParseString();
yield break;
case TOKEN.NUMBER:
yield return ParseNumber();
yield break;
case TOKEN.CURLY_OPEN: {
IEnumerator e = ParseObjectAsync();
while( e.MoveNext() ) {
yield return null;
}
yield return e.Current;
yield break;
}
case TOKEN.SQUARED_OPEN:
yield return ParseArray();
yield break;
case TOKEN.TRUE:
yield return true;
yield break;
case TOKEN.FALSE:
yield return false;
yield break;
case TOKEN.NULL:
yield break;
default:
yield break;
}
}
示例9: RemoveTokenFromDatabase
public void RemoveTokenFromDatabase(TOKEN tokenToRemove)
{
_tokens.DeleteOnSubmit(tokenToRemove);
try
{
_dataContext.SubmitChanges();
}
catch (Exception ex)
{
_log.Error(ex.Message);
}
}