本文整理汇总了C#中ResultCode类的典型用法代码示例。如果您正苦于以下问题:C# ResultCode类的具体用法?C# ResultCode怎么用?C# ResultCode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResultCode类属于命名空间,在下文中一共展示了ResultCode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OAuthResult
/// <summary>
/// Constructor.
/// </summary>
/// <param name="result">the result code</param>
public OAuthResult(ResultCode result)
{
Error = null;
AuthResponse = null;
SessionToken = null;
Result = result;
}
示例2: GetMsg
static string GetMsg (ResultCode code)
{
switch (code) {
case ResultCode.Ok:
return "Success";
case ResultCode.Denied:
return "Access denied";
case ResultCode.NoKeyringDaemon:
return "The keyring daemon is not available";
case ResultCode.AlreadyUnlocked:
return "Keyring was already unlocked";
case ResultCode.NoSuchKeyring:
return "No such keyring";
case ResultCode.BadArguments:
return "Bad arguments";
case ResultCode.IOError:
return "I/O error";
case ResultCode.Cancelled:
return "Operation canceled";
case ResultCode.AlreadyExists:
return "Item already exists";
default:
return "Unknown error";
}
}
示例3: VlvResponseControl
internal VlvResponseControl(int targetPosition, int count, byte[] context, ResultCode result, bool criticality, byte[] value) : base("2.16.840.1.113730.3.4.10", value, criticality, true)
{
this.position = targetPosition;
this.count = count;
this.context = context;
this.result = result;
}
示例4: OAuthResult
/// <summary>
/// Constructor
/// </summary>
/// <param name="result">the result code</param>
/// <param name="exception">the error exception</param>
public OAuthResult(ResultCode result, Exception exception)
{
AuthResponse = null;
SessionToken = null;
Result = result;
Error = exception;
}
示例5: CreateBindResponse
/// <summary>
/// Creates a BindResponse for normal bindings and SASL bindings.
/// </summary>
/// <param name="context">The user context which contains message ID.</param>
/// <param name="resultCode">Result code of previous request, as specified in RFC 2251.</param>
/// <param name="matchedDn">Matched DN. Required, but can be an empty string.</param>
/// <param name="errorMessage">Error message for result code. Required.</param>
/// <param name="referral">Referral. Optional and for LDAP v3 only.</param>
/// <param name="serverCredentials">Server credentials, optional for normal bind.</param>
/// <returns>The packet that contains the response.</returns>
internal abstract AdtsBindResponsePacket CreateBindResponse(
AdtsLdapContext context,
ResultCode resultCode,
string matchedDn,
string errorMessage,
string[] referral,
byte[] serverCredentials);
示例6: IsResultCode
internal static bool IsResultCode(ResultCode code)
{
if ((code < ResultCode.Success) || (code > ResultCode.SaslBindInProgress))
{
if ((code >= ResultCode.NoSuchAttribute) && (code <= ResultCode.InvalidAttributeSyntax))
{
return true;
}
if ((code >= ResultCode.NoSuchObject) && (code <= ResultCode.InvalidDNSyntax))
{
return true;
}
if ((code >= ResultCode.InsufficientAccessRights) && (code <= ResultCode.LoopDetect))
{
return true;
}
if ((code >= ResultCode.NamingViolation) && (code <= ResultCode.AffectsMultipleDsas))
{
return true;
}
if ((((code != ResultCode.AliasDereferencingProblem) && (code != ResultCode.InappropriateAuthentication)) && ((code != ResultCode.SortControlMissing) && (code != ResultCode.OffsetRangeError))) && ((code != ResultCode.VirtualListViewError) && (code != ResultCode.Other)))
{
return false;
}
}
return true;
}
示例7: DatatypeR2FormatterGraphResult
/// <summary>
/// Datatype formatter graph result
/// </summary>
internal DatatypeR2FormatterGraphResult(ResultCode code, IResultDetail[] details, bool validateConformance) : this(validateConformance)
{
this.Code = code;
if (details != null)
this.m_details = new List<IResultDetail>(details);
else
this.m_details = new List<IResultDetail>(10);
}
示例8: RiakResult
/// <summary>
/// Initializes a new instance of the <see cref="RiakResult"/> class.
/// </summary>
/// <param name="resultCode">The <see cref="ResultCode"/>.</param>
/// <param name="exception">The <see cref="System.Exception"/>. Required.</param>
public RiakResult(ResultCode resultCode, Exception exception)
: this(false, resultCode, exception, null, false)
{
if (exception == null)
{
throw new ArgumentNullException("exception");
}
}
示例9: DirectoryResponse
internal DirectoryResponse(string dn, DirectoryControl[] controls, ResultCode result, string message, Uri[] referral)
{
this.dn = dn;
this.directoryControls = controls;
this.result = result;
this.directoryMessage = message;
this.directoryReferral = referral;
}
示例10: XmlIts1FormatterGraphResult
/// <summary>
/// Datatype formatter graph result
/// </summary>
internal XmlIts1FormatterGraphResult(ResultCode code, IResultDetail[] details)
{
this.Code = code;
if (details == null)
this.m_details = new List<IResultDetail>(10);
else
this.m_details = new List<IResultDetail>(details);
}
示例11: Error
public static RiakResult Error(ResultCode code, string message = null)
{
return new RiakResult
{
IsSuccess = false,
ResultCode = code,
ErrorMessage = message
};
}
示例12: VlvResponseControl
internal VlvResponseControl (int contentCount, byte [] contextId, ResultCode result, int targetPosition)
: base (null, null, false, true)
{
throw new NotImplementedException ("ctor-chain");
ContentCount = contentCount;
ContextId = contextId;
Result = result;
TargetPosition = targetPosition;
}
示例13: ADResponse
public ADResponse(string dn, DirectoryControl[] controls, ResultCode result, string message, Uri[] referral)
{
this._result = ResultCode.OperationsError | ResultCode.ProtocolError | ResultCode.TimeLimitExceeded | ResultCode.SizeLimitExceeded | ResultCode.CompareFalse | ResultCode.CompareTrue | ResultCode.AuthMethodNotSupported | ResultCode.StrongAuthRequired | ResultCode.ReferralV2 | ResultCode.Referral | ResultCode.AdminLimitExceeded | ResultCode.UnavailableCriticalExtension | ResultCode.ConfidentialityRequired | ResultCode.SaslBindInProgress | ResultCode.NoSuchAttribute | ResultCode.UndefinedAttributeType | ResultCode.InappropriateMatching | ResultCode.ConstraintViolation | ResultCode.AttributeOrValueExists | ResultCode.InvalidAttributeSyntax | ResultCode.NoSuchObject | ResultCode.AliasProblem | ResultCode.InvalidDNSyntax | ResultCode.AliasDereferencingProblem | ResultCode.InappropriateAuthentication | ResultCode.InsufficientAccessRights | ResultCode.Busy | ResultCode.Unavailable | ResultCode.UnwillingToPerform | ResultCode.LoopDetect | ResultCode.SortControlMissing | ResultCode.OffsetRangeError | ResultCode.NamingViolation | ResultCode.ObjectClassViolation | ResultCode.NotAllowedOnNonLeaf | ResultCode.NotAllowedOnRdn | ResultCode.EntryAlreadyExists | ResultCode.ObjectClassModificationsProhibited | ResultCode.ResultsTooLarge | ResultCode.AffectsMultipleDsas | ResultCode.VirtualListViewError | ResultCode.Other;
this._dn = dn;
this._controls = controls;
ADResponse.TransformControls(this._controls);
this._result = result;
this._message = message;
this._referral = referral;
}
示例14: Error
internal static RiakResult Error(ResultCode code, string message, bool nodeOffline)
{
return new RiakResult
{
IsSuccess = false,
ResultCode = code,
ErrorMessage = message,
NodeOffline = nodeOffline
};
}
示例15: RiakResult
protected RiakResult(bool isSuccess, ResultCode resultCode, Exception exception, string errorMessage)
{
this.isSuccess = isSuccess;
this.resultCode = resultCode;
this.exception = exception;
this.errorMessage = errorMessage;
if (string.IsNullOrWhiteSpace(this.errorMessage) &&
exception != null &&
!string.IsNullOrWhiteSpace(exception.Message))
{
this.errorMessage = exception.Message;
}
}