当前位置: 首页>>代码示例>>C#>>正文


C# ErrorType.ToString方法代码示例

本文整理汇总了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);
 }
开发者ID:paulbartrum,项目名称:jurassic,代码行数:15,代码来源:ErrorConstructor.cs

示例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);
        }
开发者ID:strager,项目名称:osq2osb,代码行数:8,代码来源:ErrorHandler.cs

示例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;
     //}
 }
开发者ID:kaiss78,项目名称:hustoes,代码行数:13,代码来源:ErrorControl.cs

示例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);
        }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:14,代码来源:ErrorHandler.cs

示例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;
        }
开发者ID:schiffchen,项目名称:windows-phone,代码行数:18,代码来源:XMPPMessage.cs

示例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));
 }
开发者ID:yjddd412213,项目名称:payment,代码行数:5,代码来源:ControllerBase.cs

示例7: sendAuthError

 private void sendAuthError(ErrorType errorType, AuthentificationException e)
 {
     Message reply = new Message(new Header("Server", MessageType.ERROR), errorType.ToString() + ";" + e.login);
     sendMessage(reply);
 }
开发者ID:Richti,项目名称:CSharp,代码行数:5,代码来源:ServerGestTopics.cs

示例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);
        }
开发者ID:Aragas,项目名称:Pokemon3D-1,代码行数:11,代码来源:ErrorHandler.cs

示例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);
 }
开发者ID:hwanyeh,项目名称:NWebGather,代码行数:4,代码来源:FrmGatherWorker.cs

示例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;
 }
开发者ID:paulbartrum,项目名称:jurassic,代码行数:16,代码来源:ErrorInstance.cs

示例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 { }
		}
开发者ID:DinrusGroup,项目名称:D-IDE,代码行数:17,代码来源:Util.cs


注:本文中的ErrorType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。