コード例 #1
0
 /// <summary>
 /// Check whether an object is a transparent proxy with a RemotingProxy behind it
 /// </summary>
 /// <param name="obj">Object to check</param>
 /// <returns>true if the object is a transparent proxy with a RemotingProxy instance behind it, false otherwise</returns>
 /// <remarks>We use Equals() method to communicate with the real proxy behind the object.
 /// See IRemotingProxyOperation for more details</remarks>
 public static bool IsRemotingProxy(object obj)
 {
     if (obj == null) return false;
     RemotingProxyDetector detector = new RemotingProxyDetector();
     obj.Equals(detector);
     return detector.Detected;
 }
コード例 #2
0
        /// <summary>
        /// Check whether an object is a transparent proxy with a RemotingProxy behind it
        /// </summary>
        /// <param name="obj">Object to check</param>
        /// <returns>true if the object is a transparent proxy with a RemotingProxy instance behind it, false otherwise</returns>
        /// <remarks>We use Equals() method to communicate with the real proxy behind the object.
        /// See IRemotingProxyOperation for more details</remarks>
        public static bool IsRemotingProxy(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            RemotingProxyDetector detector = new RemotingProxyDetector();

            obj.Equals(detector);
            return(detector.Detected);
        }