• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ExceptionType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ExceptionType的典型用法代码示例。如果您正苦于以下问题:C# ExceptionType类的具体用法?C# ExceptionType怎么用?C# ExceptionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExceptionType类属于命名空间,在下文中一共展示了ExceptionType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ModbusException

 internal ModbusException(int DeviceAddress, FunctionCode FunctionCode, ExceptionType Type, string Comment = null)
 {
     this.Type = Type;  
     this.DeviceAddress = DeviceAddress;
     this.Code = FunctionCode;
     this.Comment = Comment;
 }
开发者ID:mrLunatic,项目名称:NET_Modbus,代码行数:7,代码来源:Exception.cs


示例2: ExceptionLogger

        // modloader errors can be constructed without parameters
        public ExceptionLogger()
        {
            this.version = ModLoader.getVersion();
            this.url = "http://mods.scrollsguide.com";

            this.type = ExceptionType.MODLOADER;
        }
开发者ID:svgorbunov,项目名称:ScrollsModLoader,代码行数:8,代码来源:ExceptionLogger.cs


示例3: Log

		public static Exception Log(Exception error, ExceptionType type, OutputHandler OutputCallback)
		{
			lock (Lock)
			{
				OutputHandler callback = new OutputHandler(delegate(Exception e, ExceptionType t) { });
				Errors.Add(new ExceptionItem(error, type));
				if (Output != null)
				{
					callback = Output;
				}
				if (OutputCallback != null)
				{
					callback = OutputCallback;
				}
				if (callback != null)
				{
					callback(error, type);
				}
				Logger.Log(">> Exception Detected >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
				//System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace();
				//for (int i = 0; i < st.FrameCount; i++)
				//{
				//    System.Diagnostics.StackFrame sf = st.GetFrame(i);
				//    Logger.Log(String.Format(">> File name:{0}\tLine:{1}\tColumn:{2}\tMethodName:{3} ", sf.GetFileName(), sf.GetFileLineNumber(), sf.GetFileColumnNumber(), sf.GetMethod().Name));
				//}
				Logger.Log(error.ToString());
			}
			return error;
		}
开发者ID:mind0n,项目名称:hive,代码行数:29,代码来源:Exceptions.cs


示例4: CustomException

 /// <summary>
 /// 
 /// </summary>
 /// <param name="exType">Type of ExceptionType.</param>
 /// <param name="message">The error message for this exception.</param>
 /// <param name="innerException">The inner exception that is wrapped in this exception.</param>
 public CustomException(ExceptionType exType, string message, System.Exception innerException)
     : base(message, innerException)
 {
     //this.CustomMessage = rm.GetString(exType.ToString());
     this.CustomMessage = ExpResources.ExpResources.ResourceManager.GetString(exType.ToString()) ?? "[[" + exType.ToString() + "]]";
     this.ExceptionType = exType.ToString();
 }
开发者ID:sbudihar,项目名称:SIRIUSrepo,代码行数:13,代码来源:CustomException.cs


示例5: EEPException

 /************************************************************************
  * type:        抛出的异常类型
  * sourceType:  抛出异常所在的类
  * sourceID:    抛出异常所在的控件ID,没有ID则为null
  * key:         参数的名称(参数错误)
  *              属性的名称(属性错误)
  *              方法的名称(方法错误)
  *              控件的类型名(控件错误)
  *              字段的名称(字段错误)
  * value:       参数的值(参数错误)
  *              属性的值(属性错误)
  *              null(方法错误)
  *              控件的ID(Component没有ID则为null)(控件错误)
  *              字段的值(字段错误)
 ************************************************************************/
 /// <summary>
 /// 
 /// </summary>
 /// <param name="type"></param>
 /// <param name="sourceType"></param>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <param name="controlID"></param>
 public EEPException(ExceptionType type, Type sourceType, string sourceID, string key, string value)
 {
     _type = type;
     _sourceType = sourceType;
     _sourceID = sourceID;
     _key = key;
     _value = value;
 }
开发者ID:san90279,项目名称:UK_OAS,代码行数:31,代码来源:EEPException.cs


示例6: StylesSheetException

 /// <summary>
 /// Initializes a new instance of the <see cref="T:StylesSheetException"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="controlName">Name of the control.</param>
 /// <param name="styleName">Name of the style.</param>
 public StylesSheetException(ExceptionType type, string styleName, string controlName, string propertyName, string propertyValue)
 {
     this.type = type;
     this.styleName = styleName;
     this.controlName = controlName;
     this.propertyName = propertyName;
     this.propertyValue = propertyValue;
 }
开发者ID:afvieira,项目名称:Repositorio_Windows,代码行数:14,代码来源:StylesSheetException.cs


示例7: EngineException

 public EngineException(ExceptionType type, string message, Token token)
 {
     Type = type;
     Message = message;
     Token = token;
     Line = token.Line;
     Position = token.Position;
 }
开发者ID:jonathanm,项目名称:CodeBox,代码行数:8,代码来源:EngineException.cs


示例8: CreateException

 internal static Exception CreateException(string res, string[] args, ExceptionType exceptionType, int lineNo, int linePos)
 {
     switch (exceptionType)
     {
         case ExceptionType.ArgumentException:
             return new ArgumentException(Res.GetString(res, args));
     }
     return new XmlException(res, args, lineNo, linePos);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:XmlConvert.cs


示例9: Read

        public static RemotingException Read(Serializer iprot)
        {
            string message = null;
            ExceptionType type = ExceptionType.Unknown;

            message = iprot.ReadString();
            type = (ExceptionType)iprot.ReadI32();

            return new RemotingException(type, message);
        }
开发者ID:FloodProject,项目名称:flood,代码行数:10,代码来源:RemotingException.cs


示例10: LogException

 public void LogException(Exception exception, HttpRequest httpRequest, ExceptionType exceptionType = ExceptionType.Handled)
 {
     if (exceptionType == ExceptionType.Unhandled)
     {
         Fatal(ExceptionToString(exception), exception, httpRequest);
     }
     else
     {
         Error(ExceptionToString(exception), exception, httpRequest);
     }
 }
开发者ID:RaringCoder,项目名称:Crucial-CQRS,代码行数:11,代码来源:Logger.cs


示例11: HotCitException

 public HotCitException(ExceptionType type, string msg = "")
 {
     switch (type) {
         case ExceptionType.BadAction: throw new BadActionException(msg);
         case ExceptionType.IllegalInput: throw new IllegalInputException(msg);
         case ExceptionType.IllegalState: throw new IllegalStateException(msg);
         case ExceptionType.Impossible: throw new ImpossibleException(msg);
         case ExceptionType.NotEnoughGold: throw new NotEnoughGoldException(msg);
         case ExceptionType.NotFound: throw new NotFoundException(msg);
         case ExceptionType.Timeout: throw new TimeoutException(msg);
     }
 }
开发者ID:afkpost,项目名称:HotCit,代码行数:12,代码来源:HotException.cs


示例12: Read

		public static TApplicationException Read(TProtocol iprot)
		{
			TField field;

			string message = null;
			ExceptionType type = ExceptionType.Unknown;

			iprot.ReadStructBegin();
			while (true)
			{
				field = iprot.ReadFieldBegin();
				if (field.Type == TType.Stop)
				{
					break;
				}

				switch (field.ID)
				{
					case 1:
						if (field.Type == TType.String)
						{
							message = iprot.ReadString();
						}
						else
						{
							TProtocolUtil.Skip(iprot, field.Type);
						}
						break;
					case 2:
						if (field.Type == TType.I32)
						{
							type = (ExceptionType)iprot.ReadI32();
						}
						else
						{
							TProtocolUtil.Skip(iprot, field.Type);
						}
						break;
					default:
						TProtocolUtil.Skip(iprot, field.Type);
						break;
				}

				iprot.ReadFieldEnd();
			}

			iprot.ReadStructEnd();

			return new TApplicationException(type, message);
		}
开发者ID:GDGroup,项目名称:thrift,代码行数:50,代码来源:TApplicationException.cs


示例13: SetMessageOnType

 private void SetMessageOnType(ExceptionType type, string message)
 {
     switch (type)
     {
         case ExceptionType.MethodChainingException:
             _template = "You can not chain these methods : {0}";
             break;
         case ExceptionType.ArgumentNotMatchException:
             _template = "argument not match : {0}";
             break;
         case ExceptionType.MemberSerializeException:
             _template = "the colum member can not be serialized to string: {0}";
             break;
         default:
             _template = "{0}";
             break;
     }
     _message = string.Format(_template, message);
 }
开发者ID:rhwy,项目名称:SampArch,代码行数:19,代码来源:FluentCsvException.cs


示例14: QStrategyException

        public QStrategyException(string message, Exception innerException, ExceptionType exceptionType, string sourceLocation)
            : base(message, innerException)
        {
            this.exceptionType = exceptionType;
            this.sourceLocation = sourceLocation;
            string messageDetail = message;
            message = exceptionType.ToString();
            if (innerException != null)
            {
                while (innerException.InnerException != null)
                {
                    innerException = innerException.InnerException;
                }
                message = innerException.Message;
                messageDetail = innerException.StackTrace;
            }

            string messageLog = string.Format("ExceptionType: {0}, Source:{1}, Exception:{2} MessageDetails: {3}", ExceptionType.ToString(), sourceLocation, message, messageDetail);
            LogUtil.WriteLog(LogLevel.ERROR, messageLog);
        }
开发者ID:EZXInc,项目名称:celera-gui,代码行数:20,代码来源:QStrategyException.cs


示例15: BroadcastExceptionNotification

        internal static void BroadcastExceptionNotification(ExceptionType type, int token)
        {
            switch (type)
            {
                case ExceptionType.StandardException:
                    {
                        BroadcastMessage("exception:id=1," + token);
                        break;
                    }

                case ExceptionType.FatalException:
                    {
                        BroadcastMessage("exception:id=2," + token);
                        break;
                    }

                case ExceptionType.SQLException:
                    {
                        BroadcastMessage("exception:id=3," + token);
                        break;
                    }

                case ExceptionType.ThreadedException:
                    {
                        BroadcastMessage("exception:id=4," + token);
                        break;
                    }

                case ExceptionType.UserException:
                    {
                        BroadcastMessage("exception:id=5," + token);
                        break;
                    }

                case ExceptionType.DDOSException:
                    {
                        BroadcastMessage("exception:id=6," + token);
                        break;
                    }
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:41,代码来源:Manager.cs


示例16: Exception

		internal Exception(Thread thread)
		{
			creationTime = DateTime.Now;
			this.process = thread.Process;
			this.thread = thread;
			corValue = thread.CorThread.CurrentException;
			exceptionType = thread.CurrentExceptionType;
			Value runtimeValue = new Value(process,
			                               new IExpirable[] {process.PauseSession},
			                               new IMutable[] {},
			                               delegate { return corValue; } );
			NamedValue nv = runtimeValue.GetMember("_message");
			if (!nv.IsNull)
			message = nv.AsString;
			else message = runtimeValue.Type.FullName;
			if (thread.LastFunctionWithLoadedSymbols != null) {
				location = thread.LastFunctionWithLoadedSymbols.NextStatement;
			}
			
			callstack = "";
			int callstackItems = 0;
			if (!nv.IsNull)
			foreach(Function function in thread.Callstack) {
				if (callstackItems >= 100) {
					callstack += "...\n";
					break;
				}
				
				SourcecodeSegment loc = function.NextStatement;
				callstack += function.Name + "()";
				if (loc != null) {
					callstack += " - " + loc.SourceFullFilename + ":" + loc.StartLine + "," + loc.StartColumn;
				}
				callstack += "\n";
				callstackItems++;
			}
			
			type = runtimeValue.Type.FullName;
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:39,代码来源:Exception.cs


示例17: GetString

        public static string GetString(ExceptionType exceptionType)
        {
            string lValue = string.Empty;

              switch(exceptionType)
              {
               case ExceptionType.ExistingVariableInCalcMemory:
                    lValue = "Variável '{0}' duplicada na memória de cálculo";
                    break;
               case ExceptionType.NumberOfAssigmentTokens:
                    lValue = "Número de símbolos de atribuição (=) inconsistente na expressão '{0}'";
                    break;
               case ExceptionType.VariableNotFoundInCalcMemory:
                    lValue = "Variável '{0}' não encontrada na memória de cálculo";
                    break;
              default:
                  lValue = "Exceção não definida";
                  break;
              }

              return lValue;
        }
开发者ID:jonimoreira,项目名称:TestTFS,代码行数:22,代码来源:InequationEngineException.cs


示例18: HandleException

        private static void HandleException(ExceptionType exceptionType, Exception exception, string source)
        {
            using (var eventLog = new EventLog())
            {
                if (!System.Diagnostics.EventLog.SourceExists(source))
                {
                    System.Diagnostics.EventLog.CreateEventSource(source, "Application");
                }
                eventLog.Source = source;
                eventLog.Log = "Application";

                StringBuilder message = new StringBuilder();
                message.AppendLine("A " + source + " " + exceptionType.ToString() + " occurred with the following details:");
                message.AppendLine();
                message.AppendLine(exception.Message);
                if (exception.InnerException != null)
                {
                    message.AppendLine();
                    message.AppendLine("InnerException:");
                    message.AppendLine(exception.InnerException.ToString());
                }
                message.AppendLine();
                message.AppendLine("StackTrace:");
                message.AppendLine(exception.StackTrace);

                eventLog.WriteEntry(message.ToString(), System.Diagnostics.EventLogEntryType.Error);

                StringBuilder returnMessage = new StringBuilder();
                returnMessage.AppendLine("Exception:");
                returnMessage.AppendLine(exception.Message);
                if (exception.InnerException != null)
                {
                    returnMessage.AppendLine();
                    returnMessage.AppendLine("Inner Exception:");
                    returnMessage.AppendLine(exception.InnerException.Message);
                }
            }
        }
开发者ID:crazycry0gen,项目名称:Aroma-Violet,代码行数:38,代码来源:ServiceHelpers.cs


示例19: ExceptionForm

        public ExceptionForm(ExceptionType type, string title, string message, string stackTrace, bool continueButton)
        {
            InitializeComponent();

            this.Text = title;
            this.exceptionMessage.Text = message;
            this.stackTrace.Text = stackTrace;

            if (type == ExceptionType.Unhandled)
            {
                if (continueButton == false)
                {
                    this.continueButton.Visible = false;
                    this.quitButton.Location = this.continueButton.Location;
                }

                this.label.Text = Localization.Text_UnhandledException;
            }
            else if (type == ExceptionType.Handled)
            {
                this.quitButton.Visible = false;
                this.label.Text = Localization.Text_HandledException;
            }
        }
开发者ID:123marvin123,项目名称:PawnPlus,代码行数:24,代码来源:ExceptionForm.cs


示例20: TriggerException

		void TriggerException(ExceptionType type)
		{
			if (type == ExceptionType.BRK)
				PC++;
			WriteMemory((ushort)(S-- + 0x100), (byte)(PC >> 8));
			WriteMemory((ushort)(S-- + 0x100), (byte)PC);
			FlagB = type == ExceptionType.BRK;
			WriteMemory((ushort)(S-- + 0x100), P);
			FlagI = true;
			switch (type)
			{
				case ExceptionType.NMI:
					PC = ReadWord(NMIVector);
					break;
				case ExceptionType.IRQ:
					PC = ReadWord(IRQVector);
					break;
				case ExceptionType.BRK:
					PC = ReadWord(BRKVector);
					break;
				default: throw new Exception();
			}
			PendingCycles -= 7;
		}
开发者ID:ddugovic,项目名称:RASuite,代码行数:24,代码来源:MOS6502.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ExceptionlessConfiguration类代码示例发布时间:2022-05-24
下一篇:
C# ExceptionHandler类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap