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


C# ExceptionType类代码示例

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


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


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