本文整理汇总了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() + ")");
}
}
示例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;
}
示例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;
}
示例4: ErrorText
public static String ErrorText(ErrorCode errno)
{
return "Errno = " + errno.ToString();
}
示例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;
}
示例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);
}
示例7: GetDescription
public static LocalizableResourceString GetDescription(ErrorCode code)
{
return new LocalizableResourceString(code.ToString() + s_descriptionSuffix, ResourceManager, typeof(ErrorFacts));
}
示例8: GetMessageFormat
public static LocalizableResourceString GetMessageFormat(ErrorCode code)
{
return new LocalizableResourceString(code.ToString(), ResourceManager, typeof(ErrorFacts));
}
示例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);
}
示例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());
}
}
示例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());
}
}
示例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();
}
示例13: CustomerServiceException
public CustomerServiceException(ErrorCode e)
: base(e.ToString())
{
}
示例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.
}
示例15: Exception
public Exception(ErrorCode error)
: base(error.ToString())
{
}