本文整理汇总了C#中Error.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Error.ToString方法的具体用法?C# Error.ToString怎么用?C# Error.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Error
的用法示例。
在下文中一共展示了Error.ToString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeError
private static JToken SerializeError(Error error)
{
var result = new JObject();
result["$type"] = "error";
var value = new JObject();
value["message"] = error.ToString();
result["value"] = value;
return result;
}
示例2: Test_Error
public void Test_Error()
{
Error err = new Error(doc);
err.Message = "foo";
Assert.AreEqual("<stream:error " +
"xmlns:stream=\"http://etherx.jabber.org/streams\">foo</stream:error>", err.ToString());
ElementFactory sf = new ElementFactory();
sf.AddType(new fact());
XmlQualifiedName qname = new XmlQualifiedName(err.LocalName, err.NamespaceURI);
Element p = (Element) sf.GetElement(err.Prefix, qname, doc);
Assert.AreEqual(typeof(Error), p.GetType());
}
示例3: HandleError
public static void HandleError(Error e)
{
switch (e) {
case Error.NoError: return;
case Error.NoSuchFileOrDirectory: throw new FileNotFoundException ();
case Error.PermissionDenied: throw new AccessViolationException ();
default:
throw new Exception ("Error: " + e.ToString ());
}
}
示例4: OnLogin
//------------------------------
//ログイン時の処理.
//------------------------------
void OnLogin(Error error)
{
if (error == null)
{
//端末の回転を制御(縦持ちを許可する)/controll screen orientation in mobile
//if (!GameController.isIOS8) {
Screen.autorotateToPortrait = true;
Screen.autorotateToPortraitUpsideDown = true;
//}
//GUI表示/show GUI
FASGui.ShowGUI(FASGui.Mode.Forum | FASGui.Mode.Leaderboards | FASGui.Mode.MyProfile | FASGui.Mode.GroupMessage, FASGui.Mode.Forum);
}
else
{
Debug.LogError(error.ToString());
}
}
示例5: FormatError
public static string FormatError(Error e)
{
//return string.Format("Path:{0}, Row:{1}, Col:{2}\n{3}:{4}", e.Path, e.Row, e.Col, e.GetType().Name, e.Message);
return string.Format("Path:{0}, Row:{1}, Col:{2}\n{3}:{4}", e.Path, e.Row, e.Col, e.GetType().Name,
e.ToString().Replace(@"C:\Documents and Settings\user1\My Documents\Visual Studio 2005\Projects\Nana\","")
);
}
示例6: Error
public static void Error(string token, Error error, string text)
{
Console.WriteLine("Error " + error.ToString() + "on token \"" + token + "\": " + text);
}
示例7: FormatError
internal static string FormatError(Error code, int pos) {
return string.Format(SR.ErrorFormat, code.ToString(), pos, (int)code);
}
示例8: manageError
private void manageError(Error error)
{
if (error != null)
MessageBox.Show(error.ToString());
}
示例9: ThrowError
/// <summary>
/// Throw an error to the debugger.
/// </summary>
/// <param name="error">The <see cref="Error"/> to throw.</param>
/// <returns><c>true</c> if the debugger has handled the error, <c>false</c> to continue on if it was ignored.</returns>
public static bool ThrowError( Error error )
{
if( EnsureAttached( error.ToString() ) == false )
return false;
return Instance.Client.Handler.OnError( error );
}
示例10: ThrowOnFailure
//.........这里部分代码省略.........
case Error.FailsVerification:
break;
case Error.AddMethodNotImplemented:
break;
case Error.SchemaChangeNotImplemented:
break;
case Error.InvalidTypestate:
break;
case Error.HierarchyChangeNotImplemented:
break;
case Error.DeleteMethodNotImplemented:
break;
case Error.UnsupportedVersion:
break;
case Error.NamesDontMatch:
break;
case Error.ClassModifiersChangeNotImplemented:
break;
case Error.MethodModifiersChangeNotImplemented:
break;
case Error.NotImplemented:
break;
case Error.NullPointer:
break;
case Error.AbsentInformation:
throw new MissingInformationException();
case Error.InvalidEventType:
break;
case Error.IllegalArgument:
break;
case Error.OutOfMemory:
break;
case Error.AccessDenied:
break;
case Error.VmDead:
break;
case Error.Internal:
break;
case Error.UnattachedThread:
break;
case Error.InvalidTag:
break;
case Error.AlreadyInvoking:
break;
case Error.InvalidIndex:
break;
case Error.InvalidLength:
break;
case Error.InvalidString:
break;
case Error.InvalidClassLoader:
break;
case Error.InvalidArray:
break;
case Error.TransportLoad:
break;
case Error.TransportInit:
break;
case Error.NativeMethod:
break;
case Error.InvalidCount:
break;
default:
break;
}
throw new InternalException((int)error, error.ToString());
}