本文整理汇总了C#中ErrorCodes.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorCodes.ToString方法的具体用法?C# ErrorCodes.ToString怎么用?C# ErrorCodes.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorCodes
的用法示例。
在下文中一共展示了ErrorCodes.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SafeGetString
private static string SafeGetString(ErrorCodes id)
{
if (errorStrings.ContainsKey(id))
{
return errorStrings[id];
}
return id.ToString();
}
示例2: GetName
public static string GetName(ErrorCodes errorCode)
{
return errorCode.ToString();
}
示例3: InternalError
public InternalError(ErrorCodes code, string message)
{
Code = code.ToString();
Message = message;
Id = Guid.NewGuid();
}
示例4: GetErrorMessage
//===================================================================================================
/// <summary>
/// Gets the error message associated with the error code
/// </summary>
/// <param name="errorCode">the error code</param>
/// <returns>The error message</returns>
//===================================================================================================
public string GetErrorMessage(ErrorCodes errorCode)
{
Monitor.Enter(m_errorMessageLock);
Type type = typeof(ErrorMessages);
PropertyInfo pi = type.GetProperty(errorCode.ToString(), BindingFlags.Static | BindingFlags.Public);
string message;
if (null != pi)
{
message = pi.GetValue(null, null).ToString();
}
else
{
//System.Diagnostics.Debug.Assert(false, "Unidentified error");
message = String.Format("No text associated with error code {0}", errorCode);
}
Monitor.Exit(m_errorMessageLock);
return message;
}
示例5: _player_ConnectionEvent
private void _player_ConnectionEvent(object sender, bool state, ErrorCodes code)
{
if (!state)
{
_loginFailed = true;
Log.O("Connection Error: {0} - {1}", code.ToString(), Errors.GetErrorMessage(code));
_error = code;
ShowError();
}
else
{
this.BeginDispatch(() =>
{
_config.Fields.Login_Email = _player.Email;
_config.Fields.Login_Password = _player.Password;
//In case AudioFormat was changed because user does not have subscription
_config.Fields.Pandora_AudioFormat = _player.AudioFormat;
_config.SaveConfig();
});
}
}