112 references to SR
System.Private.Xml.Linq (112)
System\Xml\Linq\XAttribute.cs (9)
182if (parent == null) throw new InvalidOperationException(SR.InvalidOperation_MissingParent); 710throw new ArgumentException(SR.Format(SR.Argument_NamespaceDeclarationPrefixed, name.LocalName)); 716if (name.LocalName != "xml") throw new ArgumentException(SR.Argument_NamespaceDeclarationXml); 722throw new ArgumentException(SR.Argument_NamespaceDeclarationXmlns); 731throw new ArgumentException(SR.Argument_NamespaceDeclarationXml); 736throw new ArgumentException(SR.Argument_NamespaceDeclarationXmlns); 746throw new ArgumentException(SR.Argument_NamespaceDeclarationXml); 752throw new ArgumentException(SR.Argument_NamespaceDeclarationXmlns);
System\Xml\Linq\XContainer.cs (23)
390if ((object)s != (object)content) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 405if (last != content || n != last.next) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 559if (content != null) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 616if (n.parent != null) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 823XObject => throw new ArgumentException(SR.Argument_XObjectValue), 827if (s == null) throw new ArgumentException(SR.Argument_ConvertToString); 833if (r.ReadState != ReadState.Interactive) throw new InvalidOperationException(SR.InvalidOperation_ExpectedInteractive); 846if (r.ReadState != ReadState.Interactive) throw new InvalidOperationException(SR.InvalidOperation_ExpectedInteractive); 854if (r.ReadState != ReadState.Interactive) throw new InvalidOperationException(SR.InvalidOperation_ExpectedInteractive); 871if (r.ReadState != ReadState.Interactive) throw new InvalidOperationException(SR.InvalidOperation_ExpectedInteractive); 944if (!r.CanResolveEntity) throw new InvalidOperationException(SR.InvalidOperation_UnresolvedEntityReference); 950throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedNodeType, r.NodeType)); 1000if (!r.CanResolveEntity) throw new InvalidOperationException(SR.InvalidOperation_UnresolvedEntityReference); 1006throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedNodeType, r.NodeType)); 1098if (!r.CanResolveEntity) throw new InvalidOperationException(SR.InvalidOperation_UnresolvedEntityReference); 1104throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedNodeType, r.NodeType)); 1214if (!r.CanResolveEntity) throw new InvalidOperationException(SR.InvalidOperation_UnresolvedEntityReference); 1220throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedNodeType, r.NodeType)); 1245if (n.parent != this) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode);
System\Xml\Linq\XDocument.cs (12)
436if (!reader.EOF) throw new InvalidOperationException(SR.InvalidOperation_ExpectedEndOfFile); 437if (d.Root == null) throw new InvalidOperationException(SR.InvalidOperation_MissingRoot); 484if (!reader.EOF) throw new InvalidOperationException(SR.InvalidOperation_ExpectedEndOfFile); 485if (d.Root == null) throw new InvalidOperationException(SR.InvalidOperation_MissingRoot); 865throw new ArgumentException(SR.Argument_AddAttribute); 870throw new ArgumentException(SR.Argument_AddAttribute); 918throw new ArgumentException(SR.Format(SR.Argument_AddNode, XmlNodeType.CDATA)); 920throw new ArgumentException(SR.Format(SR.Argument_AddNode, XmlNodeType.Document)); 936if (nt != allowBefore) throw new InvalidOperationException(SR.InvalidOperation_DocumentStructure); 948throw new ArgumentException(SR.Argument_AddNonWhitespace);
System\Xml\Linq\XElement.cs (19)
811if (reader.MoveToContent() != XmlNodeType.Element) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ExpectedNodeType, XmlNodeType.Element, reader.NodeType)); 814if (!reader.EOF) throw new InvalidOperationException(SR.InvalidOperation_ExpectedEndOfFile); 846if (await reader.MoveToContentAsync().ConfigureAwait(false) != XmlNodeType.Element) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ExpectedNodeType, XmlNodeType.Element, reader.NodeType)); 854if (!reader.EOF) throw new InvalidOperationException(SR.InvalidOperation_ExpectedEndOfFile); 941if (lastAttr == null || a != lastAttr.next) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 1882if (parent != null || annotations != null || content != null || lastAttr != null) throw new InvalidOperationException(SR.InvalidOperation_DeserializeInstance); 1883if (reader.MoveToContent() != XmlNodeType.Element) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ExpectedNodeType, XmlNodeType.Element, reader.NodeType)); 1901if (Attribute(a.Name) != null) throw new InvalidOperationException(SR.InvalidOperation_DuplicateAttribute); 1908if (Attribute(a.Name) != null) throw new InvalidOperationException(SR.InvalidOperation_DuplicateAttribute); 1916if (a.parent != null) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 2048if (r.ReadState != ReadState.Interactive) throw new InvalidOperationException(SR.InvalidOperation_ExpectedInteractive); 2085if (a.parent != this) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 2125if (node is XDocument) throw new ArgumentException(SR.Format(SR.Argument_AddNode, XmlNodeType.Document)); 2126if (node is XDocumentType) throw new ArgumentException(SR.Format(SR.Argument_AddNode, XmlNodeType.DocumentType));
System\Xml\Linq\XLinq.cs (4)
50if (_parent.content != null) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 110if (content is XAttribute) throw new ArgumentException(SR.Argument_AddAttribute); 157if (n.parent != null) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode); 627if (_element == null) throw new InvalidOperationException(SR.InvalidOperation_WriteAttribute);
System\Xml\Linq\XName.cs (2)
78if (i <= 1 || i == expandedName.Length - 1) throw new ArgumentException(SR.Format(SR.Argument_InvalidExpandedName, expandedName));
System\Xml\Linq\XNode.cs (13)
106if (parent == null) throw new InvalidOperationException(SR.InvalidOperation_MissingParent); 150if (parent == null) throw new InvalidOperationException(SR.InvalidOperation_MissingParent); 241if (p1 != p2) throw new InvalidOperationException(SR.InvalidOperation_MissingAncestor); 268throw new InvalidOperationException(SR.InvalidOperation_MissingAncestor); 427if (reader.ReadState != ReadState.Interactive) throw new InvalidOperationException(SR.InvalidOperation_ExpectedInteractive); 445throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedNodeType, reader.NodeType)); 472if (reader.ReadState != ReadState.Interactive) throw new InvalidOperationException(SR.InvalidOperation_ExpectedInteractive); 506throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedNodeType, reader.NodeType)); 523if (parent == null) throw new InvalidOperationException(SR.InvalidOperation_MissingParent); 539if (parent == null) throw new InvalidOperationException(SR.InvalidOperation_MissingParent); 545if (p != null && p.parent != c) throw new InvalidOperationException(SR.InvalidOperation_ExternalCode);
System\Xml\Linq\XNodeBuilder.cs (2)
61throw new NotSupportedException(SR.NotSupported_WriteBase64); 133throw new NotSupportedException(SR.NotSupported_WriteEntityRef);
System\Xml\Linq\XNodeDocumentOrderComparer.cs (4)
55if (n1 == null && x != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(x)); 57if (n2 == null && y != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(y));
System\Xml\Linq\XNodeEqualityComparer.cs (6)
79if (n1 == null && x != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(x)); 81if (n2 == null && y != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(y)); 98if (n == null && obj != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(obj));
System\Xml\Linq\XNodeReader.cs (1)
557throw new InvalidOperationException(SR.InvalidOperation_ExpectedInteractive);
System\Xml\Linq\XProcessingInstruction.cs (2)
162if (string.Equals(name, "xml", StringComparison.OrdinalIgnoreCase)) throw new ArgumentException(SR.Format(SR.Argument_InvalidPIName, name));
System\Xml\Schema\XNodeValidator.cs (4)
50if (source == null) throw new InvalidOperationException(SR.InvalidOperation_MissingRoot); 57if (source.Parent == null) throw new InvalidOperationException(SR.InvalidOperation_MissingParent); 60throw new InvalidOperationException(SR.Format(SR.InvalidOperation_BadNodeType, nt));
System\Xml\XPath\XNodeNavigator.cs (11)
451throw new NotSupportedException(SR.NotSupported_MoveToId); 684if (c == null) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_BadNodeType, NodeType)); 875if (!(result is T)) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedEvaluation, result.GetType())); 885if (!(r is T)) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedEvaluation, r.GetType())); 927if (node is XDocumentType) throw new ArgumentException(SR.Format(SR.Argument_CreateNavigator, XmlNodeType.DocumentType)); 931if (text.GetParent() is XDocument) throw new ArgumentException(SR.Format(SR.Argument_CreateNavigator, XmlNodeType.Whitespace));