/// <summary> /// Writes the XML file. /// </summary> /// <typeparam name="type">The type of the <paramref name="dataObject"/>.</typeparam> /// <param name="dataObject">The data object.</param> /// <param name="path">The path of the file.</param> /// <param name="mode">The mode of the file - specifies how the operating system should open a file.</param> public static void WriteXmlFile <type>(type dataObject, string path, FileMode mode) where type : IStylesheetNameProvider { XmlFile.WriteXmlFile <type>(dataObject, path, mode, dataObject.StylesheetNmane); }
/// <summary> /// Reads the XML file from the <see cref="SPFile" /> that represents a file in a SharePoint Web site, an item in a document library, or a file in a folder /// and deserializes its content to returned object. /// </summary> /// <typeparam name="type">The type of an object containing working data retrieved from an XML file.</typeparam> /// <param name="file">The <see cref="SPFile" /> that represents a file in a SharePoint Web site.</param> /// <returns>An object of <typeparamref name="type" /> containing working data retrieved from an XML file.</returns> public static type ReadXmlFile <type>(SPFile file) { using (Stream _str = file.OpenBinaryStream()) return(XmlFile.ReadXmlFile <type>(_str)); }