System.Xml.Serialization.TempAssembly.CanRead C# (CSharp) Method

CanRead() private method

private CanRead ( XmlMapping mapping, XmlReader xmlReader ) : bool
mapping XmlMapping
xmlReader XmlReader
return bool
        internal bool CanRead(XmlMapping mapping, XmlReader xmlReader) {
            if (mapping == null)
                return false;

            if (mapping.Accessor.Any) {
                return true;
            }
            TempMethod method = methods[mapping.Key];
            return xmlReader.IsStartElement(method.name, method.ns);
        }

Usage Example

 /// <include file='doc\XmlSerializer.uex' path='docs/doc[@for="XmlSerializer.CanDeserialize"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public virtual bool CanDeserialize(XmlReader xmlReader)
 {
     if (primitiveType != null)
     {
         TypeDesc typeDesc = (TypeDesc)TypeScope.PrimtiveTypes[primitiveType];
         return(xmlReader.IsStartElement(typeDesc.DataType.Name, string.Empty));
     }
     else if (tempAssembly != null)
     {
         return(tempAssembly.CanRead(mapping, xmlReader));
     }
     else
     {
         return(false);
     }
 }
All Usage Examples Of System.Xml.Serialization.TempAssembly::CanRead