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


C# ErrorCodes类代码示例

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


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

示例1: S2CRes

 public S2CRes(SerialFormat format, double execTime, ErrorCodes res, object objectToSerialize) 
     : this(format, execTime, res)
 {
     this.m_objectToSerialize = objectToSerialize;
     Data = objectToSerialize;
     ContentType = S2CContentType.Obj;
 }
开发者ID:modulexcite,项目名称:snip2codeNET,代码行数:7,代码来源:S2CRes.cs

示例2: CustomErrorActionResult

 public CustomErrorActionResult(HttpRequestMessage request, string message, ErrorCodes errorCode, HttpStatusCode status)
 {
     this.Request = request;
     this.Message = message;
     this.ErrorCode = errorCode;
     this.Status = status;
 }
开发者ID:os2indberetning,项目名称:os2_app_webapi,代码行数:7,代码来源:ErrorActionResult.cs

示例3: ThrowError

        public static void ThrowError(ErrorCodes code, params object[] args)
        {
            switch (code)
            {
                // <Native>
                case ErrorCodes.AlreadyLoaded:
                    throw new AlreadyLoadedException(code, args);
                case ErrorCodes.SteamInitializeFailed:
                    throw new SteamInitializeFailedException(code, args);
                case ErrorCodes.SteamInterfaceInitializeFailed:
                    throw new SteamInterfaceInitializeFailedException(code, args);
                // </Native>

                // <Managed>
                case ErrorCodes.InvalidInterfaceVersion:
                    throw new InvalidInterfaceVersionException(code, args);
                case ErrorCodes.UsageAfterAPIShutdown:
                    throw new UsageAfterAPIShutdownException(code, args);
                case ErrorCodes.CallbackStructSizeMissmatch:
                    throw new CallbackStructSizeMismatchException(code, args);
                // </Managed>
            }

            if (code >= ErrorCodes.StartOfNativeErrors && code <= ErrorCodes.EndOfNativeErrors)
            {
                throw new NativeException(code);
            }
            if (code >= ErrorCodes.StartOfManagedErrors && code <= ErrorCodes.EndOfManagedErrors)
            {
                throw new ManagedException(code);
            }
            throw new UnexpectedException(code);
        }
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:33,代码来源:Error.cs

示例4: Fail

        public Fail(ErrorCodes errorCode, string formatString, params object[] args)
        {
            if (formatString == null) throw new ArgumentNullException(nameof(formatString));

            ErrorCode = errorCode;
            ErrorMessage = string.Format(formatString, (object[])args);
        }
开发者ID:Sebastian-Gruchacz,项目名称:Flaksator,代码行数:7,代码来源:Fail.cs

示例5: TimeOutException

 protected TimeOutException(ErrorCodes code, string message, ConsistencyLevel consistencyLevel, int received, int blockFor)
         : base(code, message)
 {
     ConsistencyLevel = consistencyLevel;
     Received = received;
     BlockFor = blockFor;
 }
开发者ID:Jacky1,项目名称:cassandra-sharp,代码行数:7,代码来源:TimeOutException.cs

示例6: DaqException

 internal DaqException(string errorMessage, ErrorCodes errorCode)
     : base(errorMessage)
 {
     m_errorCode = errorCode;
     m_level = ErrorLevel.Error;
     m_lastResponse = null;
 }
开发者ID:hamishharvey,项目名称:daqflex,代码行数:7,代码来源:DaqException.cs

示例7: ReadScanData

        protected void ReadScanData(ErrorCodes errorCode, CallbackType callbackType, object callbackData)
        {
            int availableSamples = (int)callbackData;

            double[,] scanData;

            try
            {
                scanData = Device.ReadScanData(availableSamples, 0);

                int channels = scanData.GetLength(0);
                int samples = scanData.GetLength(1);

                DataDisplay = String.Empty;

                for (int i = 0; i < Math.Min(100, samples); i++)
                {
                    for (int j = 0; j < channels; j++)
                    {
                        DataDisplay += scanData[j, i].ToString("F03") + " ";
                    }

                    DataDisplay += Environment.NewLine;
                }

                ScanDataTextBox.Text = DataDisplay;
            }
            catch (Exception ex)
            {
                Stop = true;
                statusLabel.Text = ex.Message;
            }
        }
开发者ID:hamishharvey,项目名称:daqflex,代码行数:33,代码来源:AInScanForm.Common.cs

示例8: Error

		/// <summary>
		/// Prints the message and the stack trace of the exception on the standard
		/// error output stream.
		/// </summary>
		/// <param name="message">The error message.</param>
		/// <param name="e">The exception.</param>
		/// <param name="errorCode">The internal error code.</param>
		public void Error(string message, Exception e, ErrorCodes errorCode) 
		{ 
			if (m_firstTime) 
			{
				m_firstTime = false;
				LogLog.Error("[" + m_prefix + "] " + message, e);
			}
		}
开发者ID:WolfeReiter,项目名称:clamav-csharp-client,代码行数:15,代码来源:OnlyOnceErrorHandler.cs

示例9: SafeGetString

 private static string SafeGetString(ErrorCodes id)
 {
     if (errorStrings.ContainsKey(id))
     {
         return errorStrings[id];
     }
     return id.ToString();
 }
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:8,代码来源:StringMap.cs

示例10: ErrorData

 /// <summary>
 /// Initialises a new instance of the ErrorData class.
 /// </summary>
 /// <param name="errorCode">
 /// Error code. Must be defined in <see cref="ErrorCodes"/>.
 /// </param>
 public ErrorData(ushort errorCode)
 {
     if (!Enum.IsDefined(typeof(ErrorCodes), (int)errorCode))
     {
         throw new Exception("Invalid error code.");
     }
     ErrorCode = (ErrorCodes)errorCode;
 }
开发者ID:docmartini,项目名称:xIMUcppAPI,代码行数:14,代码来源:ErrorData.cs

示例11: ApiException

        public ApiException(ErrorCodes code, string message, string devMessage = null, HttpStatusCode statusCode = HttpStatusCode.InternalServerError, Exception innerException = null, string correlationId = null, object details = null)
            : base(string.Format("{0}. {1}", code, message), innerException)
        {
            FaultCode = code;
            StatusCode = statusCode;
            CorrelationId = correlationId ?? Guid.NewGuid().ToString("N");
            Details = details;

            DeveloperMessage = BuildDevMsg(InnerException, devMessage);
        }
开发者ID:rock-walker,项目名称:Eline,代码行数:10,代码来源:ApiException.cs

示例12: GetMessage

		internal static string GetMessage(ErrorCodes code)
		{
			switch (code)
			{
				case ErrorCodes.UserExist:
					return @"User with specified username already exist";
				case ErrorCodes.UsernameEmpty:
					return @"Empty username is not allowed";
			}

			return null;
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:12,代码来源:UsersException.cs

示例13: Main

        /// <summary>
        /// Main entry point for the application
        /// </summary>
        /// <param name="args">Commandline arguments. see /help for documentation</param>
        /// <returns>0 if sucseed, otherwise a value below 0. see error codes in documentation</returns>
        public static int Main(string[] args)
        {            
            ConsoleAdapter.TryAttach();
            int returnCode = 0;

            try
            {
                new ProgramHandler().DoApplication(args);
            }
            catch (RegAddinException exception)
            {
                new ExceptionPresenter().ShowError(exception);
                returnCode = exception.ReturnCode;
            }
            catch (UnauthorizedAccessException exception)
            {
                new ExceptionPresenter().ShowError(exception);
                returnCode = new ErrorCodes().SetLastError(exception).CodeFromName("UnauthorizedAccess");
            }
            catch (System.Security.SecurityException exception)
            {
                new ExceptionPresenter().ShowError(exception);
                returnCode = new ErrorCodes().SetLastError(exception).CodeFromName("MissingPermissions");
            }
            catch (Exception exception)
            {
                new ExceptionPresenter().ShowError(exception);
                returnCode = new ErrorCodes().SetLastError(exception).CodeFromName("UnexpectedError");
            }
            
            if (SingletonSettings.Alert == SingletonSettings.AlertMode.On || 
                SingletonSettings.Alert == SingletonSettings.AlertMode.Error && returnCode != 0)
            {
                if (returnCode == 0)
                    Alert.Window.ShowSucceedMessage();
                else
                    Alert.Window.ShowError(new ErrorCodes().MessageDetailsFromCode(returnCode));
            }
            
            return returnCode;
        }
开发者ID:netoffice,项目名称:NetOffice,代码行数:46,代码来源:Program.cs

示例14: _errorPage_ErrorClose

 private void _errorPage_ErrorClose(bool hardFail)
 {
     if (hardFail || _prevPage == null)
         Close();
     else
     {
         _lastError = ErrorCodes.SUCCESS;
         _lastException = null;
         RestorePrevPage();
         _showingError = false;
     }
 }
开发者ID:CristaliS,项目名称:Elpis,代码行数:12,代码来源:MainWindow.xaml.cs

示例15: ShowError

        private void ShowError(ErrorCodes code, Exception ex, bool showLast = false)
        {
            if (transitionControl.CurrentPage != _errorPage)
            {
                if(showLast && _lastError != ErrorCodes.SUCCESS)
                {
                    ShowErrorPage(_lastError, _lastException);
                }
                else if (code != ErrorCodes.SUCCESS && ex != null)
                {
                    if(Errors.IsHardFail(code))
                    {
                        ShowErrorPage(code, ex);
                    }
                    else
                    {
                        _lastError = code;
                        _lastException = ex;
                        mainBar.ShowError(Errors.GetErrorMessage(code));

                        if (transitionControl.CurrentPage == _loadingPage && !_lastFMAuth)
                        {
                            _loginPage.LoginFailed = true;
                            transitionControl.ShowPage(_loginPage);
                        }
                    }
                }
            }
        }
开发者ID:CristaliS,项目名称:Elpis,代码行数:29,代码来源:MainWindow.xaml.cs


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