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


C# ErrorCode.ToString方法代码示例

本文整理汇总了C#中ErrorCode.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorCode.ToString方法的具体用法?C# ErrorCode.ToString怎么用?C# ErrorCode.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ErrorCode的用法示例。


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

示例1: CheckErr

 private void CheckErr(ErrorCode err, string name)
 {
     if (err != ErrorCode.Success)
         {
             Console.WriteLine("ERROR: " + name + " (" + err.ToString() + ")");
         }
 }
开发者ID:bitspill,项目名称:Gridcoin-master,代码行数:7,代码来源:gpu.cs

示例2: GetErrorCodeDescription

        public static ErrorCodeDescriptionAttribute GetErrorCodeDescription(ErrorCode errorCode)
        {
            if (DescriptionMap.ContainsKey(errorCode))
            {
                return DescriptionMap[errorCode];
            }

            FieldInfo provider = errorCode.GetType().GetField(errorCode.ToString());
            var attributes = (ErrorCodeDescriptionAttribute[])provider.GetCustomAttributes(typeof(ErrorCodeDescriptionAttribute), false);

            ErrorCodeDescriptionAttribute errorCodeDescription = attributes[0];

            DescriptionMap[errorCode] = errorCodeDescription;

            return errorCodeDescription;
        }
开发者ID:zhengw89,项目名称:CommonProcess,代码行数:16,代码来源:ErrorCodeExtension.cs

示例3: GetMessage

 public static string GetMessage(ErrorCode errorCode, object[] args)
 {
     string code = errorCode.ToString();
     string formatMessage = Messages.ResourceManager.GetString(code);
     if (string.IsNullOrWhiteSpace(formatMessage))
     {
         logger.TraceEvent(TraceEventType.Error, (int)ErrorCode.ErrorMessageNotFound, Messages.ErrorMessageNotFound, code);
         return string.Empty;
     }
     string errorMessage = GetMessage(formatMessage, args);
     if (errorCode != ErrorCode.Message) //смысла в указании этого кода ошибки нет
     {
         errorMessage = string.Format(EXCEPTION_MESSAGE_FORMAT, errorCode, errorMessage); 
     }
     return errorMessage;
 }
开发者ID:ManginAlexander,项目名称:mic.comQuestionary,代码行数:16,代码来源:ASOADException.cs

示例4: ErrorText

 public static String ErrorText(ErrorCode errno)
 {
     return "Errno = " + errno.ToString();
 }
开发者ID:kamlesh-patel,项目名称:netmq,代码行数:4,代码来源:ZMQ.cs

示例5: OnStopCalibrationCompleted

        private void OnStopCalibrationCompleted(ErrorCode errorCode)
        {
            Console.WriteLine("EyeTrackingEngine.OnStopCalibrationCompleted. errorCode: " + errorCode.ToString());

            _eyeTracker.GetCalibrationAsync(OnGetCalibrationCompleted);

            if (errorCode != ErrorCode.Success)
            {
                return;
            }

            //State = EyeTrackingState.Tracking;
        }
开发者ID:aclemotte,项目名称:LookAndPlay,代码行数:13,代码来源:EyeTrackingEngine.cs

示例6: OnComputeAndSetCalibrationCompleted

        private void OnComputeAndSetCalibrationCompleted(ErrorCode errorCode)
        {
            Console.WriteLine("EyeTrackingEngine.OnComputeAndSetCalibrationCompleted. errorCode: " + errorCode.ToString());

            if (errorCode != ErrorCode.Success)
            {
                if (errorCode == ErrorCode.FirmwareOperationFailed)
                {
                }

                //return;
            }

            if (onComputeandSetCalibrationCompletedEvent != null)
                onComputeandSetCalibrationCompletedEvent(this, EventArgs.Empty);

            _eyeTracker.StopCalibrationAsync(OnStopCalibrationCompleted);
        }
开发者ID:aclemotte,项目名称:LookAndPlay,代码行数:18,代码来源:EyeTrackingEngine.cs

示例7: GetDescription

 public static LocalizableResourceString GetDescription(ErrorCode code)
 {
     return new LocalizableResourceString(code.ToString() + s_descriptionSuffix, ResourceManager, typeof(ErrorFacts));
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:ErrorFacts.cs

示例8: GetMessageFormat

 public static LocalizableResourceString GetMessageFormat(ErrorCode code)
 {
     return new LocalizableResourceString(code.ToString(), ResourceManager, typeof(ErrorFacts));
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:ErrorFacts.cs

示例9: FormatMessage

        private static string FormatMessage(ErrorCode errorCode, string info)
        {
            switch (errorCode)
            {
                case ErrorCode.TooManyWarnings:
                    info = string.Format("There are more than {0} warnings", CodeGeneratorWarnings.MaximumWarningCount);
                    break;

                case ErrorCode.InvalidIncludeTemplateFormat:
                    info = "Include placeholders must have the following format: $NAME$(filename)";
                    break;

                case ErrorCode.InvalidIncludeTemplateFormatOpeningBracket:
                    info = string.Format("{0} is missing \"(\"", info);
                    break;

                case ErrorCode.InvalidIncludeTemplateFormatClosingBracket:
                    info = string.Format("{0} is missing \")\"", info);
                    break;
            }

            if (info == null || info == string.Empty)
                info = "No Info"; // should not occur

            return string.Format("OBLXE{0:d4}: {1}: {2}", (int)errorCode, errorCode.ToString(), info);
        }
开发者ID:re-motion,项目名称:Web-CodeGenerator,代码行数:26,代码来源:CodeGeneratorException.cs

示例10: CheckErrorAndLength

 private void CheckErrorAndLength(ErrorCode err, int len, int target_len)
 {
     if (err != ErrorCode.None)
     {
         throw new PTPException("could not read/write data: usb error = " + err.ToString());
     }
     else if (len != target_len)
     {
         throw new PTPException("could not read/write all data (" + len.ToString() + " bytes instead of " + target_len.ToString());
     }
 }
开发者ID:mweerden,项目名称:CHDKPTPRemote,代码行数:11,代码来源:PTPCommunication.cs

示例11: CheckError

 // TODO: add handler for USB errors to use them in the exceptions below
 private void CheckError(ErrorCode err)
 {
     if (err != ErrorCode.None)
     {
         throw new PTPException("could not read/write data: usb error = " + err.ToString());
     }
 }
开发者ID:mweerden,项目名称:CHDKPTPRemote,代码行数:8,代码来源:PTPCommunication.cs

示例12: InitOpenGL21

        private void InitOpenGL21()
        {
            //this.Context.SwapInterval = 1; // this prevents us using 100% GPU/CPU.
            GraphicsContext.CurrentContext.SwapInterval = 1; // this prevents us using 100% GPU/CPU
            Loaded = true;           // So we know we have a valid Loaded OpenGL context.

            m_eGLError = GL.GetError();
            if (m_eGLError != ErrorCode.NoError)
            {
#if LOG4NET_ENABLED
                logger.Info("OpenGL Pre State Config Error Check: " + m_eGLError.ToString());
#endif
            }
            //GL.ShadeModel(ShadingModel.Smooth);
            GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
            GL.ReadBuffer(ReadBufferMode.Back);
            GL.DrawBuffer(DrawBufferMode.Back);
            GL.DepthFunc(DepthFunction.Lequal);
            GL.DepthMask(true);
            GL.Disable(EnableCap.StencilTest);
            GL.StencilMask(0xFFFFFFFF);
            GL.StencilFunc(StencilFunction.Equal, 0x00000000, 0x00000001);
            GL.StencilOp(StencilOp.Keep, StencilOp.Keep, StencilOp.Keep);
            GL.FrontFace(FrontFaceDirection.Ccw);
            GL.CullFace(CullFaceMode.Back);
            GL.Enable(EnableCap.CullFace);
            GL.Enable(EnableCap.DepthTest);
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            GL.Enable(EnableCap.Blend);
            GL.ClearColor(System.Drawing.Color.MidnightBlue);
            GL.ClearDepth(1.0);
            GL.ClearStencil(0);
            GL.Enable(EnableCap.VertexArray);
            m_eGLError = GL.GetError();
            if (m_eGLError != ErrorCode.NoError)
            {
#if LOG4NET_ENABLED
                logger.Info("OpenGL Post State Config Error Check: " + m_eGLError.ToString());
#endif
            }

#if LOG4NET_ENABLED
            logger.Info("UI: GLCanvas2.X Loaded Successfully, Open GL Version: " + GL.GetString(StringName.Version));
            // Log out OpeGL specific stuff if debug build.
            logger.Info("UI: GLSL Version: " + GL.GetString(StringName.ShadingLanguageVersion));
            logger.Info("UI: Renderer: " + GL.GetString(StringName.Renderer));
            logger.Info("UI: Vender: " + GL.GetString(StringName.Vendor));
            logger.Info("UI: Extensions: " + GL.GetString(StringName.Extensions));
#endif
            m_eGLError = GL.GetError();
            if (m_eGLError != ErrorCode.NoError)
            {
#if LOG4NET_ENABLED
                logger.Info("OpenGL Error Check, InvalidEnum or NoError Expected: " + m_eGLError.ToString());
#endif
            }

            m_oEffect = new GLUtilities.GLEffectBasic21("./Resources/Shaders/Basic20_Vertex_Shader.glsl", "./Resources/Shaders/Basic20_Fragment_Shader.glsl");

            // Setup Our View Port, this sets Our Projection and View Matricies.
            SetupViewPort(0, 0, this.Size.Width, this.Size.Height);

            m_oSW.Start();
        }
开发者ID:EterniaLogic,项目名称:Pulsar4x,代码行数:64,代码来源:GLCanvas.cs

示例13: CustomerServiceException

 public CustomerServiceException(ErrorCode e)
     : base(e.ToString())
 {
 }
开发者ID:esegura,项目名称:CustomerManagement,代码行数:4,代码来源:CustomerServiceException.cs

示例14: CheckErr

 private void CheckErr(ErrorCode err, string name)
 {
     if (err != ErrorCode.Success)
     {
         Console.WriteLine("error: " + name + " (" + err.ToString() + ")");
         Console.WriteLine("error: " + name + " (" + err + ")");
         using (StreamWriter sw = File.AppendText(debugLog))
         {
             sw.WriteLine("error: " + name + " (" + err + ")");
         }
     }
     //Guid id;
     //id.
 }
开发者ID:Schw1ng,项目名称:GPGPUThings,代码行数:14,代码来源:GPURadixSort.cs

示例15: Exception

 public Exception(ErrorCode error)
     : base(error.ToString())
 {
 }
开发者ID:cephdon,项目名称:gpudotnet,代码行数:4,代码来源:Cl.Types.cs


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