System.Runtime.Remoting.RemotingServices.AlwaysUnwrap C# (CSharp) Méthode

AlwaysUnwrap() private méthode

private AlwaysUnwrap ( ContextBoundObject obj ) : Object
obj System.ContextBoundObject
Résultat Object
        internal static extern Object AlwaysUnwrap(ContextBoundObject obj);

Usage Example

        internal static bool RemoveDynamicProperty(MarshalByRefObject obj, String name)
        {
            if (RemotingServices.IsObjectOutOfContext(obj))
            {
                // We have to add a proxy side property, get the identity
                RealProxy rp = RemotingServices.GetRealProxy(obj);
                return(rp.IdentityObject.RemoveProxySideDynamicProperty(name));
            }
            else
            {
                MarshalByRefObject realObj =
                    (MarshalByRefObject)
                    RemotingServices.AlwaysUnwrap((ContextBoundObject)obj);

                // This is a real object. See if we have an identity for it
                ServerIdentity srvID = (ServerIdentity)MarshalByRefObject.GetIdentity(realObj);
                if (srvID != null)
                {
                    return(srvID.RemoveServerSideDynamicProperty(name));
                }
                else
                {
                    // identity not found, we can't set a sink for this object.
                    throw new RemotingException(
                              Environment.GetResourceString("Remoting_NoIdentityEntry"));
                }
            }
        }
All Usage Examples Of System.Runtime.Remoting.RemotingServices::AlwaysUnwrap
RemotingServices