System.Runtime.Remoting.ObjRef.IsWellFormed C# (CSharp) Méthode

IsWellFormed() static private méthode

static private IsWellFormed ( ObjRef objectRef ) : bool
objectRef ObjRef
Résultat bool
        internal static bool IsWellFormed(ObjRef objectRef)
        {
            // We skip the wellformed check for wellKnown, 
            // objref-lite and custom objrefs
            bool wellFormed = true;
            if ((null == objectRef) ||
                (null == objectRef.URI) ||
                (!(objectRef.IsWellKnown()  || objectRef.IsObjRefLite() ||
                   objectRef.GetType() != orType)
                    && (null == objectRef.ChannelInfo)))
            {
                wellFormed = false;
            }
            
            return wellFormed;
        }
    } // ObjRef 

Usage Example

Exemple #1
0
        private CrossAppDomainData GetAppDomainChannelData()
        {
            BCLDebug.Assert(
                ObjRef.IsWellFormed(this),
                "ObjRef.IsWellFormed()");

            // Look at the ChannelData part to find CrossAppDomainData
            int i = 0;
            CrossAppDomainData xadData = null;

            while (i < ChannelInfo.ChannelData.Length)
            {
                xadData = ChannelInfo.ChannelData[i] as CrossAppDomainData;
                if (null != xadData)
                {
                    return(xadData);
                }
                i++;
            }

            // AdData could be null for user-created objRefs.
            return(null);
        }