本文整理汇总了C#中ErrorType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorType.ToString方法的具体用法?C# ErrorType.ToString怎么用?C# ErrorType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorType
的用法示例。
在下文中一共展示了ErrorType.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ErrorConstructor
// INITIALIZATION
//_________________________________________________________________________________________
/// <summary>
/// Creates a new derived error function.
/// </summary>
/// <param name="prototype"> The next object in the prototype chain. </param>
/// <param name="type"> The type of error, e.g. Error, RangeError, etc. </param>
internal ErrorConstructor(ObjectInstance prototype, ErrorType type)
: base(prototype, __STUB__Construct, __STUB__Call)
{
// Initialize the constructor properties.
var properties = new List<PropertyNameAndValue>(3);
InitializeConstructorProperties(properties, type.ToString(), 1, ErrorInstance.CreatePrototype(Engine, this, type));
FastSetProperties(properties);
}
示例2: Trigger
public void Trigger(ErrorType type, Location location, string message)
{
string locstring = location == null ? "" : " at " + location.ToString();
Console.WriteLine(type.ToString() + locstring + ": " + message);
fatalErrorOccured |= IsFatalError(type);
}
示例3: ShowError
public static void ShowError(ErrorType et)
{
MessageBox.Show(Type.GetType("OES.Error.ErrorTable").GetField(et.ToString()).GetValue(null).ToString());
//switch (et)
//{
// case ErrorType.LoginNoPersonError:
// MessageBox.Show(ErrorTable.LoginNoPersonError);
// break;
// case ErrorType.RARNotExist:
// MessageBox.Show(ErrorTable.RARNotExist);
// break;
//}
}
示例4: ThrowError
/// <summary>
/// Throws an error with the given <see cref="ErrorType"/> and error message.
/// </summary>
public SObject ThrowError(ErrorType errorType, string message, params object[] messageArgs)
{
var strErrorType = errorType.ToString();
var formattedMessage = string.Format(message, messageArgs);
var errorObject = _processor.Context.CreateInstance("Error", new SObject[] { _processor.CreateString(formattedMessage),
_processor.CreateString(errorType.ToString()),
_processor.CreateNumber(_processor.GetLineNumber()) });
return ThrowError(errorObject);
}
示例5: GetEnumDescription
public static string GetEnumDescription(ErrorType value)
{
Type type = typeof(ErrorType);
System.Reflection.FieldInfo [] fis = type.GetFields();
foreach(System.Reflection.FieldInfo fi in fis)
{
if (fi.Name == value.ToString())
{
XmlEnumAttribute[] attributes = (XmlEnumAttribute[]) fi.GetCustomAttributes(typeof(XmlEnumAttribute), false);
foreach (XmlEnumAttribute attr in attributes)
{
return attr.Name;
}
}
}
return null;
}
示例6: AddModelError
protected void AddModelError(ErrorType type, string msgFormat, params object[] obj)
{
string message = string.Format(msgFormat, obj);
ModelState.AddModelError(type.ToString(), string.Format("{0}, {1}", ErrorInfoHelper.Instance[type], message));
}
示例7: sendAuthError
private void sendAuthError(ErrorType errorType, AuthentificationException e)
{
Message reply = new Message(new Header("Server", MessageType.ERROR), errorType.ToString() + ";" + e.login);
sendMessage(reply);
}
示例8: ThrowError
/// <summary>
/// Throws an error with the given <see cref="ErrorType"/> and error message.
/// </summary>
public SObject ThrowError(ErrorType errorType, string message)
{
string strErrorType = errorType.ToString();
//TODO: Create error object here and put it as argument in the method call.
return ThrowError(null);
}
示例9: w_OnError
private void w_OnError(Exception ex, ErrorType errorType, string curUrl)
{
MessageBox.Show("采集发送错误,错误类型:" + errorType.ToString() + "详情:\n" + StringFormat.FormatExceptionString(ex), "网络采集器", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
示例10: CreatePrototype
/// <summary>
/// Creates the Error prototype object.
/// </summary>
/// <param name="engine"> The script environment. </param>
/// <param name="constructor"> A reference to the constructor that owns the prototype. </param>
/// <param name="type"> The type of error, e.g. Error, RangeError, etc. </param>
internal static ObjectInstance CreatePrototype(ScriptEngine engine, ErrorConstructor constructor, ErrorType type)
{
var result = CreateRawObject(GetPrototype(engine, type));
var properties = GetDeclarativeProperties(engine);
properties.Add(new PropertyNameAndValue("constructor", constructor, PropertyAttributes.NonEnumerable));
properties.Add(new PropertyNameAndValue("name", type.ToString(), PropertyAttributes.NonEnumerable));
properties.Add(new PropertyNameAndValue("message", string.Empty, PropertyAttributes.NonEnumerable));
result.FastSetProperties(properties);
return result;
}
示例11: OnLog
protected virtual void OnLog(string Message, ErrorType ErrorType, ErrorOrigin origin)
{
var icon = MessageBoxIcon.Error;
if (ErrorType==ErrorType.Warning)
icon = MessageBoxIcon.Warning;
else if (ErrorType==ErrorType.Information || ErrorType==ErrorType.Message)
icon = MessageBoxIcon.Information;
MessageBox.Show(Message,origin.ToString() +" "+ ErrorType.ToString(),MessageBoxButtons.OK,icon);
try
{
if (origin == ErrorOrigin.System)
File.AppendAllText(IDEInterface.ConfigDirectory + "\\sys.log", Message + "\r\n", System.Text.Encoding.Unicode);
}
catch { }
}