//When Create(...) is used, we delay finding the enum value //until the enum value is needed, avoiding the string comparisons if possible void DetectScope() { if (RedirectionUtility.IsNamespaceMatch(this.Namespace, RedirectionConstants.Namespace)) { if (string.Equals(this.Value, RedirectionConstants.Scope.Message, StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Message; } else if (string.Equals(this.Value, RedirectionConstants.Scope.Session, StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Session; } else if (string.Equals(this.Value, RedirectionConstants.Scope.Endpoint, StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Endpoint; } else { this.internalScope = InternalRedirectionScope.Custom; } } else { this.internalScope = InternalRedirectionScope.Custom; } Fx.Assert(this.internalScope != InternalRedirectionScope.Unknown, "Failed to correctly detect internal redirection scope"); }
private void DetectScope() { if (RedirectionUtility.IsNamespaceMatch(this.Namespace, "http://schemas.microsoft.com/ws/2008/06/redirect")) { if (string.Equals(this.Value, "Message", StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Message; } else if (string.Equals(this.Value, "Session", StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Session; } else if (string.Equals(this.Value, "Endpoint", StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Endpoint; } else { this.internalScope = InternalRedirectionScope.Custom; } } else { this.internalScope = InternalRedirectionScope.Custom; } }
private RedirectionScope(InternalRedirectionScope scope) { this.Namespace = "http://schemas.microsoft.com/ws/2008/06/redirect"; this.internalScope = scope; switch (scope) { case InternalRedirectionScope.Message: this.Value = "Message"; return; case InternalRedirectionScope.Session: this.Value = "Session"; return; case InternalRedirectionScope.Endpoint: this.Value = "Endpoint"; return; } }
//should be used for known scopes only RedirectionScope(InternalRedirectionScope scope) { this.Namespace = RedirectionConstants.Namespace; this.internalScope = scope; switch (scope) { case InternalRedirectionScope.Message: this.Value = RedirectionConstants.Scope.Message; break; case InternalRedirectionScope.Session: this.Value = RedirectionConstants.Scope.Session; break; case InternalRedirectionScope.Endpoint: this.Value = RedirectionConstants.Scope.Endpoint; break; default: Fx.Assert("This constructor doesn't support the following enum value: " + scope); break; } }
//should be used for known scopes only RedirectionScope(InternalRedirectionScope scope) { this.Namespace = RedirectionConstants.Namespace; this.internalScope = scope; switch (scope) { case InternalRedirectionScope.Message: this.Value = RedirectionConstants.Scope.Message; break; case InternalRedirectionScope.Session: this.Value = RedirectionConstants.Scope.Session; break; case InternalRedirectionScope.Endpoint: this.Value = RedirectionConstants.Scope.Endpoint; break; default: Fx.Assert("This constructor doesn't support the following enum value: " + scope); break; } }
RedirectionScope(string value, string ns) { this.Value = value; this.Namespace = ns; this.internalScope = InternalRedirectionScope.Unknown; }
RedirectionScope(string value, string ns) { this.Value = value; this.Namespace = ns; this.internalScope = InternalRedirectionScope.Unknown; }
//When Create(...) is used, we delay finding the enum value //until the enum value is needed, avoiding the string comparisons if possible void DetectScope() { if (RedirectionUtility.IsNamespaceMatch(this.Namespace, RedirectionConstants.Namespace)) { if (string.Equals(this.Value, RedirectionConstants.Scope.Message, StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Message; } else if (string.Equals(this.Value, RedirectionConstants.Scope.Session, StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Session; } else if (string.Equals(this.Value, RedirectionConstants.Scope.Endpoint, StringComparison.Ordinal)) { this.internalScope = InternalRedirectionScope.Endpoint; } else { this.internalScope = InternalRedirectionScope.Custom; } } else { this.internalScope = InternalRedirectionScope.Custom; } Fx.Assert(this.internalScope != InternalRedirectionScope.Unknown, "Failed to correctly detect internal redirection scope"); }