Windows.Data.Xml.Dom.XmlDocument.CreateAttribute C# (CSharp) Method

CreateAttribute() public method

public CreateAttribute ( [ name ) : XmlAttribute
name [
return XmlAttribute
		public extern XmlAttribute CreateAttribute([In] string name);
		public extern XmlEntityReference CreateEntityReference([In] string name);

Usage Example

Beispiel #1
0
        private static void SetSilent(bool useSound, XmlDocument toastXml)
        {
            var audio = toastXml.GetElementsByTagName("audio").FirstOrDefault();

            if (audio == null)
            {
                audio = toastXml.CreateElement("audio");
                var toastNode = ((XmlElement)toastXml.SelectSingleNode("/toast"));

                if (toastNode != null)
                {
                    toastNode.AppendChild(audio);
                }
            }

            var attribute = toastXml.CreateAttribute("silent");
            attribute.Value = (!useSound).ToString().ToLower();
            audio.Attributes.SetNamedItem(attribute);
        }
All Usage Examples Of Windows.Data.Xml.Dom.XmlDocument::CreateAttribute