System.Runtime.Serialization.Formatters.Soap.WriteObjectInfo.IsCallElement C# (CSharp) Méthode

IsCallElement() private méthode

private IsCallElement ( ) : bool
Résultat bool
        internal bool IsCallElement()
        {
            // This should only return true when this object is being
            //  serialized first.

            if ((objectType != Converter.typeofObject) &&
                (Converter.typeofIMethodCallMessage.IsAssignableFrom(objectType) &&
                 !Converter.typeofIConstructionCallMessage.IsAssignableFrom(objectType)) ||
                (objectType == Converter.typeofReturnMessage) ||
                (objectType == Converter.typeofInternalSoapMessage))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

Usage Example

        internal static InternalNameSpaceE GetNameSpaceEnum(InternalPrimitiveTypeE code, Type type, WriteObjectInfo objectInfo, out String typeName)
        {
            InternalST.Soap("Converter", "GetNameSpaceEnum Entry ",((Enum)code).ToString()," type ",type);                  
            InternalNameSpaceE nameSpaceEnum = InternalNameSpaceE.None;
            typeName = null;

            if (code != InternalPrimitiveTypeE.Invalid)
            {

                if (code == InternalPrimitiveTypeE.Char)
                {
                    nameSpaceEnum = InternalNameSpaceE.UrtSystem;
                    typeName = "System.Char";
                }
                else
                {
                    nameSpaceEnum = InternalNameSpaceE.XdrPrimitive;
                    typeName = ToXmlDataType(code);
                }
            }

            if ((nameSpaceEnum == InternalNameSpaceE.None) && (type != null))
            {
                if (type == typeofString)
                    nameSpaceEnum = InternalNameSpaceE.XdrString;
                else
                {
                    if (objectInfo == null)
                    {
                        typeName = type.FullName;
                        if (type.Module.Assembly == urtAssembly)
                            nameSpaceEnum = InternalNameSpaceE.UrtSystem;
                        else
                            nameSpaceEnum = InternalNameSpaceE.UrtUser;                     
                    }
                    else
                    {
                        typeName = objectInfo.GetTypeFullName();
                        // If objref is created from a proxy, it will have the proxy namespace
                        // Need to force ObjRef to have system namespace
                        if (objectInfo.GetAssemblyString().Equals(urtAssemblyString))
                            nameSpaceEnum = InternalNameSpaceE.UrtSystem;
                        else
                            nameSpaceEnum = InternalNameSpaceE.UrtUser;
                    }
                }
            }

            // If there is an explicitly specified namespace, then it is used
            if (objectInfo != null)
            {
                if (!objectInfo.isSi &&
                    (objectInfo.IsAttributeNameSpace() ||
                    objectInfo.IsCustomXmlAttribute() ||
                    objectInfo.IsCustomXmlElement()))
                {
                    nameSpaceEnum = InternalNameSpaceE.Interop;
                }
                else if (objectInfo.IsCallElement())
                {
                    nameSpaceEnum = InternalNameSpaceE.CallElement;
                }
            }

            InternalST.Soap("Converter", "GetNameSpaceEnum Exit ", ((Enum)nameSpaceEnum).ToString()," typeName ",typeName);                             
            return nameSpaceEnum;
        }
All Usage Examples Of System.Runtime.Serialization.Formatters.Soap.WriteObjectInfo::IsCallElement