Esempio n. 1
0
        //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");
        }
Esempio n. 2
0
 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;
     }
 }
Esempio n. 3
0
        //When Create(...) is used, we delay finding the enum value
        //until the enum value is needed, avoiding the string comparisons if possible
        void DetectType()
        {
            if (RedirectionUtility.IsNamespaceMatch(this.Namespace, RedirectionConstants.Namespace))
            {
                if (string.Equals(this.Value, RedirectionConstants.Type.Cache, StringComparison.Ordinal))
                {
                    this.internalType = InternalRedirectionType.Cache;
                }
                else if (string.Equals(this.Value, RedirectionConstants.Type.Resource, StringComparison.Ordinal))
                {
                    this.internalType = InternalRedirectionType.Resource;
                }
                else if (string.Equals(this.Value, RedirectionConstants.Type.UseIntermediary, StringComparison.Ordinal))
                {
                    this.internalType = InternalRedirectionType.UseIntermediary;
                }
                else
                {
                    this.internalType = InternalRedirectionType.Custom;
                }
            }
            else
            {
                this.internalType = InternalRedirectionType.Custom;
            }

            Fx.Assert(this.internalType != InternalRedirectionType.Unknown, "Failed to correctly detect internal redirection type");
        }
Esempio n. 4
0
 private void DetectType()
 {
     if (RedirectionUtility.IsNamespaceMatch(this.Namespace, "http://schemas.microsoft.com/ws/2008/06/redirect"))
     {
         if (string.Equals(this.Value, "Cache", StringComparison.Ordinal))
         {
             this.internalType = InternalRedirectionType.Cache;
         }
         else if (string.Equals(this.Value, "Resource", StringComparison.Ordinal))
         {
             this.internalType = InternalRedirectionType.Resource;
         }
         else if (string.Equals(this.Value, "UseIntermediary", StringComparison.Ordinal))
         {
             this.internalType = InternalRedirectionType.UseIntermediary;
         }
         else
         {
             this.internalType = InternalRedirectionType.Custom;
         }
     }
     else
     {
         this.internalType = InternalRedirectionType.Custom;
     }
 }
 private void DetectDuration()
 {
     if (RedirectionUtility.IsNamespaceMatch(this.Namespace, "http://schemas.microsoft.com/ws/2008/06/redirect"))
     {
         if (string.Equals(this.Value, "Temporary", StringComparison.Ordinal))
         {
             this.internalDuration = InternalRedirectionDuration.Temporary;
         }
         else if (string.Equals(this.Value, "Permanent", StringComparison.Ordinal))
         {
             this.internalDuration = InternalRedirectionDuration.Permanent;
         }
         else
         {
             this.internalDuration = InternalRedirectionDuration.Custom;
         }
     }
     else
     {
         this.internalDuration = InternalRedirectionDuration.Custom;
     }
 }
Esempio n. 6
0
        //When Create(...) is used, we delay finding the enum value
        //until the enum value is needed, avoiding the string comparisons if possible
        void DetectDuration()
        {
            if (RedirectionUtility.IsNamespaceMatch(this.Namespace, RedirectionConstants.Namespace))
            {
                if (string.Equals(this.Value, RedirectionConstants.Duration.Temporary, StringComparison.Ordinal))
                {
                    this.internalDuration = InternalRedirectionDuration.Temporary;
                }
                else if (string.Equals(this.Value, RedirectionConstants.Duration.Permanent, StringComparison.Ordinal))
                {
                    this.internalDuration = InternalRedirectionDuration.Permanent;
                }
                else
                {
                    this.internalDuration = InternalRedirectionDuration.Custom;
                }
            }
            else
            {
                this.internalDuration = InternalRedirectionDuration.Custom;
            }

            Fx.Assert(this.internalDuration != InternalRedirectionDuration.Unknown, "Failed to correctly detect internal redirection duration");
        }