internal override void UpdateForVersion(ApiVersion version, EntityDescription existingDescription = null)
 {
     base.UpdateForVersion(version, existingDescription);
     if (!this.InternalListenerType.HasValue && this.InternalRelayType.HasValue)
     {
         this.InternalListenerType = new Microsoft.ServiceBus.ListenerType?(RelayDescription.MapRelayTypeToListenerType(this.InternalRelayType));
     }
     if (version < ApiVersion.Eight)
     {
         this.InternalUserMetadata = null;
     }
     if (version >= ApiVersion.Five)
     {
         if (!this.InternalRelayType.HasValue && this.InternalListenerType.HasValue)
         {
             this.InternalRelayType = new Microsoft.ServiceBus.RelayType?(RelayDescription.MapListenerTypeToRelayType(this.InternalListenerType));
         }
         return;
     }
     this.InternalRelayType = null;
     this.InternalRequiresClientAuthorization = null;
     this.InternalRequiresTransportSecurity   = null;
     this.InternalPublishToRegistry           = null;
     this.InternalAuthorization = null;
     this.InternalIsDynamic     = null;
 }
 internal override void UpdateForVersion(ApiVersion version, EntityDescription existingDescription = null)
 {
     base.UpdateForVersion(version, existingDescription);
 }
        internal override void UpdateForVersion(ApiVersion version, EntityDescription existingDescription = null)
        {
            string internalForwardDeadLetteredMessagesTo;
            bool?  internalEnableExpress;
            bool?  internalEnablePartitioning;
            bool?  internalIsExpress;
            EntityAvailabilityStatus?internalAvailabilityStatus;
            TimeSpan?          internalAutoDeleteOnIdle;
            AuthorizationRules authorization;
            AuthorizationRules internalAuthorization;
            bool?        internalIsAnonymousAccessible;
            EntityStatus?internalStatus;
            string       internalForwardTo;
            DateTime?    internalCreatedAt;
            DateTime?    internalUpdatedAt;
            DateTime?    internalAccessedAt;
            string       internalUserMetadata;
            bool?        internalSupportOrdering;

            Microsoft.ServiceBus.Messaging.MessageCountDetails internalMessageCountDetails;
            QueueDescription queueDescription = existingDescription as QueueDescription;

            base.UpdateForVersion(version, existingDescription);
            bool flag = false;

            if (version < ApiVersion.Two)
            {
                if (queueDescription == null)
                {
                    internalAuthorization = null;
                }
                else
                {
                    internalAuthorization = queueDescription.InternalAuthorization;
                }
                this.InternalAuthorization = internalAuthorization;
                flag = true;
                if (queueDescription == null)
                {
                    internalIsAnonymousAccessible = null;
                }
                else
                {
                    internalIsAnonymousAccessible = queueDescription.InternalIsAnonymousAccessible;
                }
                this.InternalIsAnonymousAccessible = internalIsAnonymousAccessible;
                if (queueDescription == null)
                {
                    internalStatus = null;
                }
                else
                {
                    internalStatus = queueDescription.InternalStatus;
                }
                this.InternalStatus = internalStatus;
                if (queueDescription == null)
                {
                    internalForwardTo = null;
                }
                else
                {
                    internalForwardTo = queueDescription.InternalForwardTo;
                }
                this.InternalForwardTo = internalForwardTo;
                if (queueDescription == null)
                {
                    internalCreatedAt = null;
                }
                else
                {
                    internalCreatedAt = queueDescription.InternalCreatedAt;
                }
                this.InternalCreatedAt = internalCreatedAt;
                if (queueDescription == null)
                {
                    internalUpdatedAt = null;
                }
                else
                {
                    internalUpdatedAt = queueDescription.InternalUpdatedAt;
                }
                this.InternalUpdatedAt = internalUpdatedAt;
                if (queueDescription == null)
                {
                    internalAccessedAt = null;
                }
                else
                {
                    internalAccessedAt = queueDescription.InternalAccessedAt;
                }
                this.InternalAccessedAt = internalAccessedAt;
                if (queueDescription == null)
                {
                    internalUserMetadata = null;
                }
                else
                {
                    internalUserMetadata = queueDescription.InternalUserMetadata;
                }
                this.InternalUserMetadata = internalUserMetadata;
                if (queueDescription == null)
                {
                    internalSupportOrdering = null;
                }
                else
                {
                    internalSupportOrdering = queueDescription.InternalSupportOrdering;
                }
                this.InternalSupportOrdering = internalSupportOrdering;
                if (queueDescription == null)
                {
                    internalMessageCountDetails = null;
                }
                else
                {
                    internalMessageCountDetails = queueDescription.InternalMessageCountDetails;
                }
                this.InternalMessageCountDetails = internalMessageCountDetails;
            }
            if (version < ApiVersion.Three)
            {
                if (this.InternalAuthorization != null && !flag)
                {
                    AuthorizationRules authorizationRules = this.InternalAuthorization;
                    ApiVersion         apiVersion         = version;
                    if (queueDescription == null)
                    {
                        authorization = null;
                    }
                    else
                    {
                        authorization = queueDescription.Authorization;
                    }
                    authorizationRules.UpdateForVersion(apiVersion, authorization);
                }
                if (this.Status == EntityStatus.ReceiveDisabled || this.Status == EntityStatus.SendDisabled)
                {
                    this.Status = EntityStatus.Active;
                }
                if (queueDescription == null)
                {
                    internalAutoDeleteOnIdle = null;
                }
                else
                {
                    internalAutoDeleteOnIdle = queueDescription.InternalAutoDeleteOnIdle;
                }
                this.InternalAutoDeleteOnIdle = internalAutoDeleteOnIdle;
            }
            if (version < ApiVersion.Four)
            {
                if (queueDescription == null)
                {
                    internalAvailabilityStatus = null;
                }
                else
                {
                    internalAvailabilityStatus = queueDescription.InternalAvailabilityStatus;
                }
                this.InternalAvailabilityStatus = internalAvailabilityStatus;
            }
            if (version < ApiVersion.Six)
            {
                if (queueDescription == null)
                {
                    internalEnablePartitioning = null;
                }
                else
                {
                    internalEnablePartitioning = queueDescription.InternalEnablePartitioning;
                }
                this.InternalEnablePartitioning = internalEnablePartitioning;
                if (queueDescription == null)
                {
                    internalIsExpress = null;
                }
                else
                {
                    internalIsExpress = queueDescription.InternalIsExpress;
                }
                this.InternalIsExpress = internalIsExpress;
            }
            if (version < ApiVersion.Eight)
            {
                if (queueDescription == null)
                {
                    internalForwardDeadLetteredMessagesTo = null;
                }
                else
                {
                    internalForwardDeadLetteredMessagesTo = queueDescription.InternalForwardDeadLetteredMessagesTo;
                }
                this.InternalForwardDeadLetteredMessagesTo = internalForwardDeadLetteredMessagesTo;
                if (queueDescription == null)
                {
                    internalEnableExpress = null;
                }
                else
                {
                    internalEnableExpress = queueDescription.InternalEnableExpress;
                }
                this.InternalEnableExpress = internalEnableExpress;
            }
        }
Example #4
0
 internal virtual void UpdateForVersion(ApiVersion version, EntityDescription existingDescription = null)
 {
 }
Example #5
0
        internal override void UpdateForVersion(ApiVersion version, EntityDescription existingDescription = null)
        {
            string internalForwardDeadLetteredMessagesTo;
            EntityAvailabilityStatus?internalAvailabilityStatus;
            TimeSpan?    internalAutoDeleteOnIdle;
            EntityStatus?internalStatus;
            string       internalForwardTo;
            DateTime?    internalCreatedAt;
            DateTime?    internalUpdatedAt;
            DateTime?    internalAccessedAt;
            string       internalUserMetadata;

            Microsoft.ServiceBus.Messaging.MessageCountDetails internalMessageCountDetails;
            SubscriptionDescription subscriptionDescription = existingDescription as SubscriptionDescription;

            base.UpdateForVersion(version, existingDescription);
            if (version < ApiVersion.Two)
            {
                if (subscriptionDescription == null)
                {
                    internalStatus = null;
                }
                else
                {
                    internalStatus = subscriptionDescription.InternalStatus;
                }
                this.InternalStatus = internalStatus;
                if (subscriptionDescription == null)
                {
                    internalForwardTo = null;
                }
                else
                {
                    internalForwardTo = subscriptionDescription.InternalForwardTo;
                }
                this.InternalForwardTo = internalForwardTo;
                if (subscriptionDescription == null)
                {
                    internalCreatedAt = null;
                }
                else
                {
                    internalCreatedAt = subscriptionDescription.InternalCreatedAt;
                }
                this.InternalCreatedAt = internalCreatedAt;
                if (subscriptionDescription == null)
                {
                    internalUpdatedAt = null;
                }
                else
                {
                    internalUpdatedAt = subscriptionDescription.InternalUpdatedAt;
                }
                this.InternalUpdatedAt = internalUpdatedAt;
                if (subscriptionDescription == null)
                {
                    internalAccessedAt = null;
                }
                else
                {
                    internalAccessedAt = subscriptionDescription.InternalAccessedAt;
                }
                this.InternalAccessedAt = internalAccessedAt;
                if (subscriptionDescription == null)
                {
                    internalUserMetadata = null;
                }
                else
                {
                    internalUserMetadata = subscriptionDescription.InternalUserMetadata;
                }
                this.InternalUserMetadata = internalUserMetadata;
                if (subscriptionDescription == null)
                {
                    internalMessageCountDetails = null;
                }
                else
                {
                    internalMessageCountDetails = subscriptionDescription.InternalMessageCountDetails;
                }
                this.InternalMessageCountDetails = internalMessageCountDetails;
            }
            if (version < ApiVersion.Three)
            {
                if (this.Status == EntityStatus.ReceiveDisabled || this.Status == EntityStatus.SendDisabled)
                {
                    this.Status = EntityStatus.Active;
                }
                if (subscriptionDescription == null)
                {
                    internalAutoDeleteOnIdle = null;
                }
                else
                {
                    internalAutoDeleteOnIdle = subscriptionDescription.InternalAutoDeleteOnIdle;
                }
                this.InternalAutoDeleteOnIdle = internalAutoDeleteOnIdle;
            }
            if (version < ApiVersion.Four)
            {
                if (subscriptionDescription == null)
                {
                    internalAvailabilityStatus = null;
                }
                else
                {
                    internalAvailabilityStatus = subscriptionDescription.InternalAvailabilityStatus;
                }
                this.InternalAvailabilityStatus = internalAvailabilityStatus;
            }
            if (version < ApiVersion.Eight)
            {
                if (subscriptionDescription == null)
                {
                    internalForwardDeadLetteredMessagesTo = null;
                }
                else
                {
                    internalForwardDeadLetteredMessagesTo = subscriptionDescription.InternalForwardDeadLetteredMessagesTo;
                }
                this.InternalForwardDeadLetteredMessagesTo = internalForwardDeadLetteredMessagesTo;
            }
        }
        internal override void UpdateForVersion(ApiVersion version, EntityDescription existingDescription = null)
        {
            RuleAction ruleAction;

            Microsoft.ServiceBus.Messaging.Filter filter;
            string          tag;
            DateTime?       internalCreatedAt;
            RuleAction      ruleAction1;
            string          str;
            RuleDescription ruleDescription = existingDescription as RuleDescription;

            base.UpdateForVersion(version, existingDescription);
            bool flag = false;

            if (version < ApiVersion.Two)
            {
                if (ruleDescription == null)
                {
                    tag = null;
                }
                else
                {
                    tag = ruleDescription.Tag;
                }
                this.Tag = tag;
                if (ruleDescription == null)
                {
                    internalCreatedAt = null;
                }
                else
                {
                    internalCreatedAt = ruleDescription.InternalCreatedAt;
                }
                this.InternalCreatedAt = internalCreatedAt;
                if (this.action is CompositeAction || this.action is RuleCreationAction)
                {
                    if (ruleDescription == null)
                    {
                        ruleAction1 = null;
                    }
                    else
                    {
                        ruleAction1 = ruleDescription.action;
                    }
                    this.action = ruleAction1;
                    flag        = true;
                }
                if (ruleDescription == null)
                {
                    str = null;
                }
                else
                {
                    str = ruleDescription.name;
                }
                this.name = str;
            }
            if (this.filter != null)
            {
                Microsoft.ServiceBus.Messaging.Filter filter1 = this.filter;
                ApiVersion apiVersion = version;
                if (ruleDescription == null)
                {
                    filter = null;
                }
                else
                {
                    filter = ruleDescription.filter;
                }
                filter1.UpdateForVersion(apiVersion, filter);
            }
            if (this.action != null && !flag)
            {
                RuleAction ruleAction2 = this.action;
                ApiVersion apiVersion1 = version;
                if (ruleDescription == null)
                {
                    ruleAction = null;
                }
                else
                {
                    ruleAction = ruleDescription.action;
                }
                ruleAction2.UpdateForVersion(apiVersion1, ruleAction);
            }
        }