WrapNode() private méthode

private WrapNode ( XmlNode node ) : IXmlNode
node System.Xml.XmlNode
Résultat IXmlNode
Exemple #1
0
 private IXmlNode WrapXml(object value)
 {
     if (value is XObject)
     {
         return(XContainerWrapper.WrapNode((XObject)value));
     }
     if (!(value is System.Xml.XmlNode))
     {
         throw new ArgumentException("Value must be an XML object.", "value");
     }
     return(XmlNodeWrapper.WrapNode((System.Xml.XmlNode)value));
 }
        private IXmlNode WrapXml(object value)
        {
            switch (value)
            {
            case XObject _:
                return(XContainerWrapper.WrapNode((XObject)value));

            case XmlNode _:
                return(XmlNodeWrapper.WrapNode((XmlNode)value));

            default:
                throw new ArgumentException("Value must be an XML object.", nameof(value));
            }
        }