/// <summary> /// Get the value of an extended property /// </summary> /// <param name="propertyName">The name of the property</param> /// <returns>The value</returns> public string GetExtendedPropertyValue(string propertyName) { string retValue = null; string searchString = string.Format("xp:Properties/xp:{0}", propertyName); XmlNode node = ExtendedPropertiesXml.SelectSingleNode(searchString, NameSpaceManager); if (node != null) { retValue = node.InnerText; } return(retValue); }
private string GetExtendedPropertyValue(string propertyName) { string retValue = null; var searchString = string.Format("//xp:Properties/xp:{0}", propertyName); var node = ExtendedPropertiesXml.SelectSingleNode(searchString, _nsManager); if (node != null) { retValue = node.InnerText; } return(retValue); }
private string GetExtendedPropertyValue(string propertyName) { string retValue = null; string searchString = string.Format("//xp:Properties/xp:{0}", propertyName); var node = ExtendedPropertiesXml.XPathSelectElement(searchString, _nsManager); if (node != null) { retValue = node.Value; } return(retValue); }
private void SetExtendedPropertyValue(string propertyName, string propValue) { string searchString = string.Format("//xp:Properties/xp:{0}", propertyName); XmlNode node = ExtendedPropertiesXml.SelectSingleNode(searchString, _nsManager); if (node == null) { // the property does not exist, so create the XML node node = (XmlNode)ExtendedPropertiesXml.CreateElement(propertyName, schemeExtended); ExtendedPropertiesXml.DocumentElement.AppendChild(node); } node.InnerText = propValue; }
private void SetExtendedPropertyValue(string propertyName, string propValue) { string searchString = string.Format("//xp:Properties/xp:{0}", propertyName); var node = ExtendedPropertiesXml.XPathSelectElement(searchString, _nsManager); if (node == null) { // the property does not exist, so create the XML node node = new XElement(propertyName) .AddSchemaAttribute(XNamespace.Xmlns, schemeExtended); ExtendedPropertiesXml.Document.Add(node); } node.Value = propValue; }