Наследование: System.Runtime.Remoting.Contexts.ContextAttribute
Пример #1
0
        public override bool IsContextOK(Context ctx, IConstructionCallMessage ctorMsg)
        {
            if (RemotingConfigHandler.Info == null)
            {
                return(true);
            }
            RuntimeType runtimeType = ctorMsg.ActivationType as RuntimeType;

            if (runtimeType == null)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"));
            }
            WellKnownClientTypeEntry wellKnownClientTypeEntry = RemotingConfigHandler.IsWellKnownClientType(runtimeType);
            string text = (wellKnownClientTypeEntry == null) ? null : wellKnownClientTypeEntry.ObjectUrl;

            if (text != null)
            {
                ctorMsg.Properties["Connect"] = text;
                return(false);
            }
            ActivatedClientTypeEntry activatedClientTypeEntry = RemotingConfigHandler.IsRemotelyActivatedClientType(runtimeType);
            string text2 = null;

            if (activatedClientTypeEntry == null)
            {
                object[] callSiteActivationAttributes = ctorMsg.CallSiteActivationAttributes;
                if (callSiteActivationAttributes != null)
                {
                    for (int i = 0; i < callSiteActivationAttributes.Length; i++)
                    {
                        UrlAttribute urlAttribute = callSiteActivationAttributes[i] as UrlAttribute;
                        if (urlAttribute != null)
                        {
                            text2 = urlAttribute.UrlValue;
                        }
                    }
                }
                if (text2 == null)
                {
                    return(true);
                }
            }
            else
            {
                text2 = activatedClientTypeEntry.ApplicationUrl;
            }
            string value;

            if (!text2.EndsWith("/", StringComparison.Ordinal))
            {
                value = text2 + "/RemoteActivationService.rem";
            }
            else
            {
                value = text2 + "RemoteActivationService.rem";
            }
            ctorMsg.Properties["Remote"] = value;
            return(false);
        }
Пример #2
0
        public override bool IsContextOK(Context ctx, IConstructionCallMessage ctorMsg)
        {
            if (RemotingConfigHandler.Info == null)
            {
                return(true);
            }
            RuntimeType svrType = ctorMsg.ActivationType as RuntimeType;

            if (svrType == (RuntimeType)null)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"));
            }
            WellKnownClientTypeEntry knownClientTypeEntry = RemotingConfigHandler.IsWellKnownClientType(svrType);
            string str1 = knownClientTypeEntry == null ? (string)null : knownClientTypeEntry.ObjectUrl;

            if (str1 != null)
            {
                ctorMsg.Properties[(object)"Connect"] = (object)str1;
                return(false);
            }
            ActivatedClientTypeEntry activatedClientTypeEntry = RemotingConfigHandler.IsRemotelyActivatedClientType(svrType);
            string str2 = (string)null;

            if (activatedClientTypeEntry == null)
            {
                object[] activationAttributes = ctorMsg.CallSiteActivationAttributes;
                if (activationAttributes != null)
                {
                    for (int index = 0; index < activationAttributes.Length; ++index)
                    {
                        UrlAttribute urlAttribute = activationAttributes[index] as UrlAttribute;
                        if (urlAttribute != null)
                        {
                            str2 = urlAttribute.UrlValue;
                        }
                    }
                }
                if (str2 == null)
                {
                    return(true);
                }
            }
            else
            {
                str2 = activatedClientTypeEntry.ApplicationUrl;
            }
            string str3 = str2.EndsWith("/", StringComparison.Ordinal) ? str2 + "RemoteActivationService.rem" : str2 + "/RemoteActivationService.rem";

            ctorMsg.Properties[(object)"Remote"] = (object)str3;
            return(false);
        }
Пример #3
0
        // Determine if two attributes are equal.
        public override bool Equals(Object obj)
        {
            UrlAttribute other = (obj as UrlAttribute);

            if (other != null)
            {
                if (callSiteUrl == other.callSiteUrl)
                {
                    return(base.Equals(obj));
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }