From 1ee57c8ca3ece97846417387e009567fa36364f3 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Mon, 9 May 2022 20:46:27 +0200 Subject: [PATCH] Added latest Subsonic API (1.16.1), improved deserialization process, upgraded to latest C# version --- .../Domain/subsonic-rest-api-1.12.0.xsd | 563 + .../Domain/subsonic-rest-api-1.13.0.xsd | 588 + .../subsonic-rest-api-1.14.0.Designer.cs | 20391 ---------------- .../Domain/subsonic-rest-api-1.15.0.xsd | 638 + .../Domain/subsonic-rest-api-1.16.0.xsd | 638 + .../Domain/subsonic-rest-api-1.16.1.xsd | 640 + .../Domain/subsonic-rest-api-1_16_1.cs | 3645 +++ MB_SubSonic/SubSonic.csproj | 19 +- MB_SubSonic/Subsonic.cs | 429 +- 9 files changed, 6923 insertions(+), 20628 deletions(-) create mode 100644 MB_SubSonic/Domain/subsonic-rest-api-1.12.0.xsd create mode 100644 MB_SubSonic/Domain/subsonic-rest-api-1.13.0.xsd delete mode 100644 MB_SubSonic/Domain/subsonic-rest-api-1.14.0.Designer.cs create mode 100644 MB_SubSonic/Domain/subsonic-rest-api-1.15.0.xsd create mode 100644 MB_SubSonic/Domain/subsonic-rest-api-1.16.0.xsd create mode 100644 MB_SubSonic/Domain/subsonic-rest-api-1.16.1.xsd create mode 100644 MB_SubSonic/Domain/subsonic-rest-api-1_16_1.cs diff --git a/MB_SubSonic/Domain/subsonic-rest-api-1.12.0.xsd b/MB_SubSonic/Domain/subsonic-rest-api-1.12.0.xsd new file mode 100644 index 0000000..5508c2d --- /dev/null +++ b/MB_SubSonic/Domain/subsonic-rest-api-1.12.0.xsd @@ -0,0 +1,563 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MB_SubSonic/Domain/subsonic-rest-api-1.13.0.xsd b/MB_SubSonic/Domain/subsonic-rest-api-1.13.0.xsd new file mode 100644 index 0000000..2e92613 --- /dev/null +++ b/MB_SubSonic/Domain/subsonic-rest-api-1.13.0.xsd @@ -0,0 +1,588 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MB_SubSonic/Domain/subsonic-rest-api-1.14.0.Designer.cs b/MB_SubSonic/Domain/subsonic-rest-api-1.14.0.Designer.cs deleted file mode 100644 index ff83ae1..0000000 --- a/MB_SubSonic/Domain/subsonic-rest-api-1.14.0.Designer.cs +++ /dev/null @@ -1,20391 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// Generated by Xsd2Code++. Version 4.2.0.15 -// MusicBeePluginListCSharpFalseFalseFalseOnlyIfDifferentFalseNet45AllFalseFalseTrueFalseFalseFalseFalseFalseNoneStartWithUnderscoreFalseFalseFalseFalseFalsePublicTrueFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseTrueSerializeDeserializeSaveToFileLoadFromFileTrueTrueUTF8XmlSerializerTrueTrueTrueTrueTrueTrueEntityBaseFalseFalse -// -// ------------------------------------------------------------------------------ -#pragma warning disable -namespace MusicBeePlugin.SubsonicAPI -{ - using System; - using System.Diagnostics; - using System.Xml.Serialization; - using System.Collections; - using System.Xml.Schema; - using System.ComponentModel; - using System.IO; - using System.Text; - using System.Xml; - using System.Collections.Generic; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - [System.Xml.Serialization.XmlRootAttribute("subsonic-response", Namespace="http://subsonic.org/restapi", IsNullable=false)] - public partial class Response - { - - private bool _shouldSerializestatus; - - private bool _shouldSerializeItemElementName; - - private bool _shouldSerializeItem; - - private object _item; - - private ItemChoiceType _itemElementName; - - private ResponseStatus _status; - - private string _version; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlElementAttribute("album", typeof(AlbumWithSongsID3))] - [System.Xml.Serialization.XmlElementAttribute("albumInfo", typeof(AlbumInfo))] - [System.Xml.Serialization.XmlElementAttribute("albumList", typeof(AlbumList))] - [System.Xml.Serialization.XmlElementAttribute("albumList2", typeof(AlbumList2))] - [System.Xml.Serialization.XmlElementAttribute("artist", typeof(ArtistWithAlbumsID3))] - [System.Xml.Serialization.XmlElementAttribute("artistInfo", typeof(ArtistInfo))] - [System.Xml.Serialization.XmlElementAttribute("artistInfo2", typeof(ArtistInfo2))] - [System.Xml.Serialization.XmlElementAttribute("artists", typeof(ArtistsID3))] - [System.Xml.Serialization.XmlElementAttribute("bookmarks", typeof(Bookmarks))] - [System.Xml.Serialization.XmlElementAttribute("chatMessages", typeof(ChatMessages))] - [System.Xml.Serialization.XmlElementAttribute("directory", typeof(Directory))] - [System.Xml.Serialization.XmlElementAttribute("error", typeof(Error))] - [System.Xml.Serialization.XmlElementAttribute("genres", typeof(Genres))] - [System.Xml.Serialization.XmlElementAttribute("indexes", typeof(Indexes))] - [System.Xml.Serialization.XmlElementAttribute("internetRadioStations", typeof(InternetRadioStations))] - [System.Xml.Serialization.XmlElementAttribute("jukeboxPlaylist", typeof(JukeboxPlaylist))] - [System.Xml.Serialization.XmlElementAttribute("jukeboxStatus", typeof(JukeboxStatus))] - [System.Xml.Serialization.XmlElementAttribute("license", typeof(License))] - [System.Xml.Serialization.XmlElementAttribute("lyrics", typeof(Lyrics))] - [System.Xml.Serialization.XmlElementAttribute("musicFolders", typeof(MusicFolders))] - [System.Xml.Serialization.XmlElementAttribute("newestPodcasts", typeof(NewestPodcasts))] - [System.Xml.Serialization.XmlElementAttribute("nowPlaying", typeof(NowPlaying))] - [System.Xml.Serialization.XmlElementAttribute("playQueue", typeof(PlayQueue))] - [System.Xml.Serialization.XmlElementAttribute("playlist", typeof(PlaylistWithSongs))] - [System.Xml.Serialization.XmlElementAttribute("playlists", typeof(Playlists))] - [System.Xml.Serialization.XmlElementAttribute("podcasts", typeof(Podcasts))] - [System.Xml.Serialization.XmlElementAttribute("randomSongs", typeof(Songs))] - [System.Xml.Serialization.XmlElementAttribute("searchResult", typeof(SearchResult))] - [System.Xml.Serialization.XmlElementAttribute("searchResult2", typeof(SearchResult2))] - [System.Xml.Serialization.XmlElementAttribute("searchResult3", typeof(SearchResult3))] - [System.Xml.Serialization.XmlElementAttribute("shares", typeof(Shares))] - [System.Xml.Serialization.XmlElementAttribute("similarSongs", typeof(SimilarSongs))] - [System.Xml.Serialization.XmlElementAttribute("similarSongs2", typeof(SimilarSongs2))] - [System.Xml.Serialization.XmlElementAttribute("song", typeof(Child))] - [System.Xml.Serialization.XmlElementAttribute("songsByGenre", typeof(Songs))] - [System.Xml.Serialization.XmlElementAttribute("starred", typeof(Starred))] - [System.Xml.Serialization.XmlElementAttribute("starred2", typeof(Starred2))] - [System.Xml.Serialization.XmlElementAttribute("topSongs", typeof(TopSongs))] - [System.Xml.Serialization.XmlElementAttribute("user", typeof(User))] - [System.Xml.Serialization.XmlElementAttribute("users", typeof(Users))] - [System.Xml.Serialization.XmlElementAttribute("videoInfo", typeof(VideoInfo))] - [System.Xml.Serialization.XmlElementAttribute("videos", typeof(Videos))] - [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] - public object Item - { - get - { - return this._item; - } - set - { - this._item = value; - _shouldSerializeItem = true; - } - } - - [System.Xml.Serialization.XmlIgnoreAttribute()] - public ItemChoiceType ItemElementName - { - get - { - return this._itemElementName; - } - set - { - this._itemElementName = value; - _shouldSerializeItemElementName = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public ResponseStatus status - { - get - { - return this._status; - } - set - { - this._status = value; - _shouldSerializestatus = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string version - { - get - { - return this._version; - } - set - { - this._version = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Response)); - } - return serializer; - } - } - - /// - /// Test whether Item should be serialized - /// - public virtual bool ShouldSerializeItem() - { - if (_shouldSerializeItem) - { - return true; - } - return (_item != default(object)); - } - - /// - /// Test whether ItemElementName should be serialized - /// - public virtual bool ShouldSerializeItemElementName() - { - if (_shouldSerializeItemElementName) - { - return true; - } - return (_itemElementName != default(ItemChoiceType)); - } - - /// - /// Test whether status should be serialized - /// - public virtual bool ShouldSerializestatus() - { - if (_shouldSerializestatus) - { - return true; - } - return (_status != default(ResponseStatus)); - } - - /// - /// Test whether version should be serialized - /// - public virtual bool ShouldSerializeversion() - { - return !string.IsNullOrEmpty(version); - } - - #region Serialize/Deserialize - /// - /// Serializes current Response object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Response object - /// - /// string workflow markup to deserialize - /// Output Response object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Response obj, out System.Exception exception) - { - exception = null; - obj = default(Response); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Response obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Response Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Response)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Response Deserialize(System.IO.Stream s) - { - return ((Response)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Response object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Response object - /// - /// string xml file to load and deserialize - /// Output Response object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Response obj, out System.Exception exception) - { - exception = null; - obj = default(Response); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Response obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Response obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Response LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Response LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class AlbumWithSongsID3 : AlbumID3 - { - - private List _song; - - private static XmlSerializer serializer; - - public AlbumWithSongsID3() - { - this._song = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(AlbumWithSongsID3)); - } - return serializer; - } - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current AlbumWithSongsID3 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an AlbumWithSongsID3 object - /// - /// string workflow markup to deserialize - /// Output AlbumWithSongsID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out AlbumWithSongsID3 obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumWithSongsID3); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out AlbumWithSongsID3 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public new static AlbumWithSongsID3 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((AlbumWithSongsID3)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static AlbumWithSongsID3 Deserialize(System.IO.Stream s) - { - return ((AlbumWithSongsID3)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current AlbumWithSongsID3 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an AlbumWithSongsID3 object - /// - /// string xml file to load and deserialize - /// Output AlbumWithSongsID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out AlbumWithSongsID3 obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumWithSongsID3); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out AlbumWithSongsID3 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out AlbumWithSongsID3 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static AlbumWithSongsID3 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public new static AlbumWithSongsID3 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.Xml.Serialization.XmlIncludeAttribute(typeof(PodcastEpisode))] - [System.Xml.Serialization.XmlIncludeAttribute(typeof(NowPlayingEntry))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Child - { - - private bool _shouldSerializetype; - - private bool _shouldSerializeoriginalHeight; - - private bool _shouldSerializeoriginalWidth; - - private bool _shouldSerializebookmarkPosition; - - private bool _shouldSerializestarred; - - private bool _shouldSerializecreated; - - private bool _shouldSerializediscNumber; - - private bool _shouldSerializeplayCount; - - private bool _shouldSerializeaverageRating; - - private bool _shouldSerializeuserRating; - - private bool _shouldSerializeisVideo; - - private bool _shouldSerializebitRate; - - private bool _shouldSerializeduration; - - private bool _shouldSerializesize; - - private bool _shouldSerializeyear; - - private bool _shouldSerializetrack; - - private bool _shouldSerializeisDir; - - private string _id; - - private string _parent; - - private bool _isDir; - - private string _title; - - private string _album; - - private string _artist; - - private int _track; - - private int _year; - - private string _genre; - - private string _coverArt; - - private long _size; - - private string _contentType; - - private string _suffix; - - private string _transcodedContentType; - - private string _transcodedSuffix; - - private int _duration; - - private int _bitRate; - - private string _path; - - private bool _isVideo; - - private int _userRating; - - private double _averageRating; - - private long _playCount; - - private int _discNumber; - - private System.DateTime _created; - - private System.DateTime _starred; - - private string _albumId; - - private string _artistId; - - private MediaType _type; - - private long _bookmarkPosition; - - private int _originalWidth; - - private int _originalHeight; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string parent - { - get - { - return this._parent; - } - set - { - this._parent = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool isDir - { - get - { - return this._isDir; - } - set - { - this._isDir = value; - _shouldSerializeisDir = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string title - { - get - { - return this._title; - } - set - { - this._title = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string album - { - get - { - return this._album; - } - set - { - this._album = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int track - { - get - { - return this._track; - } - set - { - this._track = value; - _shouldSerializetrack = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int year - { - get - { - return this._year; - } - set - { - this._year = value; - _shouldSerializeyear = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string genre - { - get - { - return this._genre; - } - set - { - this._genre = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string coverArt - { - get - { - return this._coverArt; - } - set - { - this._coverArt = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long size - { - get - { - return this._size; - } - set - { - this._size = value; - _shouldSerializesize = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string contentType - { - get - { - return this._contentType; - } - set - { - this._contentType = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string suffix - { - get - { - return this._suffix; - } - set - { - this._suffix = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string transcodedContentType - { - get - { - return this._transcodedContentType; - } - set - { - this._transcodedContentType = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string transcodedSuffix - { - get - { - return this._transcodedSuffix; - } - set - { - this._transcodedSuffix = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int duration - { - get - { - return this._duration; - } - set - { - this._duration = value; - _shouldSerializeduration = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int bitRate - { - get - { - return this._bitRate; - } - set - { - this._bitRate = value; - _shouldSerializebitRate = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string path - { - get - { - return this._path; - } - set - { - this._path = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool isVideo - { - get - { - return this._isVideo; - } - set - { - this._isVideo = value; - _shouldSerializeisVideo = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int userRating - { - get - { - return this._userRating; - } - set - { - this._userRating = value; - _shouldSerializeuserRating = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public double averageRating - { - get - { - return this._averageRating; - } - set - { - this._averageRating = value; - _shouldSerializeaverageRating = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long playCount - { - get - { - return this._playCount; - } - set - { - this._playCount = value; - _shouldSerializeplayCount = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int discNumber - { - get - { - return this._discNumber; - } - set - { - this._discNumber = value; - _shouldSerializediscNumber = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime created - { - get - { - return this._created; - } - set - { - this._created = value; - _shouldSerializecreated = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime starred - { - get - { - return this._starred; - } - set - { - this._starred = value; - _shouldSerializestarred = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string albumId - { - get - { - return this._albumId; - } - set - { - this._albumId = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string artistId - { - get - { - return this._artistId; - } - set - { - this._artistId = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public MediaType type - { - get - { - return this._type; - } - set - { - this._type = value; - _shouldSerializetype = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long bookmarkPosition - { - get - { - return this._bookmarkPosition; - } - set - { - this._bookmarkPosition = value; - _shouldSerializebookmarkPosition = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int originalWidth - { - get - { - return this._originalWidth; - } - set - { - this._originalWidth = value; - _shouldSerializeoriginalWidth = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int originalHeight - { - get - { - return this._originalHeight; - } - set - { - this._originalHeight = value; - _shouldSerializeoriginalHeight = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Child)); - } - return serializer; - } - } - - /// - /// Test whether isDir should be serialized - /// - public virtual bool ShouldSerializeisDir() - { - if (_shouldSerializeisDir) - { - return true; - } - return (_isDir != default(bool)); - } - - /// - /// Test whether track should be serialized - /// - public virtual bool ShouldSerializetrack() - { - if (_shouldSerializetrack) - { - return true; - } - return (_track != default(int)); - } - - /// - /// Test whether year should be serialized - /// - public virtual bool ShouldSerializeyear() - { - if (_shouldSerializeyear) - { - return true; - } - return (_year != default(int)); - } - - /// - /// Test whether size should be serialized - /// - public virtual bool ShouldSerializesize() - { - if (_shouldSerializesize) - { - return true; - } - return (_size != default(long)); - } - - /// - /// Test whether duration should be serialized - /// - public virtual bool ShouldSerializeduration() - { - if (_shouldSerializeduration) - { - return true; - } - return (_duration != default(int)); - } - - /// - /// Test whether bitRate should be serialized - /// - public virtual bool ShouldSerializebitRate() - { - if (_shouldSerializebitRate) - { - return true; - } - return (_bitRate != default(int)); - } - - /// - /// Test whether isVideo should be serialized - /// - public virtual bool ShouldSerializeisVideo() - { - if (_shouldSerializeisVideo) - { - return true; - } - return (_isVideo != default(bool)); - } - - /// - /// Test whether userRating should be serialized - /// - public virtual bool ShouldSerializeuserRating() - { - if (_shouldSerializeuserRating) - { - return true; - } - return (_userRating != default(int)); - } - - /// - /// Test whether averageRating should be serialized - /// - public virtual bool ShouldSerializeaverageRating() - { - if (_shouldSerializeaverageRating) - { - return true; - } - return (_averageRating != default(double)); - } - - /// - /// Test whether playCount should be serialized - /// - public virtual bool ShouldSerializeplayCount() - { - if (_shouldSerializeplayCount) - { - return true; - } - return (_playCount != default(long)); - } - - /// - /// Test whether discNumber should be serialized - /// - public virtual bool ShouldSerializediscNumber() - { - if (_shouldSerializediscNumber) - { - return true; - } - return (_discNumber != default(int)); - } - - /// - /// Test whether created should be serialized - /// - public virtual bool ShouldSerializecreated() - { - if (_shouldSerializecreated) - { - return true; - } - return (_created != default(System.DateTime)); - } - - /// - /// Test whether starred should be serialized - /// - public virtual bool ShouldSerializestarred() - { - if (_shouldSerializestarred) - { - return true; - } - return (_starred != default(System.DateTime)); - } - - /// - /// Test whether bookmarkPosition should be serialized - /// - public virtual bool ShouldSerializebookmarkPosition() - { - if (_shouldSerializebookmarkPosition) - { - return true; - } - return (_bookmarkPosition != default(long)); - } - - /// - /// Test whether originalWidth should be serialized - /// - public virtual bool ShouldSerializeoriginalWidth() - { - if (_shouldSerializeoriginalWidth) - { - return true; - } - return (_originalWidth != default(int)); - } - - /// - /// Test whether originalHeight should be serialized - /// - public virtual bool ShouldSerializeoriginalHeight() - { - if (_shouldSerializeoriginalHeight) - { - return true; - } - return (_originalHeight != default(int)); - } - - /// - /// Test whether type should be serialized - /// - public virtual bool ShouldSerializetype() - { - if (_shouldSerializetype) - { - return true; - } - return (_type != default(MediaType)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether parent should be serialized - /// - public virtual bool ShouldSerializeparent() - { - return !string.IsNullOrEmpty(parent); - } - - /// - /// Test whether title should be serialized - /// - public virtual bool ShouldSerializetitle() - { - return !string.IsNullOrEmpty(title); - } - - /// - /// Test whether album should be serialized - /// - public virtual bool ShouldSerializealbum() - { - return !string.IsNullOrEmpty(album); - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return !string.IsNullOrEmpty(artist); - } - - /// - /// Test whether genre should be serialized - /// - public virtual bool ShouldSerializegenre() - { - return !string.IsNullOrEmpty(genre); - } - - /// - /// Test whether coverArt should be serialized - /// - public virtual bool ShouldSerializecoverArt() - { - return !string.IsNullOrEmpty(coverArt); - } - - /// - /// Test whether contentType should be serialized - /// - public virtual bool ShouldSerializecontentType() - { - return !string.IsNullOrEmpty(contentType); - } - - /// - /// Test whether suffix should be serialized - /// - public virtual bool ShouldSerializesuffix() - { - return !string.IsNullOrEmpty(suffix); - } - - /// - /// Test whether transcodedContentType should be serialized - /// - public virtual bool ShouldSerializetranscodedContentType() - { - return !string.IsNullOrEmpty(transcodedContentType); - } - - /// - /// Test whether transcodedSuffix should be serialized - /// - public virtual bool ShouldSerializetranscodedSuffix() - { - return !string.IsNullOrEmpty(transcodedSuffix); - } - - /// - /// Test whether path should be serialized - /// - public virtual bool ShouldSerializepath() - { - return !string.IsNullOrEmpty(path); - } - - /// - /// Test whether albumId should be serialized - /// - public virtual bool ShouldSerializealbumId() - { - return !string.IsNullOrEmpty(albumId); - } - - /// - /// Test whether artistId should be serialized - /// - public virtual bool ShouldSerializeartistId() - { - return !string.IsNullOrEmpty(artistId); - } - - #region Serialize/Deserialize - /// - /// Serializes current Child object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Child object - /// - /// string workflow markup to deserialize - /// Output Child object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Child obj, out System.Exception exception) - { - exception = null; - obj = default(Child); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Child obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Child Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Child)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Child Deserialize(System.IO.Stream s) - { - return ((Child)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Child object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Child object - /// - /// string xml file to load and deserialize - /// Output Child object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Child obj, out System.Exception exception) - { - exception = null; - obj = default(Child); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Child obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Child obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Child LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Child LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public enum MediaType - { - - /// - music, - - /// - podcast, - - /// - audiobook, - - /// - video, - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Error - { - - private bool _shouldSerializecode; - - private int _code; - - private string _message; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int code - { - get - { - return this._code; - } - set - { - this._code = value; - _shouldSerializecode = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string message - { - get - { - return this._message; - } - set - { - this._message = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Error)); - } - return serializer; - } - } - - /// - /// Test whether code should be serialized - /// - public virtual bool ShouldSerializecode() - { - if (_shouldSerializecode) - { - return true; - } - return (_code != default(int)); - } - - /// - /// Test whether message should be serialized - /// - public virtual bool ShouldSerializemessage() - { - return !string.IsNullOrEmpty(message); - } - - #region Serialize/Deserialize - /// - /// Serializes current Error object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Error object - /// - /// string workflow markup to deserialize - /// Output Error object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Error obj, out System.Exception exception) - { - exception = null; - obj = default(Error); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Error obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Error Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Error)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Error Deserialize(System.IO.Stream s) - { - return ((Error)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Error object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Error object - /// - /// string xml file to load and deserialize - /// Output Error object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Error obj, out System.Exception exception) - { - exception = null; - obj = default(Error); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Error obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Error obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Error LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Error LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class TopSongs - { - - private List _song; - - private static XmlSerializer serializer; - - public TopSongs() - { - this._song = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(TopSongs)); - } - return serializer; - } - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current TopSongs object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an TopSongs object - /// - /// string workflow markup to deserialize - /// Output TopSongs object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out TopSongs obj, out System.Exception exception) - { - exception = null; - obj = default(TopSongs); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out TopSongs obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static TopSongs Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((TopSongs)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static TopSongs Deserialize(System.IO.Stream s) - { - return ((TopSongs)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current TopSongs object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an TopSongs object - /// - /// string xml file to load and deserialize - /// Output TopSongs object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out TopSongs obj, out System.Exception exception) - { - exception = null; - obj = default(TopSongs); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out TopSongs obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out TopSongs obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static TopSongs LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static TopSongs LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class SimilarSongs2 - { - - private List _song; - - private static XmlSerializer serializer; - - public SimilarSongs2() - { - this._song = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(SimilarSongs2)); - } - return serializer; - } - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current SimilarSongs2 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an SimilarSongs2 object - /// - /// string workflow markup to deserialize - /// Output SimilarSongs2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out SimilarSongs2 obj, out System.Exception exception) - { - exception = null; - obj = default(SimilarSongs2); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out SimilarSongs2 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static SimilarSongs2 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((SimilarSongs2)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static SimilarSongs2 Deserialize(System.IO.Stream s) - { - return ((SimilarSongs2)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current SimilarSongs2 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an SimilarSongs2 object - /// - /// string xml file to load and deserialize - /// Output SimilarSongs2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out SimilarSongs2 obj, out System.Exception exception) - { - exception = null; - obj = default(SimilarSongs2); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out SimilarSongs2 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out SimilarSongs2 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static SimilarSongs2 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static SimilarSongs2 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class SimilarSongs - { - - private List _song; - - private static XmlSerializer serializer; - - public SimilarSongs() - { - this._song = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(SimilarSongs)); - } - return serializer; - } - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current SimilarSongs object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an SimilarSongs object - /// - /// string workflow markup to deserialize - /// Output SimilarSongs object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out SimilarSongs obj, out System.Exception exception) - { - exception = null; - obj = default(SimilarSongs); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out SimilarSongs obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static SimilarSongs Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((SimilarSongs)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static SimilarSongs Deserialize(System.IO.Stream s) - { - return ((SimilarSongs)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current SimilarSongs object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an SimilarSongs object - /// - /// string xml file to load and deserialize - /// Output SimilarSongs object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out SimilarSongs obj, out System.Exception exception) - { - exception = null; - obj = default(SimilarSongs); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out SimilarSongs obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out SimilarSongs obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static SimilarSongs LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static SimilarSongs LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArtistInfo2))] - [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArtistInfo))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class ArtistInfoBase - { - - private string _biography; - - private string _musicBrainzId; - - private string _lastFmUrl; - - private string _smallImageUrl; - - private string _mediumImageUrl; - - private string _largeImageUrl; - - private static XmlSerializer serializer; - - public string biography - { - get - { - return this._biography; - } - set - { - this._biography = value; - } - } - - public string musicBrainzId - { - get - { - return this._musicBrainzId; - } - set - { - this._musicBrainzId = value; - } - } - - public string lastFmUrl - { - get - { - return this._lastFmUrl; - } - set - { - this._lastFmUrl = value; - } - } - - public string smallImageUrl - { - get - { - return this._smallImageUrl; - } - set - { - this._smallImageUrl = value; - } - } - - public string mediumImageUrl - { - get - { - return this._mediumImageUrl; - } - set - { - this._mediumImageUrl = value; - } - } - - public string largeImageUrl - { - get - { - return this._largeImageUrl; - } - set - { - this._largeImageUrl = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(ArtistInfoBase)); - } - return serializer; - } - } - - /// - /// Test whether biography should be serialized - /// - public virtual bool ShouldSerializebiography() - { - return !string.IsNullOrEmpty(biography); - } - - /// - /// Test whether musicBrainzId should be serialized - /// - public virtual bool ShouldSerializemusicBrainzId() - { - return !string.IsNullOrEmpty(musicBrainzId); - } - - /// - /// Test whether lastFmUrl should be serialized - /// - public virtual bool ShouldSerializelastFmUrl() - { - return !string.IsNullOrEmpty(lastFmUrl); - } - - /// - /// Test whether smallImageUrl should be serialized - /// - public virtual bool ShouldSerializesmallImageUrl() - { - return !string.IsNullOrEmpty(smallImageUrl); - } - - /// - /// Test whether mediumImageUrl should be serialized - /// - public virtual bool ShouldSerializemediumImageUrl() - { - return !string.IsNullOrEmpty(mediumImageUrl); - } - - /// - /// Test whether largeImageUrl should be serialized - /// - public virtual bool ShouldSerializelargeImageUrl() - { - return !string.IsNullOrEmpty(largeImageUrl); - } - - #region Serialize/Deserialize - /// - /// Serializes current ArtistInfoBase object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an ArtistInfoBase object - /// - /// string workflow markup to deserialize - /// Output ArtistInfoBase object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out ArtistInfoBase obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistInfoBase); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out ArtistInfoBase obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static ArtistInfoBase Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((ArtistInfoBase)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static ArtistInfoBase Deserialize(System.IO.Stream s) - { - return ((ArtistInfoBase)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current ArtistInfoBase object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an ArtistInfoBase object - /// - /// string xml file to load and deserialize - /// Output ArtistInfoBase object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out ArtistInfoBase obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistInfoBase); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out ArtistInfoBase obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out ArtistInfoBase obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static ArtistInfoBase LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static ArtistInfoBase LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class ArtistInfo2 : ArtistInfoBase - { - - private List _similarArtist; - - private static XmlSerializer serializer; - - public ArtistInfo2() - { - this._similarArtist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("similarArtist")] - public List similarArtist - { - get - { - return this._similarArtist; - } - set - { - this._similarArtist = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(ArtistInfo2)); - } - return serializer; - } - } - - /// - /// Test whether similarArtist should be serialized - /// - public virtual bool ShouldSerializesimilarArtist() - { - return similarArtist != null && similarArtist.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current ArtistInfo2 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an ArtistInfo2 object - /// - /// string workflow markup to deserialize - /// Output ArtistInfo2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out ArtistInfo2 obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistInfo2); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out ArtistInfo2 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public new static ArtistInfo2 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((ArtistInfo2)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static ArtistInfo2 Deserialize(System.IO.Stream s) - { - return ((ArtistInfo2)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current ArtistInfo2 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an ArtistInfo2 object - /// - /// string xml file to load and deserialize - /// Output ArtistInfo2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out ArtistInfo2 obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistInfo2); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out ArtistInfo2 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out ArtistInfo2 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static ArtistInfo2 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public new static ArtistInfo2 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArtistWithAlbumsID3))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class ArtistID3 - { - - private bool _shouldSerializestarred; - - private bool _shouldSerializealbumCount; - - private string _id; - - private string _name; - - private string _coverArt; - - private int _albumCount; - - private System.DateTime _starred; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string coverArt - { - get - { - return this._coverArt; - } - set - { - this._coverArt = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int albumCount - { - get - { - return this._albumCount; - } - set - { - this._albumCount = value; - _shouldSerializealbumCount = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime starred - { - get - { - return this._starred; - } - set - { - this._starred = value; - _shouldSerializestarred = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(ArtistID3)); - } - return serializer; - } - } - - /// - /// Test whether albumCount should be serialized - /// - public virtual bool ShouldSerializealbumCount() - { - if (_shouldSerializealbumCount) - { - return true; - } - return (_albumCount != default(int)); - } - - /// - /// Test whether starred should be serialized - /// - public virtual bool ShouldSerializestarred() - { - if (_shouldSerializestarred) - { - return true; - } - return (_starred != default(System.DateTime)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - /// - /// Test whether coverArt should be serialized - /// - public virtual bool ShouldSerializecoverArt() - { - return !string.IsNullOrEmpty(coverArt); - } - - #region Serialize/Deserialize - /// - /// Serializes current ArtistID3 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an ArtistID3 object - /// - /// string workflow markup to deserialize - /// Output ArtistID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out ArtistID3 obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistID3); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out ArtistID3 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static ArtistID3 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((ArtistID3)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static ArtistID3 Deserialize(System.IO.Stream s) - { - return ((ArtistID3)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current ArtistID3 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an ArtistID3 object - /// - /// string xml file to load and deserialize - /// Output ArtistID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out ArtistID3 obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistID3); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out ArtistID3 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out ArtistID3 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static ArtistID3 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static ArtistID3 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class ArtistWithAlbumsID3 : ArtistID3 - { - - private List _album; - - private static XmlSerializer serializer; - - public ArtistWithAlbumsID3() - { - this._album = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("album")] - public List album - { - get - { - return this._album; - } - set - { - this._album = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(ArtistWithAlbumsID3)); - } - return serializer; - } - } - - /// - /// Test whether album should be serialized - /// - public virtual bool ShouldSerializealbum() - { - return album != null && album.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current ArtistWithAlbumsID3 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an ArtistWithAlbumsID3 object - /// - /// string workflow markup to deserialize - /// Output ArtistWithAlbumsID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out ArtistWithAlbumsID3 obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistWithAlbumsID3); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out ArtistWithAlbumsID3 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public new static ArtistWithAlbumsID3 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((ArtistWithAlbumsID3)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static ArtistWithAlbumsID3 Deserialize(System.IO.Stream s) - { - return ((ArtistWithAlbumsID3)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current ArtistWithAlbumsID3 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an ArtistWithAlbumsID3 object - /// - /// string xml file to load and deserialize - /// Output ArtistWithAlbumsID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out ArtistWithAlbumsID3 obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistWithAlbumsID3); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out ArtistWithAlbumsID3 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out ArtistWithAlbumsID3 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static ArtistWithAlbumsID3 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public new static ArtistWithAlbumsID3 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlbumWithSongsID3))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class AlbumID3 - { - - private bool _shouldSerializeyear; - - private bool _shouldSerializestarred; - - private bool _shouldSerializecreated; - - private bool _shouldSerializeplayCount; - - private bool _shouldSerializeduration; - - private bool _shouldSerializesongCount; - - private string _id; - - private string _name; - - private string _artist; - - private string _artistId; - - private string _coverArt; - - private int _songCount; - - private int _duration; - - private long _playCount; - - private System.DateTime _created; - - private System.DateTime _starred; - - private int _year; - - private string _genre; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string artistId - { - get - { - return this._artistId; - } - set - { - this._artistId = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string coverArt - { - get - { - return this._coverArt; - } - set - { - this._coverArt = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int songCount - { - get - { - return this._songCount; - } - set - { - this._songCount = value; - _shouldSerializesongCount = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int duration - { - get - { - return this._duration; - } - set - { - this._duration = value; - _shouldSerializeduration = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long playCount - { - get - { - return this._playCount; - } - set - { - this._playCount = value; - _shouldSerializeplayCount = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime created - { - get - { - return this._created; - } - set - { - this._created = value; - _shouldSerializecreated = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime starred - { - get - { - return this._starred; - } - set - { - this._starred = value; - _shouldSerializestarred = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int year - { - get - { - return this._year; - } - set - { - this._year = value; - _shouldSerializeyear = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string genre - { - get - { - return this._genre; - } - set - { - this._genre = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(AlbumID3)); - } - return serializer; - } - } - - /// - /// Test whether songCount should be serialized - /// - public virtual bool ShouldSerializesongCount() - { - if (_shouldSerializesongCount) - { - return true; - } - return (_songCount != default(int)); - } - - /// - /// Test whether duration should be serialized - /// - public virtual bool ShouldSerializeduration() - { - if (_shouldSerializeduration) - { - return true; - } - return (_duration != default(int)); - } - - /// - /// Test whether playCount should be serialized - /// - public virtual bool ShouldSerializeplayCount() - { - if (_shouldSerializeplayCount) - { - return true; - } - return (_playCount != default(long)); - } - - /// - /// Test whether created should be serialized - /// - public virtual bool ShouldSerializecreated() - { - if (_shouldSerializecreated) - { - return true; - } - return (_created != default(System.DateTime)); - } - - /// - /// Test whether starred should be serialized - /// - public virtual bool ShouldSerializestarred() - { - if (_shouldSerializestarred) - { - return true; - } - return (_starred != default(System.DateTime)); - } - - /// - /// Test whether year should be serialized - /// - public virtual bool ShouldSerializeyear() - { - if (_shouldSerializeyear) - { - return true; - } - return (_year != default(int)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return !string.IsNullOrEmpty(artist); - } - - /// - /// Test whether artistId should be serialized - /// - public virtual bool ShouldSerializeartistId() - { - return !string.IsNullOrEmpty(artistId); - } - - /// - /// Test whether coverArt should be serialized - /// - public virtual bool ShouldSerializecoverArt() - { - return !string.IsNullOrEmpty(coverArt); - } - - /// - /// Test whether genre should be serialized - /// - public virtual bool ShouldSerializegenre() - { - return !string.IsNullOrEmpty(genre); - } - - #region Serialize/Deserialize - /// - /// Serializes current AlbumID3 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an AlbumID3 object - /// - /// string workflow markup to deserialize - /// Output AlbumID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out AlbumID3 obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumID3); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out AlbumID3 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static AlbumID3 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((AlbumID3)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static AlbumID3 Deserialize(System.IO.Stream s) - { - return ((AlbumID3)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current AlbumID3 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an AlbumID3 object - /// - /// string xml file to load and deserialize - /// Output AlbumID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out AlbumID3 obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumID3); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out AlbumID3 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out AlbumID3 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static AlbumID3 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static AlbumID3 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class ArtistInfo : ArtistInfoBase - { - - private List _similarArtist; - - private static XmlSerializer serializer; - - public ArtistInfo() - { - this._similarArtist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("similarArtist")] - public List similarArtist - { - get - { - return this._similarArtist; - } - set - { - this._similarArtist = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(ArtistInfo)); - } - return serializer; - } - } - - /// - /// Test whether similarArtist should be serialized - /// - public virtual bool ShouldSerializesimilarArtist() - { - return similarArtist != null && similarArtist.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current ArtistInfo object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an ArtistInfo object - /// - /// string workflow markup to deserialize - /// Output ArtistInfo object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out ArtistInfo obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistInfo); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out ArtistInfo obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public new static ArtistInfo Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((ArtistInfo)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static ArtistInfo Deserialize(System.IO.Stream s) - { - return ((ArtistInfo)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current ArtistInfo object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an ArtistInfo object - /// - /// string xml file to load and deserialize - /// Output ArtistInfo object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out ArtistInfo obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistInfo); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out ArtistInfo obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out ArtistInfo obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static ArtistInfo LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public new static ArtistInfo LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Artist - { - - private bool _shouldSerializeaverageRating; - - private bool _shouldSerializeuserRating; - - private bool _shouldSerializestarred; - - private string _id; - - private string _name; - - private System.DateTime _starred; - - private int _userRating; - - private double _averageRating; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime starred - { - get - { - return this._starred; - } - set - { - this._starred = value; - _shouldSerializestarred = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int userRating - { - get - { - return this._userRating; - } - set - { - this._userRating = value; - _shouldSerializeuserRating = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public double averageRating - { - get - { - return this._averageRating; - } - set - { - this._averageRating = value; - _shouldSerializeaverageRating = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Artist)); - } - return serializer; - } - } - - /// - /// Test whether starred should be serialized - /// - public virtual bool ShouldSerializestarred() - { - if (_shouldSerializestarred) - { - return true; - } - return (_starred != default(System.DateTime)); - } - - /// - /// Test whether userRating should be serialized - /// - public virtual bool ShouldSerializeuserRating() - { - if (_shouldSerializeuserRating) - { - return true; - } - return (_userRating != default(int)); - } - - /// - /// Test whether averageRating should be serialized - /// - public virtual bool ShouldSerializeaverageRating() - { - if (_shouldSerializeaverageRating) - { - return true; - } - return (_averageRating != default(double)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - #region Serialize/Deserialize - /// - /// Serializes current Artist object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Artist object - /// - /// string workflow markup to deserialize - /// Output Artist object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Artist obj, out System.Exception exception) - { - exception = null; - obj = default(Artist); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Artist obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Artist Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Artist)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Artist Deserialize(System.IO.Stream s) - { - return ((Artist)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Artist object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Artist object - /// - /// string xml file to load and deserialize - /// Output Artist object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Artist obj, out System.Exception exception) - { - exception = null; - obj = default(Artist); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Artist obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Artist obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Artist LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Artist LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class AlbumInfo - { - - private string _notes; - - private string _musicBrainzId; - - private string _lastFmUrl; - - private string _smallImageUrl; - - private string _mediumImageUrl; - - private string _largeImageUrl; - - private static XmlSerializer serializer; - - public string notes - { - get - { - return this._notes; - } - set - { - this._notes = value; - } - } - - public string musicBrainzId - { - get - { - return this._musicBrainzId; - } - set - { - this._musicBrainzId = value; - } - } - - public string lastFmUrl - { - get - { - return this._lastFmUrl; - } - set - { - this._lastFmUrl = value; - } - } - - public string smallImageUrl - { - get - { - return this._smallImageUrl; - } - set - { - this._smallImageUrl = value; - } - } - - public string mediumImageUrl - { - get - { - return this._mediumImageUrl; - } - set - { - this._mediumImageUrl = value; - } - } - - public string largeImageUrl - { - get - { - return this._largeImageUrl; - } - set - { - this._largeImageUrl = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(AlbumInfo)); - } - return serializer; - } - } - - /// - /// Test whether notes should be serialized - /// - public virtual bool ShouldSerializenotes() - { - return !string.IsNullOrEmpty(notes); - } - - /// - /// Test whether musicBrainzId should be serialized - /// - public virtual bool ShouldSerializemusicBrainzId() - { - return !string.IsNullOrEmpty(musicBrainzId); - } - - /// - /// Test whether lastFmUrl should be serialized - /// - public virtual bool ShouldSerializelastFmUrl() - { - return !string.IsNullOrEmpty(lastFmUrl); - } - - /// - /// Test whether smallImageUrl should be serialized - /// - public virtual bool ShouldSerializesmallImageUrl() - { - return !string.IsNullOrEmpty(smallImageUrl); - } - - /// - /// Test whether mediumImageUrl should be serialized - /// - public virtual bool ShouldSerializemediumImageUrl() - { - return !string.IsNullOrEmpty(mediumImageUrl); - } - - /// - /// Test whether largeImageUrl should be serialized - /// - public virtual bool ShouldSerializelargeImageUrl() - { - return !string.IsNullOrEmpty(largeImageUrl); - } - - #region Serialize/Deserialize - /// - /// Serializes current AlbumInfo object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an AlbumInfo object - /// - /// string workflow markup to deserialize - /// Output AlbumInfo object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out AlbumInfo obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumInfo); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out AlbumInfo obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static AlbumInfo Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((AlbumInfo)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static AlbumInfo Deserialize(System.IO.Stream s) - { - return ((AlbumInfo)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current AlbumInfo object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an AlbumInfo object - /// - /// string xml file to load and deserialize - /// Output AlbumInfo object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out AlbumInfo obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumInfo); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out AlbumInfo obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out AlbumInfo obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static AlbumInfo LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static AlbumInfo LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Starred2 - { - - private List _artist; - - private List _album; - - private List _song; - - private static XmlSerializer serializer; - - public Starred2() - { - this._song = new List(); - this._album = new List(); - this._artist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("artist")] - public List artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("album")] - public List album - { - get - { - return this._album; - } - set - { - this._album = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Starred2)); - } - return serializer; - } - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return artist != null && artist.Count > 0; - } - - /// - /// Test whether album should be serialized - /// - public virtual bool ShouldSerializealbum() - { - return album != null && album.Count > 0; - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Starred2 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Starred2 object - /// - /// string workflow markup to deserialize - /// Output Starred2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Starred2 obj, out System.Exception exception) - { - exception = null; - obj = default(Starred2); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Starred2 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Starred2 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Starred2)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Starred2 Deserialize(System.IO.Stream s) - { - return ((Starred2)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Starred2 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Starred2 object - /// - /// string xml file to load and deserialize - /// Output Starred2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Starred2 obj, out System.Exception exception) - { - exception = null; - obj = default(Starred2); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Starred2 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Starred2 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Starred2 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Starred2 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Starred - { - - private List _artist; - - private List _album; - - private List _song; - - private static XmlSerializer serializer; - - public Starred() - { - this._song = new List(); - this._album = new List(); - this._artist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("artist")] - public List artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("album")] - public List album - { - get - { - return this._album; - } - set - { - this._album = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Starred)); - } - return serializer; - } - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return artist != null && artist.Count > 0; - } - - /// - /// Test whether album should be serialized - /// - public virtual bool ShouldSerializealbum() - { - return album != null && album.Count > 0; - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Starred object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Starred object - /// - /// string workflow markup to deserialize - /// Output Starred object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Starred obj, out System.Exception exception) - { - exception = null; - obj = default(Starred); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Starred obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Starred Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Starred)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Starred Deserialize(System.IO.Stream s) - { - return ((Starred)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Starred object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Starred object - /// - /// string xml file to load and deserialize - /// Output Starred object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Starred obj, out System.Exception exception) - { - exception = null; - obj = default(Starred); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Starred obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Starred obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Starred LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Starred LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Shares - { - - private List _share; - - private static XmlSerializer serializer; - - public Shares() - { - this._share = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("share")] - public List share - { - get - { - return this._share; - } - set - { - this._share = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Shares)); - } - return serializer; - } - } - - /// - /// Test whether share should be serialized - /// - public virtual bool ShouldSerializeshare() - { - return share != null && share.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Shares object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Shares object - /// - /// string workflow markup to deserialize - /// Output Shares object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Shares obj, out System.Exception exception) - { - exception = null; - obj = default(Shares); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Shares obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Shares Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Shares)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Shares Deserialize(System.IO.Stream s) - { - return ((Shares)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Shares object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Shares object - /// - /// string xml file to load and deserialize - /// Output Shares object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Shares obj, out System.Exception exception) - { - exception = null; - obj = default(Shares); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Shares obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Shares obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Shares LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Shares LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Share - { - - private bool _shouldSerializevisitCount; - - private bool _shouldSerializelastVisited; - - private bool _shouldSerializeexpires; - - private bool _shouldSerializecreated; - - private List _entry; - - private string _id; - - private string _url; - - private string _description; - - private string _username; - - private System.DateTime _created; - - private System.DateTime _expires; - - private System.DateTime _lastVisited; - - private int _visitCount; - - private static XmlSerializer serializer; - - public Share() - { - this._entry = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("entry")] - public List entry - { - get - { - return this._entry; - } - set - { - this._entry = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string url - { - get - { - return this._url; - } - set - { - this._url = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string description - { - get - { - return this._description; - } - set - { - this._description = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string username - { - get - { - return this._username; - } - set - { - this._username = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime created - { - get - { - return this._created; - } - set - { - this._created = value; - _shouldSerializecreated = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime expires - { - get - { - return this._expires; - } - set - { - this._expires = value; - _shouldSerializeexpires = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime lastVisited - { - get - { - return this._lastVisited; - } - set - { - this._lastVisited = value; - _shouldSerializelastVisited = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int visitCount - { - get - { - return this._visitCount; - } - set - { - this._visitCount = value; - _shouldSerializevisitCount = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Share)); - } - return serializer; - } - } - - /// - /// Test whether entry should be serialized - /// - public virtual bool ShouldSerializeentry() - { - return entry != null && entry.Count > 0; - } - - /// - /// Test whether created should be serialized - /// - public virtual bool ShouldSerializecreated() - { - if (_shouldSerializecreated) - { - return true; - } - return (_created != default(System.DateTime)); - } - - /// - /// Test whether expires should be serialized - /// - public virtual bool ShouldSerializeexpires() - { - if (_shouldSerializeexpires) - { - return true; - } - return (_expires != default(System.DateTime)); - } - - /// - /// Test whether lastVisited should be serialized - /// - public virtual bool ShouldSerializelastVisited() - { - if (_shouldSerializelastVisited) - { - return true; - } - return (_lastVisited != default(System.DateTime)); - } - - /// - /// Test whether visitCount should be serialized - /// - public virtual bool ShouldSerializevisitCount() - { - if (_shouldSerializevisitCount) - { - return true; - } - return (_visitCount != default(int)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether url should be serialized - /// - public virtual bool ShouldSerializeurl() - { - return !string.IsNullOrEmpty(url); - } - - /// - /// Test whether description should be serialized - /// - public virtual bool ShouldSerializedescription() - { - return !string.IsNullOrEmpty(description); - } - - /// - /// Test whether username should be serialized - /// - public virtual bool ShouldSerializeusername() - { - return !string.IsNullOrEmpty(username); - } - - #region Serialize/Deserialize - /// - /// Serializes current Share object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Share object - /// - /// string workflow markup to deserialize - /// Output Share object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Share obj, out System.Exception exception) - { - exception = null; - obj = default(Share); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Share obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Share Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Share)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Share Deserialize(System.IO.Stream s) - { - return ((Share)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Share object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Share object - /// - /// string xml file to load and deserialize - /// Output Share object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Share obj, out System.Exception exception) - { - exception = null; - obj = default(Share); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Share obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Share obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Share LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Share LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class PlayQueue - { - - private bool _shouldSerializechanged; - - private bool _shouldSerializeposition; - - private bool _shouldSerializecurrent; - - private List _entry; - - private int _current; - - private long _position; - - private string _username; - - private System.DateTime _changed; - - private string _changedBy; - - private static XmlSerializer serializer; - - public PlayQueue() - { - this._entry = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("entry")] - public List entry - { - get - { - return this._entry; - } - set - { - this._entry = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int current - { - get - { - return this._current; - } - set - { - this._current = value; - _shouldSerializecurrent = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long position - { - get - { - return this._position; - } - set - { - this._position = value; - _shouldSerializeposition = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string username - { - get - { - return this._username; - } - set - { - this._username = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime changed - { - get - { - return this._changed; - } - set - { - this._changed = value; - _shouldSerializechanged = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string changedBy - { - get - { - return this._changedBy; - } - set - { - this._changedBy = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(PlayQueue)); - } - return serializer; - } - } - - /// - /// Test whether entry should be serialized - /// - public virtual bool ShouldSerializeentry() - { - return entry != null && entry.Count > 0; - } - - /// - /// Test whether current should be serialized - /// - public virtual bool ShouldSerializecurrent() - { - if (_shouldSerializecurrent) - { - return true; - } - return (_current != default(int)); - } - - /// - /// Test whether position should be serialized - /// - public virtual bool ShouldSerializeposition() - { - if (_shouldSerializeposition) - { - return true; - } - return (_position != default(long)); - } - - /// - /// Test whether changed should be serialized - /// - public virtual bool ShouldSerializechanged() - { - if (_shouldSerializechanged) - { - return true; - } - return (_changed != default(System.DateTime)); - } - - /// - /// Test whether username should be serialized - /// - public virtual bool ShouldSerializeusername() - { - return !string.IsNullOrEmpty(username); - } - - /// - /// Test whether changedBy should be serialized - /// - public virtual bool ShouldSerializechangedBy() - { - return !string.IsNullOrEmpty(changedBy); - } - - #region Serialize/Deserialize - /// - /// Serializes current PlayQueue object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an PlayQueue object - /// - /// string workflow markup to deserialize - /// Output PlayQueue object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out PlayQueue obj, out System.Exception exception) - { - exception = null; - obj = default(PlayQueue); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out PlayQueue obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static PlayQueue Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((PlayQueue)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static PlayQueue Deserialize(System.IO.Stream s) - { - return ((PlayQueue)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current PlayQueue object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an PlayQueue object - /// - /// string xml file to load and deserialize - /// Output PlayQueue object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out PlayQueue obj, out System.Exception exception) - { - exception = null; - obj = default(PlayQueue); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out PlayQueue obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out PlayQueue obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static PlayQueue LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static PlayQueue LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Bookmarks - { - - private List _bookmark; - - private static XmlSerializer serializer; - - public Bookmarks() - { - this._bookmark = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("bookmark")] - public List bookmark - { - get - { - return this._bookmark; - } - set - { - this._bookmark = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Bookmarks)); - } - return serializer; - } - } - - /// - /// Test whether bookmark should be serialized - /// - public virtual bool ShouldSerializebookmark() - { - return bookmark != null && bookmark.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Bookmarks object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Bookmarks object - /// - /// string workflow markup to deserialize - /// Output Bookmarks object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Bookmarks obj, out System.Exception exception) - { - exception = null; - obj = default(Bookmarks); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Bookmarks obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Bookmarks Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Bookmarks)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Bookmarks Deserialize(System.IO.Stream s) - { - return ((Bookmarks)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Bookmarks object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Bookmarks object - /// - /// string xml file to load and deserialize - /// Output Bookmarks object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Bookmarks obj, out System.Exception exception) - { - exception = null; - obj = default(Bookmarks); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Bookmarks obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Bookmarks obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Bookmarks LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Bookmarks LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Bookmark - { - - private bool _shouldSerializechanged; - - private bool _shouldSerializecreated; - - private bool _shouldSerializeposition; - - private Child _entry; - - private long _position; - - private string _username; - - private string _comment; - - private System.DateTime _created; - - private System.DateTime _changed; - - private static XmlSerializer serializer; - - public Bookmark() - { - this._entry = new Child(); - } - - public Child entry - { - get - { - return this._entry; - } - set - { - this._entry = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long position - { - get - { - return this._position; - } - set - { - this._position = value; - _shouldSerializeposition = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string username - { - get - { - return this._username; - } - set - { - this._username = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string comment - { - get - { - return this._comment; - } - set - { - this._comment = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime created - { - get - { - return this._created; - } - set - { - this._created = value; - _shouldSerializecreated = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime changed - { - get - { - return this._changed; - } - set - { - this._changed = value; - _shouldSerializechanged = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Bookmark)); - } - return serializer; - } - } - - /// - /// Test whether position should be serialized - /// - public virtual bool ShouldSerializeposition() - { - if (_shouldSerializeposition) - { - return true; - } - return (_position != default(long)); - } - - /// - /// Test whether created should be serialized - /// - public virtual bool ShouldSerializecreated() - { - if (_shouldSerializecreated) - { - return true; - } - return (_created != default(System.DateTime)); - } - - /// - /// Test whether changed should be serialized - /// - public virtual bool ShouldSerializechanged() - { - if (_shouldSerializechanged) - { - return true; - } - return (_changed != default(System.DateTime)); - } - - /// - /// Test whether entry should be serialized - /// - public virtual bool ShouldSerializeentry() - { - return (_entry != null); - } - - /// - /// Test whether username should be serialized - /// - public virtual bool ShouldSerializeusername() - { - return !string.IsNullOrEmpty(username); - } - - /// - /// Test whether comment should be serialized - /// - public virtual bool ShouldSerializecomment() - { - return !string.IsNullOrEmpty(comment); - } - - #region Serialize/Deserialize - /// - /// Serializes current Bookmark object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Bookmark object - /// - /// string workflow markup to deserialize - /// Output Bookmark object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Bookmark obj, out System.Exception exception) - { - exception = null; - obj = default(Bookmark); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Bookmark obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Bookmark Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Bookmark)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Bookmark Deserialize(System.IO.Stream s) - { - return ((Bookmark)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Bookmark object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Bookmark object - /// - /// string xml file to load and deserialize - /// Output Bookmark object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Bookmark obj, out System.Exception exception) - { - exception = null; - obj = default(Bookmark); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Bookmark obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Bookmark obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Bookmark LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Bookmark LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class InternetRadioStations - { - - private List _internetRadioStation; - - private static XmlSerializer serializer; - - public InternetRadioStations() - { - this._internetRadioStation = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("internetRadioStation")] - public List internetRadioStation - { - get - { - return this._internetRadioStation; - } - set - { - this._internetRadioStation = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(InternetRadioStations)); - } - return serializer; - } - } - - /// - /// Test whether internetRadioStation should be serialized - /// - public virtual bool ShouldSerializeinternetRadioStation() - { - return internetRadioStation != null && internetRadioStation.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current InternetRadioStations object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an InternetRadioStations object - /// - /// string workflow markup to deserialize - /// Output InternetRadioStations object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out InternetRadioStations obj, out System.Exception exception) - { - exception = null; - obj = default(InternetRadioStations); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out InternetRadioStations obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static InternetRadioStations Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((InternetRadioStations)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static InternetRadioStations Deserialize(System.IO.Stream s) - { - return ((InternetRadioStations)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current InternetRadioStations object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an InternetRadioStations object - /// - /// string xml file to load and deserialize - /// Output InternetRadioStations object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out InternetRadioStations obj, out System.Exception exception) - { - exception = null; - obj = default(InternetRadioStations); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out InternetRadioStations obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out InternetRadioStations obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static InternetRadioStations LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static InternetRadioStations LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class InternetRadioStation - { - - private string _id; - - private string _name; - - private string _streamUrl; - - private string _homePageUrl; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string streamUrl - { - get - { - return this._streamUrl; - } - set - { - this._streamUrl = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string homePageUrl - { - get - { - return this._homePageUrl; - } - set - { - this._homePageUrl = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(InternetRadioStation)); - } - return serializer; - } - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - /// - /// Test whether streamUrl should be serialized - /// - public virtual bool ShouldSerializestreamUrl() - { - return !string.IsNullOrEmpty(streamUrl); - } - - /// - /// Test whether homePageUrl should be serialized - /// - public virtual bool ShouldSerializehomePageUrl() - { - return !string.IsNullOrEmpty(homePageUrl); - } - - #region Serialize/Deserialize - /// - /// Serializes current InternetRadioStation object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an InternetRadioStation object - /// - /// string workflow markup to deserialize - /// Output InternetRadioStation object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out InternetRadioStation obj, out System.Exception exception) - { - exception = null; - obj = default(InternetRadioStation); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out InternetRadioStation obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static InternetRadioStation Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((InternetRadioStation)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static InternetRadioStation Deserialize(System.IO.Stream s) - { - return ((InternetRadioStation)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current InternetRadioStation object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an InternetRadioStation object - /// - /// string xml file to load and deserialize - /// Output InternetRadioStation object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out InternetRadioStation obj, out System.Exception exception) - { - exception = null; - obj = default(InternetRadioStation); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out InternetRadioStation obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out InternetRadioStation obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static InternetRadioStation LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static InternetRadioStation LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class NewestPodcasts - { - - private List _episode; - - private static XmlSerializer serializer; - - public NewestPodcasts() - { - this._episode = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("episode")] - public List episode - { - get - { - return this._episode; - } - set - { - this._episode = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(NewestPodcasts)); - } - return serializer; - } - } - - /// - /// Test whether episode should be serialized - /// - public virtual bool ShouldSerializeepisode() - { - return episode != null && episode.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current NewestPodcasts object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an NewestPodcasts object - /// - /// string workflow markup to deserialize - /// Output NewestPodcasts object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out NewestPodcasts obj, out System.Exception exception) - { - exception = null; - obj = default(NewestPodcasts); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out NewestPodcasts obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static NewestPodcasts Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((NewestPodcasts)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static NewestPodcasts Deserialize(System.IO.Stream s) - { - return ((NewestPodcasts)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current NewestPodcasts object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an NewestPodcasts object - /// - /// string xml file to load and deserialize - /// Output NewestPodcasts object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out NewestPodcasts obj, out System.Exception exception) - { - exception = null; - obj = default(NewestPodcasts); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out NewestPodcasts obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out NewestPodcasts obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static NewestPodcasts LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static NewestPodcasts LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class PodcastEpisode : Child - { - - private bool _shouldSerializestatus; - - private bool _shouldSerializepublishDate; - - private string _streamId; - - private string _channelId; - - private string _description; - - private PodcastStatus _status; - - private System.DateTime _publishDate; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string streamId - { - get - { - return this._streamId; - } - set - { - this._streamId = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string channelId - { - get - { - return this._channelId; - } - set - { - this._channelId = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string description - { - get - { - return this._description; - } - set - { - this._description = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public PodcastStatus status - { - get - { - return this._status; - } - set - { - this._status = value; - _shouldSerializestatus = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime publishDate - { - get - { - return this._publishDate; - } - set - { - this._publishDate = value; - _shouldSerializepublishDate = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(PodcastEpisode)); - } - return serializer; - } - } - - /// - /// Test whether publishDate should be serialized - /// - public virtual bool ShouldSerializepublishDate() - { - if (_shouldSerializepublishDate) - { - return true; - } - return (_publishDate != default(System.DateTime)); - } - - /// - /// Test whether status should be serialized - /// - public virtual bool ShouldSerializestatus() - { - if (_shouldSerializestatus) - { - return true; - } - return (_status != default(PodcastStatus)); - } - - /// - /// Test whether streamId should be serialized - /// - public virtual bool ShouldSerializestreamId() - { - return !string.IsNullOrEmpty(streamId); - } - - /// - /// Test whether channelId should be serialized - /// - public virtual bool ShouldSerializechannelId() - { - return !string.IsNullOrEmpty(channelId); - } - - /// - /// Test whether description should be serialized - /// - public virtual bool ShouldSerializedescription() - { - return !string.IsNullOrEmpty(description); - } - - #region Serialize/Deserialize - /// - /// Serializes current PodcastEpisode object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an PodcastEpisode object - /// - /// string workflow markup to deserialize - /// Output PodcastEpisode object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out PodcastEpisode obj, out System.Exception exception) - { - exception = null; - obj = default(PodcastEpisode); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out PodcastEpisode obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public new static PodcastEpisode Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((PodcastEpisode)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static PodcastEpisode Deserialize(System.IO.Stream s) - { - return ((PodcastEpisode)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current PodcastEpisode object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an PodcastEpisode object - /// - /// string xml file to load and deserialize - /// Output PodcastEpisode object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out PodcastEpisode obj, out System.Exception exception) - { - exception = null; - obj = default(PodcastEpisode); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out PodcastEpisode obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out PodcastEpisode obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static PodcastEpisode LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public new static PodcastEpisode LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public enum PodcastStatus - { - - /// - @new, - - /// - downloading, - - /// - completed, - - /// - error, - - /// - deleted, - - /// - skipped, - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Podcasts - { - - private List _channel; - - private static XmlSerializer serializer; - - public Podcasts() - { - this._channel = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("channel")] - public List channel - { - get - { - return this._channel; - } - set - { - this._channel = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Podcasts)); - } - return serializer; - } - } - - /// - /// Test whether channel should be serialized - /// - public virtual bool ShouldSerializechannel() - { - return channel != null && channel.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Podcasts object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Podcasts object - /// - /// string workflow markup to deserialize - /// Output Podcasts object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Podcasts obj, out System.Exception exception) - { - exception = null; - obj = default(Podcasts); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Podcasts obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Podcasts Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Podcasts)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Podcasts Deserialize(System.IO.Stream s) - { - return ((Podcasts)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Podcasts object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Podcasts object - /// - /// string xml file to load and deserialize - /// Output Podcasts object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Podcasts obj, out System.Exception exception) - { - exception = null; - obj = default(Podcasts); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Podcasts obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Podcasts obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Podcasts LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Podcasts LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class PodcastChannel - { - - private bool _shouldSerializestatus; - - private List _episode; - - private string _id; - - private string _url; - - private string _title; - - private string _description; - - private string _coverArt; - - private string _originalImageUrl; - - private PodcastStatus _status; - - private string _errorMessage; - - private static XmlSerializer serializer; - - public PodcastChannel() - { - this._episode = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("episode")] - public List episode - { - get - { - return this._episode; - } - set - { - this._episode = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string url - { - get - { - return this._url; - } - set - { - this._url = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string title - { - get - { - return this._title; - } - set - { - this._title = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string description - { - get - { - return this._description; - } - set - { - this._description = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string coverArt - { - get - { - return this._coverArt; - } - set - { - this._coverArt = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string originalImageUrl - { - get - { - return this._originalImageUrl; - } - set - { - this._originalImageUrl = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public PodcastStatus status - { - get - { - return this._status; - } - set - { - this._status = value; - _shouldSerializestatus = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string errorMessage - { - get - { - return this._errorMessage; - } - set - { - this._errorMessage = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(PodcastChannel)); - } - return serializer; - } - } - - /// - /// Test whether episode should be serialized - /// - public virtual bool ShouldSerializeepisode() - { - return episode != null && episode.Count > 0; - } - - /// - /// Test whether status should be serialized - /// - public virtual bool ShouldSerializestatus() - { - if (_shouldSerializestatus) - { - return true; - } - return (_status != default(PodcastStatus)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether url should be serialized - /// - public virtual bool ShouldSerializeurl() - { - return !string.IsNullOrEmpty(url); - } - - /// - /// Test whether title should be serialized - /// - public virtual bool ShouldSerializetitle() - { - return !string.IsNullOrEmpty(title); - } - - /// - /// Test whether description should be serialized - /// - public virtual bool ShouldSerializedescription() - { - return !string.IsNullOrEmpty(description); - } - - /// - /// Test whether coverArt should be serialized - /// - public virtual bool ShouldSerializecoverArt() - { - return !string.IsNullOrEmpty(coverArt); - } - - /// - /// Test whether originalImageUrl should be serialized - /// - public virtual bool ShouldSerializeoriginalImageUrl() - { - return !string.IsNullOrEmpty(originalImageUrl); - } - - /// - /// Test whether errorMessage should be serialized - /// - public virtual bool ShouldSerializeerrorMessage() - { - return !string.IsNullOrEmpty(errorMessage); - } - - #region Serialize/Deserialize - /// - /// Serializes current PodcastChannel object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an PodcastChannel object - /// - /// string workflow markup to deserialize - /// Output PodcastChannel object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out PodcastChannel obj, out System.Exception exception) - { - exception = null; - obj = default(PodcastChannel); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out PodcastChannel obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static PodcastChannel Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((PodcastChannel)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static PodcastChannel Deserialize(System.IO.Stream s) - { - return ((PodcastChannel)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current PodcastChannel object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an PodcastChannel object - /// - /// string xml file to load and deserialize - /// Output PodcastChannel object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out PodcastChannel obj, out System.Exception exception) - { - exception = null; - obj = default(PodcastChannel); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out PodcastChannel obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out PodcastChannel obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static PodcastChannel LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static PodcastChannel LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Lyrics - { - - private string _artist; - - private string _title; - - private List _text; - - private static XmlSerializer serializer; - - public Lyrics() - { - this._text = new List(); - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string title - { - get - { - return this._title; - } - set - { - this._title = value; - } - } - - [System.Xml.Serialization.XmlTextAttribute()] - public List Text - { - get - { - return this._text; - } - set - { - this._text = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Lyrics)); - } - return serializer; - } - } - - /// - /// Test whether Text should be serialized - /// - public virtual bool ShouldSerializeText() - { - return Text != null && Text.Count > 0; - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return !string.IsNullOrEmpty(artist); - } - - /// - /// Test whether title should be serialized - /// - public virtual bool ShouldSerializetitle() - { - return !string.IsNullOrEmpty(title); - } - - #region Serialize/Deserialize - /// - /// Serializes current Lyrics object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Lyrics object - /// - /// string workflow markup to deserialize - /// Output Lyrics object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Lyrics obj, out System.Exception exception) - { - exception = null; - obj = default(Lyrics); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Lyrics obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Lyrics Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Lyrics)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Lyrics Deserialize(System.IO.Stream s) - { - return ((Lyrics)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Lyrics object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Lyrics object - /// - /// string xml file to load and deserialize - /// Output Lyrics object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Lyrics obj, out System.Exception exception) - { - exception = null; - obj = default(Lyrics); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Lyrics obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Lyrics obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Lyrics LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Lyrics LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Songs - { - - private List _song; - - private static XmlSerializer serializer; - - public Songs() - { - this._song = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Songs)); - } - return serializer; - } - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Songs object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Songs object - /// - /// string workflow markup to deserialize - /// Output Songs object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Songs obj, out System.Exception exception) - { - exception = null; - obj = default(Songs); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Songs obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Songs Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Songs)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Songs Deserialize(System.IO.Stream s) - { - return ((Songs)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Songs object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Songs object - /// - /// string xml file to load and deserialize - /// Output Songs object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Songs obj, out System.Exception exception) - { - exception = null; - obj = default(Songs); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Songs obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Songs obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Songs LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Songs LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class AlbumList2 - { - - private List _album; - - private static XmlSerializer serializer; - - public AlbumList2() - { - this._album = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("album")] - public List album - { - get - { - return this._album; - } - set - { - this._album = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(AlbumList2)); - } - return serializer; - } - } - - /// - /// Test whether album should be serialized - /// - public virtual bool ShouldSerializealbum() - { - return album != null && album.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current AlbumList2 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an AlbumList2 object - /// - /// string workflow markup to deserialize - /// Output AlbumList2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out AlbumList2 obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumList2); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out AlbumList2 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static AlbumList2 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((AlbumList2)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static AlbumList2 Deserialize(System.IO.Stream s) - { - return ((AlbumList2)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current AlbumList2 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an AlbumList2 object - /// - /// string xml file to load and deserialize - /// Output AlbumList2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out AlbumList2 obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumList2); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out AlbumList2 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out AlbumList2 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static AlbumList2 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static AlbumList2 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class AlbumList - { - - private List _album; - - private static XmlSerializer serializer; - - public AlbumList() - { - this._album = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("album")] - public List album - { - get - { - return this._album; - } - set - { - this._album = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(AlbumList)); - } - return serializer; - } - } - - /// - /// Test whether album should be serialized - /// - public virtual bool ShouldSerializealbum() - { - return album != null && album.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current AlbumList object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an AlbumList object - /// - /// string workflow markup to deserialize - /// Output AlbumList object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out AlbumList obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumList); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out AlbumList obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static AlbumList Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((AlbumList)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static AlbumList Deserialize(System.IO.Stream s) - { - return ((AlbumList)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current AlbumList object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an AlbumList object - /// - /// string xml file to load and deserialize - /// Output AlbumList object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out AlbumList obj, out System.Exception exception) - { - exception = null; - obj = default(AlbumList); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out AlbumList obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out AlbumList obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static AlbumList LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static AlbumList LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class ChatMessages - { - - private List _chatMessage; - - private static XmlSerializer serializer; - - public ChatMessages() - { - this._chatMessage = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("chatMessage")] - public List chatMessage - { - get - { - return this._chatMessage; - } - set - { - this._chatMessage = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(ChatMessages)); - } - return serializer; - } - } - - /// - /// Test whether chatMessage should be serialized - /// - public virtual bool ShouldSerializechatMessage() - { - return chatMessage != null && chatMessage.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current ChatMessages object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an ChatMessages object - /// - /// string workflow markup to deserialize - /// Output ChatMessages object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out ChatMessages obj, out System.Exception exception) - { - exception = null; - obj = default(ChatMessages); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out ChatMessages obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static ChatMessages Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((ChatMessages)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static ChatMessages Deserialize(System.IO.Stream s) - { - return ((ChatMessages)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current ChatMessages object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an ChatMessages object - /// - /// string xml file to load and deserialize - /// Output ChatMessages object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out ChatMessages obj, out System.Exception exception) - { - exception = null; - obj = default(ChatMessages); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out ChatMessages obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out ChatMessages obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static ChatMessages LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static ChatMessages LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class ChatMessage - { - - private bool _shouldSerializetime; - - private string _username; - - private long _time; - - private string _message; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string username - { - get - { - return this._username; - } - set - { - this._username = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long time - { - get - { - return this._time; - } - set - { - this._time = value; - _shouldSerializetime = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string message - { - get - { - return this._message; - } - set - { - this._message = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(ChatMessage)); - } - return serializer; - } - } - - /// - /// Test whether time should be serialized - /// - public virtual bool ShouldSerializetime() - { - if (_shouldSerializetime) - { - return true; - } - return (_time != default(long)); - } - - /// - /// Test whether username should be serialized - /// - public virtual bool ShouldSerializeusername() - { - return !string.IsNullOrEmpty(username); - } - - /// - /// Test whether message should be serialized - /// - public virtual bool ShouldSerializemessage() - { - return !string.IsNullOrEmpty(message); - } - - #region Serialize/Deserialize - /// - /// Serializes current ChatMessage object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an ChatMessage object - /// - /// string workflow markup to deserialize - /// Output ChatMessage object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out ChatMessage obj, out System.Exception exception) - { - exception = null; - obj = default(ChatMessage); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out ChatMessage obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static ChatMessage Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((ChatMessage)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static ChatMessage Deserialize(System.IO.Stream s) - { - return ((ChatMessage)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current ChatMessage object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an ChatMessage object - /// - /// string xml file to load and deserialize - /// Output ChatMessage object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out ChatMessage obj, out System.Exception exception) - { - exception = null; - obj = default(ChatMessage); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out ChatMessage obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out ChatMessage obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static ChatMessage LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static ChatMessage LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Users - { - - private List _user; - - private static XmlSerializer serializer; - - public Users() - { - this._user = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("user")] - public List user - { - get - { - return this._user; - } - set - { - this._user = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Users)); - } - return serializer; - } - } - - /// - /// Test whether user should be serialized - /// - public virtual bool ShouldSerializeuser() - { - return user != null && user.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Users object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Users object - /// - /// string workflow markup to deserialize - /// Output Users object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Users obj, out System.Exception exception) - { - exception = null; - obj = default(Users); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Users obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Users Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Users)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Users Deserialize(System.IO.Stream s) - { - return ((Users)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Users object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Users object - /// - /// string xml file to load and deserialize - /// Output Users object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Users obj, out System.Exception exception) - { - exception = null; - obj = default(Users); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Users obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Users obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Users LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Users LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class User - { - - private bool _shouldSerializeavatarLastChanged; - - private bool _shouldSerializevideoConversionRole; - - private bool _shouldSerializeshareRole; - - private bool _shouldSerializejukeboxRole; - - private bool _shouldSerializestreamRole; - - private bool _shouldSerializepodcastRole; - - private bool _shouldSerializecommentRole; - - private bool _shouldSerializecoverArtRole; - - private bool _shouldSerializeplaylistRole; - - private bool _shouldSerializeuploadRole; - - private bool _shouldSerializedownloadRole; - - private bool _shouldSerializesettingsRole; - - private bool _shouldSerializeadminRole; - - private bool _shouldSerializemaxBitRate; - - private bool _shouldSerializescrobblingEnabled; - - private List _folder; - - private string _username; - - private string _email; - - private bool _scrobblingEnabled; - - private int _maxBitRate; - - private bool _adminRole; - - private bool _settingsRole; - - private bool _downloadRole; - - private bool _uploadRole; - - private bool _playlistRole; - - private bool _coverArtRole; - - private bool _commentRole; - - private bool _podcastRole; - - private bool _streamRole; - - private bool _jukeboxRole; - - private bool _shareRole; - - private bool _videoConversionRole; - - private System.DateTime _avatarLastChanged; - - private static XmlSerializer serializer; - - public User() - { - this._folder = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("folder")] - public List folder - { - get - { - return this._folder; - } - set - { - this._folder = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string username - { - get - { - return this._username; - } - set - { - this._username = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string email - { - get - { - return this._email; - } - set - { - this._email = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool scrobblingEnabled - { - get - { - return this._scrobblingEnabled; - } - set - { - this._scrobblingEnabled = value; - _shouldSerializescrobblingEnabled = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int maxBitRate - { - get - { - return this._maxBitRate; - } - set - { - this._maxBitRate = value; - _shouldSerializemaxBitRate = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool adminRole - { - get - { - return this._adminRole; - } - set - { - this._adminRole = value; - _shouldSerializeadminRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool settingsRole - { - get - { - return this._settingsRole; - } - set - { - this._settingsRole = value; - _shouldSerializesettingsRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool downloadRole - { - get - { - return this._downloadRole; - } - set - { - this._downloadRole = value; - _shouldSerializedownloadRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool uploadRole - { - get - { - return this._uploadRole; - } - set - { - this._uploadRole = value; - _shouldSerializeuploadRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool playlistRole - { - get - { - return this._playlistRole; - } - set - { - this._playlistRole = value; - _shouldSerializeplaylistRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool coverArtRole - { - get - { - return this._coverArtRole; - } - set - { - this._coverArtRole = value; - _shouldSerializecoverArtRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool commentRole - { - get - { - return this._commentRole; - } - set - { - this._commentRole = value; - _shouldSerializecommentRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool podcastRole - { - get - { - return this._podcastRole; - } - set - { - this._podcastRole = value; - _shouldSerializepodcastRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool streamRole - { - get - { - return this._streamRole; - } - set - { - this._streamRole = value; - _shouldSerializestreamRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool jukeboxRole - { - get - { - return this._jukeboxRole; - } - set - { - this._jukeboxRole = value; - _shouldSerializejukeboxRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool shareRole - { - get - { - return this._shareRole; - } - set - { - this._shareRole = value; - _shouldSerializeshareRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool videoConversionRole - { - get - { - return this._videoConversionRole; - } - set - { - this._videoConversionRole = value; - _shouldSerializevideoConversionRole = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime avatarLastChanged - { - get - { - return this._avatarLastChanged; - } - set - { - this._avatarLastChanged = value; - _shouldSerializeavatarLastChanged = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(User)); - } - return serializer; - } - } - - /// - /// Test whether folder should be serialized - /// - public virtual bool ShouldSerializefolder() - { - return folder != null && folder.Count > 0; - } - - /// - /// Test whether scrobblingEnabled should be serialized - /// - public virtual bool ShouldSerializescrobblingEnabled() - { - if (_shouldSerializescrobblingEnabled) - { - return true; - } - return (_scrobblingEnabled != default(bool)); - } - - /// - /// Test whether maxBitRate should be serialized - /// - public virtual bool ShouldSerializemaxBitRate() - { - if (_shouldSerializemaxBitRate) - { - return true; - } - return (_maxBitRate != default(int)); - } - - /// - /// Test whether adminRole should be serialized - /// - public virtual bool ShouldSerializeadminRole() - { - if (_shouldSerializeadminRole) - { - return true; - } - return (_adminRole != default(bool)); - } - - /// - /// Test whether settingsRole should be serialized - /// - public virtual bool ShouldSerializesettingsRole() - { - if (_shouldSerializesettingsRole) - { - return true; - } - return (_settingsRole != default(bool)); - } - - /// - /// Test whether downloadRole should be serialized - /// - public virtual bool ShouldSerializedownloadRole() - { - if (_shouldSerializedownloadRole) - { - return true; - } - return (_downloadRole != default(bool)); - } - - /// - /// Test whether uploadRole should be serialized - /// - public virtual bool ShouldSerializeuploadRole() - { - if (_shouldSerializeuploadRole) - { - return true; - } - return (_uploadRole != default(bool)); - } - - /// - /// Test whether playlistRole should be serialized - /// - public virtual bool ShouldSerializeplaylistRole() - { - if (_shouldSerializeplaylistRole) - { - return true; - } - return (_playlistRole != default(bool)); - } - - /// - /// Test whether coverArtRole should be serialized - /// - public virtual bool ShouldSerializecoverArtRole() - { - if (_shouldSerializecoverArtRole) - { - return true; - } - return (_coverArtRole != default(bool)); - } - - /// - /// Test whether commentRole should be serialized - /// - public virtual bool ShouldSerializecommentRole() - { - if (_shouldSerializecommentRole) - { - return true; - } - return (_commentRole != default(bool)); - } - - /// - /// Test whether podcastRole should be serialized - /// - public virtual bool ShouldSerializepodcastRole() - { - if (_shouldSerializepodcastRole) - { - return true; - } - return (_podcastRole != default(bool)); - } - - /// - /// Test whether streamRole should be serialized - /// - public virtual bool ShouldSerializestreamRole() - { - if (_shouldSerializestreamRole) - { - return true; - } - return (_streamRole != default(bool)); - } - - /// - /// Test whether jukeboxRole should be serialized - /// - public virtual bool ShouldSerializejukeboxRole() - { - if (_shouldSerializejukeboxRole) - { - return true; - } - return (_jukeboxRole != default(bool)); - } - - /// - /// Test whether shareRole should be serialized - /// - public virtual bool ShouldSerializeshareRole() - { - if (_shouldSerializeshareRole) - { - return true; - } - return (_shareRole != default(bool)); - } - - /// - /// Test whether videoConversionRole should be serialized - /// - public virtual bool ShouldSerializevideoConversionRole() - { - if (_shouldSerializevideoConversionRole) - { - return true; - } - return (_videoConversionRole != default(bool)); - } - - /// - /// Test whether avatarLastChanged should be serialized - /// - public virtual bool ShouldSerializeavatarLastChanged() - { - if (_shouldSerializeavatarLastChanged) - { - return true; - } - return (_avatarLastChanged != default(System.DateTime)); - } - - /// - /// Test whether username should be serialized - /// - public virtual bool ShouldSerializeusername() - { - return !string.IsNullOrEmpty(username); - } - - /// - /// Test whether email should be serialized - /// - public virtual bool ShouldSerializeemail() - { - return !string.IsNullOrEmpty(email); - } - - #region Serialize/Deserialize - /// - /// Serializes current User object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an User object - /// - /// string workflow markup to deserialize - /// Output User object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out User obj, out System.Exception exception) - { - exception = null; - obj = default(User); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out User obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static User Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((User)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static User Deserialize(System.IO.Stream s) - { - return ((User)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current User object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an User object - /// - /// string xml file to load and deserialize - /// Output User object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out User obj, out System.Exception exception) - { - exception = null; - obj = default(User); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out User obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out User obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static User LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static User LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class License - { - - private bool _shouldSerializetrialExpires; - - private bool _shouldSerializelicenseExpires; - - private bool _shouldSerializevalid; - - private bool _valid; - - private string _email; - - private System.DateTime _licenseExpires; - - private System.DateTime _trialExpires; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool valid - { - get - { - return this._valid; - } - set - { - this._valid = value; - _shouldSerializevalid = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string email - { - get - { - return this._email; - } - set - { - this._email = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime licenseExpires - { - get - { - return this._licenseExpires; - } - set - { - this._licenseExpires = value; - _shouldSerializelicenseExpires = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime trialExpires - { - get - { - return this._trialExpires; - } - set - { - this._trialExpires = value; - _shouldSerializetrialExpires = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(License)); - } - return serializer; - } - } - - /// - /// Test whether valid should be serialized - /// - public virtual bool ShouldSerializevalid() - { - if (_shouldSerializevalid) - { - return true; - } - return (_valid != default(bool)); - } - - /// - /// Test whether licenseExpires should be serialized - /// - public virtual bool ShouldSerializelicenseExpires() - { - if (_shouldSerializelicenseExpires) - { - return true; - } - return (_licenseExpires != default(System.DateTime)); - } - - /// - /// Test whether trialExpires should be serialized - /// - public virtual bool ShouldSerializetrialExpires() - { - if (_shouldSerializetrialExpires) - { - return true; - } - return (_trialExpires != default(System.DateTime)); - } - - /// - /// Test whether email should be serialized - /// - public virtual bool ShouldSerializeemail() - { - return !string.IsNullOrEmpty(email); - } - - #region Serialize/Deserialize - /// - /// Serializes current License object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an License object - /// - /// string workflow markup to deserialize - /// Output License object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out License obj, out System.Exception exception) - { - exception = null; - obj = default(License); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out License obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static License Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((License)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static License Deserialize(System.IO.Stream s) - { - return ((License)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current License object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an License object - /// - /// string xml file to load and deserialize - /// Output License object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out License obj, out System.Exception exception) - { - exception = null; - obj = default(License); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out License obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out License obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static License LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static License LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.Xml.Serialization.XmlIncludeAttribute(typeof(JukeboxPlaylist))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class JukeboxStatus - { - - private bool _shouldSerializeposition; - - private bool _shouldSerializegain; - - private bool _shouldSerializeplaying; - - private bool _shouldSerializecurrentIndex; - - private int _currentIndex; - - private bool _playing; - - private float _gain; - - private int _position; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int currentIndex - { - get - { - return this._currentIndex; - } - set - { - this._currentIndex = value; - _shouldSerializecurrentIndex = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool playing - { - get - { - return this._playing; - } - set - { - this._playing = value; - _shouldSerializeplaying = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public float gain - { - get - { - return this._gain; - } - set - { - this._gain = value; - _shouldSerializegain = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int position - { - get - { - return this._position; - } - set - { - this._position = value; - _shouldSerializeposition = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(JukeboxStatus)); - } - return serializer; - } - } - - /// - /// Test whether currentIndex should be serialized - /// - public virtual bool ShouldSerializecurrentIndex() - { - if (_shouldSerializecurrentIndex) - { - return true; - } - return (_currentIndex != default(int)); - } - - /// - /// Test whether playing should be serialized - /// - public virtual bool ShouldSerializeplaying() - { - if (_shouldSerializeplaying) - { - return true; - } - return (_playing != default(bool)); - } - - /// - /// Test whether gain should be serialized - /// - public virtual bool ShouldSerializegain() - { - if (_shouldSerializegain) - { - return true; - } - return (_gain != default(float)); - } - - /// - /// Test whether position should be serialized - /// - public virtual bool ShouldSerializeposition() - { - if (_shouldSerializeposition) - { - return true; - } - return (_position != default(int)); - } - - #region Serialize/Deserialize - /// - /// Serializes current JukeboxStatus object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an JukeboxStatus object - /// - /// string workflow markup to deserialize - /// Output JukeboxStatus object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out JukeboxStatus obj, out System.Exception exception) - { - exception = null; - obj = default(JukeboxStatus); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out JukeboxStatus obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static JukeboxStatus Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((JukeboxStatus)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static JukeboxStatus Deserialize(System.IO.Stream s) - { - return ((JukeboxStatus)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current JukeboxStatus object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an JukeboxStatus object - /// - /// string xml file to load and deserialize - /// Output JukeboxStatus object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out JukeboxStatus obj, out System.Exception exception) - { - exception = null; - obj = default(JukeboxStatus); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out JukeboxStatus obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out JukeboxStatus obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static JukeboxStatus LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static JukeboxStatus LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class JukeboxPlaylist : JukeboxStatus - { - - private List _entry; - - private static XmlSerializer serializer; - - public JukeboxPlaylist() - { - this._entry = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("entry")] - public List entry - { - get - { - return this._entry; - } - set - { - this._entry = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(JukeboxPlaylist)); - } - return serializer; - } - } - - /// - /// Test whether entry should be serialized - /// - public virtual bool ShouldSerializeentry() - { - return entry != null && entry.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current JukeboxPlaylist object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an JukeboxPlaylist object - /// - /// string workflow markup to deserialize - /// Output JukeboxPlaylist object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out JukeboxPlaylist obj, out System.Exception exception) - { - exception = null; - obj = default(JukeboxPlaylist); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out JukeboxPlaylist obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public new static JukeboxPlaylist Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((JukeboxPlaylist)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static JukeboxPlaylist Deserialize(System.IO.Stream s) - { - return ((JukeboxPlaylist)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current JukeboxPlaylist object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an JukeboxPlaylist object - /// - /// string xml file to load and deserialize - /// Output JukeboxPlaylist object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out JukeboxPlaylist obj, out System.Exception exception) - { - exception = null; - obj = default(JukeboxPlaylist); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out JukeboxPlaylist obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out JukeboxPlaylist obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static JukeboxPlaylist LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public new static JukeboxPlaylist LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Playlists - { - - private List _playlist; - - private static XmlSerializer serializer; - - public Playlists() - { - this._playlist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("playlist")] - public List playlist - { - get - { - return this._playlist; - } - set - { - this._playlist = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Playlists)); - } - return serializer; - } - } - - /// - /// Test whether playlist should be serialized - /// - public virtual bool ShouldSerializeplaylist() - { - return playlist != null && playlist.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Playlists object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Playlists object - /// - /// string workflow markup to deserialize - /// Output Playlists object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Playlists obj, out System.Exception exception) - { - exception = null; - obj = default(Playlists); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Playlists obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Playlists Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Playlists)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Playlists Deserialize(System.IO.Stream s) - { - return ((Playlists)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Playlists object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Playlists object - /// - /// string xml file to load and deserialize - /// Output Playlists object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Playlists obj, out System.Exception exception) - { - exception = null; - obj = default(Playlists); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Playlists obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Playlists obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Playlists LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Playlists LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlaylistWithSongs))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Playlist - { - - private bool _shouldSerializechanged; - - private bool _shouldSerializecreated; - - private bool _shouldSerializeduration; - - private bool _shouldSerializesongCount; - - private bool _shouldSerializepublic; - - private List _allowedUser; - - private string _id; - - private string _name; - - private string _comment; - - private string _owner; - - private bool _public; - - private int _songCount; - - private int _duration; - - private System.DateTime _created; - - private System.DateTime _changed; - - private string _coverArt; - - private static XmlSerializer serializer; - - public Playlist() - { - this._allowedUser = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("allowedUser")] - public List allowedUser - { - get - { - return this._allowedUser; - } - set - { - this._allowedUser = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string comment - { - get - { - return this._comment; - } - set - { - this._comment = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string owner - { - get - { - return this._owner; - } - set - { - this._owner = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool @public - { - get - { - return this._public; - } - set - { - this._public = value; - _shouldSerializepublic = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int songCount - { - get - { - return this._songCount; - } - set - { - this._songCount = value; - _shouldSerializesongCount = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int duration - { - get - { - return this._duration; - } - set - { - this._duration = value; - _shouldSerializeduration = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime created - { - get - { - return this._created; - } - set - { - this._created = value; - _shouldSerializecreated = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime changed - { - get - { - return this._changed; - } - set - { - this._changed = value; - _shouldSerializechanged = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string coverArt - { - get - { - return this._coverArt; - } - set - { - this._coverArt = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Playlist)); - } - return serializer; - } - } - - /// - /// Test whether allowedUser should be serialized - /// - public virtual bool ShouldSerializeallowedUser() - { - return allowedUser != null && allowedUser.Count > 0; - } - - /// - /// Test whether public should be serialized - /// - public virtual bool ShouldSerializepublic() - { - if (_shouldSerializepublic) - { - return true; - } - return (_public != default(bool)); - } - - /// - /// Test whether songCount should be serialized - /// - public virtual bool ShouldSerializesongCount() - { - if (_shouldSerializesongCount) - { - return true; - } - return (_songCount != default(int)); - } - - /// - /// Test whether duration should be serialized - /// - public virtual bool ShouldSerializeduration() - { - if (_shouldSerializeduration) - { - return true; - } - return (_duration != default(int)); - } - - /// - /// Test whether created should be serialized - /// - public virtual bool ShouldSerializecreated() - { - if (_shouldSerializecreated) - { - return true; - } - return (_created != default(System.DateTime)); - } - - /// - /// Test whether changed should be serialized - /// - public virtual bool ShouldSerializechanged() - { - if (_shouldSerializechanged) - { - return true; - } - return (_changed != default(System.DateTime)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - /// - /// Test whether comment should be serialized - /// - public virtual bool ShouldSerializecomment() - { - return !string.IsNullOrEmpty(comment); - } - - /// - /// Test whether owner should be serialized - /// - public virtual bool ShouldSerializeowner() - { - return !string.IsNullOrEmpty(owner); - } - - /// - /// Test whether coverArt should be serialized - /// - public virtual bool ShouldSerializecoverArt() - { - return !string.IsNullOrEmpty(coverArt); - } - - #region Serialize/Deserialize - /// - /// Serializes current Playlist object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Playlist object - /// - /// string workflow markup to deserialize - /// Output Playlist object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Playlist obj, out System.Exception exception) - { - exception = null; - obj = default(Playlist); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Playlist obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Playlist Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Playlist)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Playlist Deserialize(System.IO.Stream s) - { - return ((Playlist)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Playlist object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Playlist object - /// - /// string xml file to load and deserialize - /// Output Playlist object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Playlist obj, out System.Exception exception) - { - exception = null; - obj = default(Playlist); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Playlist obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Playlist obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Playlist LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Playlist LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class PlaylistWithSongs : Playlist - { - - private List _entry; - - private static XmlSerializer serializer; - - public PlaylistWithSongs() - { - this._entry = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("entry")] - public List entry - { - get - { - return this._entry; - } - set - { - this._entry = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(PlaylistWithSongs)); - } - return serializer; - } - } - - /// - /// Test whether entry should be serialized - /// - public virtual bool ShouldSerializeentry() - { - return entry != null && entry.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current PlaylistWithSongs object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an PlaylistWithSongs object - /// - /// string workflow markup to deserialize - /// Output PlaylistWithSongs object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out PlaylistWithSongs obj, out System.Exception exception) - { - exception = null; - obj = default(PlaylistWithSongs); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out PlaylistWithSongs obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public new static PlaylistWithSongs Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((PlaylistWithSongs)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static PlaylistWithSongs Deserialize(System.IO.Stream s) - { - return ((PlaylistWithSongs)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current PlaylistWithSongs object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an PlaylistWithSongs object - /// - /// string xml file to load and deserialize - /// Output PlaylistWithSongs object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out PlaylistWithSongs obj, out System.Exception exception) - { - exception = null; - obj = default(PlaylistWithSongs); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out PlaylistWithSongs obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out PlaylistWithSongs obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static PlaylistWithSongs LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public new static PlaylistWithSongs LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class SearchResult3 - { - - private List _artist; - - private List _album; - - private List _song; - - private static XmlSerializer serializer; - - public SearchResult3() - { - this._song = new List(); - this._album = new List(); - this._artist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("artist")] - public List artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("album")] - public List album - { - get - { - return this._album; - } - set - { - this._album = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(SearchResult3)); - } - return serializer; - } - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return artist != null && artist.Count > 0; - } - - /// - /// Test whether album should be serialized - /// - public virtual bool ShouldSerializealbum() - { - return album != null && album.Count > 0; - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current SearchResult3 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an SearchResult3 object - /// - /// string workflow markup to deserialize - /// Output SearchResult3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out SearchResult3 obj, out System.Exception exception) - { - exception = null; - obj = default(SearchResult3); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out SearchResult3 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static SearchResult3 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((SearchResult3)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static SearchResult3 Deserialize(System.IO.Stream s) - { - return ((SearchResult3)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current SearchResult3 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an SearchResult3 object - /// - /// string xml file to load and deserialize - /// Output SearchResult3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out SearchResult3 obj, out System.Exception exception) - { - exception = null; - obj = default(SearchResult3); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out SearchResult3 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out SearchResult3 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static SearchResult3 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static SearchResult3 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class SearchResult2 - { - - private List _artist; - - private List _album; - - private List _song; - - private static XmlSerializer serializer; - - public SearchResult2() - { - this._song = new List(); - this._album = new List(); - this._artist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("artist")] - public List artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("album")] - public List album - { - get - { - return this._album; - } - set - { - this._album = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("song")] - public List song - { - get - { - return this._song; - } - set - { - this._song = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(SearchResult2)); - } - return serializer; - } - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return artist != null && artist.Count > 0; - } - - /// - /// Test whether album should be serialized - /// - public virtual bool ShouldSerializealbum() - { - return album != null && album.Count > 0; - } - - /// - /// Test whether song should be serialized - /// - public virtual bool ShouldSerializesong() - { - return song != null && song.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current SearchResult2 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an SearchResult2 object - /// - /// string workflow markup to deserialize - /// Output SearchResult2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out SearchResult2 obj, out System.Exception exception) - { - exception = null; - obj = default(SearchResult2); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out SearchResult2 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static SearchResult2 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((SearchResult2)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static SearchResult2 Deserialize(System.IO.Stream s) - { - return ((SearchResult2)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current SearchResult2 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an SearchResult2 object - /// - /// string xml file to load and deserialize - /// Output SearchResult2 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out SearchResult2 obj, out System.Exception exception) - { - exception = null; - obj = default(SearchResult2); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out SearchResult2 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out SearchResult2 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static SearchResult2 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static SearchResult2 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class SearchResult - { - - private bool _shouldSerializetotalHits; - - private bool _shouldSerializeoffset; - - private List _match; - - private int _offset; - - private int _totalHits; - - private static XmlSerializer serializer; - - public SearchResult() - { - this._match = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("match")] - public List match - { - get - { - return this._match; - } - set - { - this._match = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int offset - { - get - { - return this._offset; - } - set - { - this._offset = value; - _shouldSerializeoffset = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int totalHits - { - get - { - return this._totalHits; - } - set - { - this._totalHits = value; - _shouldSerializetotalHits = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(SearchResult)); - } - return serializer; - } - } - - /// - /// Test whether match should be serialized - /// - public virtual bool ShouldSerializematch() - { - return match != null && match.Count > 0; - } - - /// - /// Test whether offset should be serialized - /// - public virtual bool ShouldSerializeoffset() - { - if (_shouldSerializeoffset) - { - return true; - } - return (_offset != default(int)); - } - - /// - /// Test whether totalHits should be serialized - /// - public virtual bool ShouldSerializetotalHits() - { - if (_shouldSerializetotalHits) - { - return true; - } - return (_totalHits != default(int)); - } - - #region Serialize/Deserialize - /// - /// Serializes current SearchResult object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an SearchResult object - /// - /// string workflow markup to deserialize - /// Output SearchResult object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out SearchResult obj, out System.Exception exception) - { - exception = null; - obj = default(SearchResult); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out SearchResult obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static SearchResult Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((SearchResult)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static SearchResult Deserialize(System.IO.Stream s) - { - return ((SearchResult)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current SearchResult object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an SearchResult object - /// - /// string xml file to load and deserialize - /// Output SearchResult object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out SearchResult obj, out System.Exception exception) - { - exception = null; - obj = default(SearchResult); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out SearchResult obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out SearchResult obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static SearchResult LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static SearchResult LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class NowPlaying - { - - private List _entry; - - private static XmlSerializer serializer; - - public NowPlaying() - { - this._entry = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("entry")] - public List entry - { - get - { - return this._entry; - } - set - { - this._entry = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(NowPlaying)); - } - return serializer; - } - } - - /// - /// Test whether entry should be serialized - /// - public virtual bool ShouldSerializeentry() - { - return entry != null && entry.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current NowPlaying object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an NowPlaying object - /// - /// string workflow markup to deserialize - /// Output NowPlaying object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out NowPlaying obj, out System.Exception exception) - { - exception = null; - obj = default(NowPlaying); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out NowPlaying obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static NowPlaying Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((NowPlaying)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static NowPlaying Deserialize(System.IO.Stream s) - { - return ((NowPlaying)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current NowPlaying object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an NowPlaying object - /// - /// string xml file to load and deserialize - /// Output NowPlaying object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out NowPlaying obj, out System.Exception exception) - { - exception = null; - obj = default(NowPlaying); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out NowPlaying obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out NowPlaying obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static NowPlaying LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static NowPlaying LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class NowPlayingEntry : Child - { - - private bool _shouldSerializeplayerId; - - private bool _shouldSerializeminutesAgo; - - private string _username; - - private int _minutesAgo; - - private int _playerId; - - private string _playerName; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string username - { - get - { - return this._username; - } - set - { - this._username = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int minutesAgo - { - get - { - return this._minutesAgo; - } - set - { - this._minutesAgo = value; - _shouldSerializeminutesAgo = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int playerId - { - get - { - return this._playerId; - } - set - { - this._playerId = value; - _shouldSerializeplayerId = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string playerName - { - get - { - return this._playerName; - } - set - { - this._playerName = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(NowPlayingEntry)); - } - return serializer; - } - } - - /// - /// Test whether minutesAgo should be serialized - /// - public virtual bool ShouldSerializeminutesAgo() - { - if (_shouldSerializeminutesAgo) - { - return true; - } - return (_minutesAgo != default(int)); - } - - /// - /// Test whether playerId should be serialized - /// - public virtual bool ShouldSerializeplayerId() - { - if (_shouldSerializeplayerId) - { - return true; - } - return (_playerId != default(int)); - } - - /// - /// Test whether username should be serialized - /// - public virtual bool ShouldSerializeusername() - { - return !string.IsNullOrEmpty(username); - } - - /// - /// Test whether playerName should be serialized - /// - public virtual bool ShouldSerializeplayerName() - { - return !string.IsNullOrEmpty(playerName); - } - - #region Serialize/Deserialize - /// - /// Serializes current NowPlayingEntry object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an NowPlayingEntry object - /// - /// string workflow markup to deserialize - /// Output NowPlayingEntry object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out NowPlayingEntry obj, out System.Exception exception) - { - exception = null; - obj = default(NowPlayingEntry); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out NowPlayingEntry obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public new static NowPlayingEntry Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((NowPlayingEntry)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static NowPlayingEntry Deserialize(System.IO.Stream s) - { - return ((NowPlayingEntry)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current NowPlayingEntry object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an NowPlayingEntry object - /// - /// string xml file to load and deserialize - /// Output NowPlayingEntry object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out NowPlayingEntry obj, out System.Exception exception) - { - exception = null; - obj = default(NowPlayingEntry); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out NowPlayingEntry obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out NowPlayingEntry obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static NowPlayingEntry LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public new static NowPlayingEntry LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class VideoConversion - { - - private bool _shouldSerializeaudioTrackId; - - private bool _shouldSerializebitRate; - - private string _id; - - private int _bitRate; - - private int _audioTrackId; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int bitRate - { - get - { - return this._bitRate; - } - set - { - this._bitRate = value; - _shouldSerializebitRate = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int audioTrackId - { - get - { - return this._audioTrackId; - } - set - { - this._audioTrackId = value; - _shouldSerializeaudioTrackId = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(VideoConversion)); - } - return serializer; - } - } - - /// - /// Test whether bitRate should be serialized - /// - public virtual bool ShouldSerializebitRate() - { - if (_shouldSerializebitRate) - { - return true; - } - return (_bitRate != default(int)); - } - - /// - /// Test whether audioTrackId should be serialized - /// - public virtual bool ShouldSerializeaudioTrackId() - { - if (_shouldSerializeaudioTrackId) - { - return true; - } - return (_audioTrackId != default(int)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - #region Serialize/Deserialize - /// - /// Serializes current VideoConversion object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an VideoConversion object - /// - /// string workflow markup to deserialize - /// Output VideoConversion object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out VideoConversion obj, out System.Exception exception) - { - exception = null; - obj = default(VideoConversion); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out VideoConversion obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static VideoConversion Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((VideoConversion)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static VideoConversion Deserialize(System.IO.Stream s) - { - return ((VideoConversion)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current VideoConversion object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an VideoConversion object - /// - /// string xml file to load and deserialize - /// Output VideoConversion object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out VideoConversion obj, out System.Exception exception) - { - exception = null; - obj = default(VideoConversion); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out VideoConversion obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out VideoConversion obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static VideoConversion LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static VideoConversion LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class AudioTrack - { - - private string _id; - - private string _name; - - private string _languageCode; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string languageCode - { - get - { - return this._languageCode; - } - set - { - this._languageCode = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(AudioTrack)); - } - return serializer; - } - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - /// - /// Test whether languageCode should be serialized - /// - public virtual bool ShouldSerializelanguageCode() - { - return !string.IsNullOrEmpty(languageCode); - } - - #region Serialize/Deserialize - /// - /// Serializes current AudioTrack object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an AudioTrack object - /// - /// string workflow markup to deserialize - /// Output AudioTrack object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out AudioTrack obj, out System.Exception exception) - { - exception = null; - obj = default(AudioTrack); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out AudioTrack obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static AudioTrack Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((AudioTrack)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static AudioTrack Deserialize(System.IO.Stream s) - { - return ((AudioTrack)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current AudioTrack object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an AudioTrack object - /// - /// string xml file to load and deserialize - /// Output AudioTrack object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out AudioTrack obj, out System.Exception exception) - { - exception = null; - obj = default(AudioTrack); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out AudioTrack obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out AudioTrack obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static AudioTrack LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static AudioTrack LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Captions - { - - private string _id; - - private string _name; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Captions)); - } - return serializer; - } - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - #region Serialize/Deserialize - /// - /// Serializes current Captions object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Captions object - /// - /// string workflow markup to deserialize - /// Output Captions object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Captions obj, out System.Exception exception) - { - exception = null; - obj = default(Captions); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Captions obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Captions Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Captions)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Captions Deserialize(System.IO.Stream s) - { - return ((Captions)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Captions object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Captions object - /// - /// string xml file to load and deserialize - /// Output Captions object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Captions obj, out System.Exception exception) - { - exception = null; - obj = default(Captions); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Captions obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Captions obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Captions LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Captions LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class VideoInfo - { - - private List _captions; - - private List _audioTrack; - - private List _conversion; - - private string _id; - - private static XmlSerializer serializer; - - public VideoInfo() - { - this._conversion = new List(); - this._audioTrack = new List(); - this._captions = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("captions")] - public List captions - { - get - { - return this._captions; - } - set - { - this._captions = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("audioTrack")] - public List audioTrack - { - get - { - return this._audioTrack; - } - set - { - this._audioTrack = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("conversion")] - public List conversion - { - get - { - return this._conversion; - } - set - { - this._conversion = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(VideoInfo)); - } - return serializer; - } - } - - /// - /// Test whether captions should be serialized - /// - public virtual bool ShouldSerializecaptions() - { - return captions != null && captions.Count > 0; - } - - /// - /// Test whether audioTrack should be serialized - /// - public virtual bool ShouldSerializeaudioTrack() - { - return audioTrack != null && audioTrack.Count > 0; - } - - /// - /// Test whether conversion should be serialized - /// - public virtual bool ShouldSerializeconversion() - { - return conversion != null && conversion.Count > 0; - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - #region Serialize/Deserialize - /// - /// Serializes current VideoInfo object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an VideoInfo object - /// - /// string workflow markup to deserialize - /// Output VideoInfo object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out VideoInfo obj, out System.Exception exception) - { - exception = null; - obj = default(VideoInfo); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out VideoInfo obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static VideoInfo Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((VideoInfo)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static VideoInfo Deserialize(System.IO.Stream s) - { - return ((VideoInfo)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current VideoInfo object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an VideoInfo object - /// - /// string xml file to load and deserialize - /// Output VideoInfo object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out VideoInfo obj, out System.Exception exception) - { - exception = null; - obj = default(VideoInfo); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out VideoInfo obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out VideoInfo obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static VideoInfo LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static VideoInfo LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Videos - { - - private List _video; - - private static XmlSerializer serializer; - - public Videos() - { - this._video = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("video")] - public List video - { - get - { - return this._video; - } - set - { - this._video = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Videos)); - } - return serializer; - } - } - - /// - /// Test whether video should be serialized - /// - public virtual bool ShouldSerializevideo() - { - return video != null && video.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Videos object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Videos object - /// - /// string workflow markup to deserialize - /// Output Videos object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Videos obj, out System.Exception exception) - { - exception = null; - obj = default(Videos); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Videos obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Videos Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Videos)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Videos Deserialize(System.IO.Stream s) - { - return ((Videos)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Videos object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Videos object - /// - /// string xml file to load and deserialize - /// Output Videos object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Videos obj, out System.Exception exception) - { - exception = null; - obj = default(Videos); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Videos obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Videos obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Videos LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Videos LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class IndexID3 - { - - private List _artist; - - private string _name; - - private static XmlSerializer serializer; - - public IndexID3() - { - this._artist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("artist")] - public List artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(IndexID3)); - } - return serializer; - } - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return artist != null && artist.Count > 0; - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - #region Serialize/Deserialize - /// - /// Serializes current IndexID3 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an IndexID3 object - /// - /// string workflow markup to deserialize - /// Output IndexID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out IndexID3 obj, out System.Exception exception) - { - exception = null; - obj = default(IndexID3); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out IndexID3 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static IndexID3 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((IndexID3)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static IndexID3 Deserialize(System.IO.Stream s) - { - return ((IndexID3)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current IndexID3 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an IndexID3 object - /// - /// string xml file to load and deserialize - /// Output IndexID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out IndexID3 obj, out System.Exception exception) - { - exception = null; - obj = default(IndexID3); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out IndexID3 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out IndexID3 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static IndexID3 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static IndexID3 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class ArtistsID3 - { - - private List _index; - - private string _ignoredArticles; - - private static XmlSerializer serializer; - - public ArtistsID3() - { - this._index = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("index")] - public List index - { - get - { - return this._index; - } - set - { - this._index = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string ignoredArticles - { - get - { - return this._ignoredArticles; - } - set - { - this._ignoredArticles = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(ArtistsID3)); - } - return serializer; - } - } - - /// - /// Test whether index should be serialized - /// - public virtual bool ShouldSerializeindex() - { - return index != null && index.Count > 0; - } - - /// - /// Test whether ignoredArticles should be serialized - /// - public virtual bool ShouldSerializeignoredArticles() - { - return !string.IsNullOrEmpty(ignoredArticles); - } - - #region Serialize/Deserialize - /// - /// Serializes current ArtistsID3 object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an ArtistsID3 object - /// - /// string workflow markup to deserialize - /// Output ArtistsID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out ArtistsID3 obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistsID3); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out ArtistsID3 obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static ArtistsID3 Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((ArtistsID3)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static ArtistsID3 Deserialize(System.IO.Stream s) - { - return ((ArtistsID3)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current ArtistsID3 object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an ArtistsID3 object - /// - /// string xml file to load and deserialize - /// Output ArtistsID3 object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out ArtistsID3 obj, out System.Exception exception) - { - exception = null; - obj = default(ArtistsID3); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out ArtistsID3 obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out ArtistsID3 obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static ArtistsID3 LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static ArtistsID3 LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Genres - { - - private List _genre; - - private static XmlSerializer serializer; - - public Genres() - { - this._genre = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("genre")] - public List genre - { - get - { - return this._genre; - } - set - { - this._genre = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Genres)); - } - return serializer; - } - } - - /// - /// Test whether genre should be serialized - /// - public virtual bool ShouldSerializegenre() - { - return genre != null && genre.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current Genres object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Genres object - /// - /// string workflow markup to deserialize - /// Output Genres object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Genres obj, out System.Exception exception) - { - exception = null; - obj = default(Genres); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Genres obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Genres Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Genres)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Genres Deserialize(System.IO.Stream s) - { - return ((Genres)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Genres object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Genres object - /// - /// string xml file to load and deserialize - /// Output Genres object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Genres obj, out System.Exception exception) - { - exception = null; - obj = default(Genres); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Genres obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Genres obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Genres LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Genres LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Genre - { - - private bool _shouldSerializealbumCount; - - private bool _shouldSerializesongCount; - - private int _songCount; - - private int _albumCount; - - private List _text; - - private static XmlSerializer serializer; - - public Genre() - { - this._text = new List(); - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int songCount - { - get - { - return this._songCount; - } - set - { - this._songCount = value; - _shouldSerializesongCount = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int albumCount - { - get - { - return this._albumCount; - } - set - { - this._albumCount = value; - _shouldSerializealbumCount = true; - } - } - - [System.Xml.Serialization.XmlTextAttribute()] - public List Text - { - get - { - return this._text; - } - set - { - this._text = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Genre)); - } - return serializer; - } - } - - /// - /// Test whether Text should be serialized - /// - public virtual bool ShouldSerializeText() - { - return Text != null && Text.Count > 0; - } - - /// - /// Test whether songCount should be serialized - /// - public virtual bool ShouldSerializesongCount() - { - if (_shouldSerializesongCount) - { - return true; - } - return (_songCount != default(int)); - } - - /// - /// Test whether albumCount should be serialized - /// - public virtual bool ShouldSerializealbumCount() - { - if (_shouldSerializealbumCount) - { - return true; - } - return (_albumCount != default(int)); - } - - #region Serialize/Deserialize - /// - /// Serializes current Genre object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Genre object - /// - /// string workflow markup to deserialize - /// Output Genre object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Genre obj, out System.Exception exception) - { - exception = null; - obj = default(Genre); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Genre obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Genre Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Genre)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Genre Deserialize(System.IO.Stream s) - { - return ((Genre)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Genre object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Genre object - /// - /// string xml file to load and deserialize - /// Output Genre object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Genre obj, out System.Exception exception) - { - exception = null; - obj = default(Genre); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Genre obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Genre obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Genre LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Genre LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Directory - { - - private bool _shouldSerializeplayCount; - - private bool _shouldSerializeaverageRating; - - private bool _shouldSerializeuserRating; - - private bool _shouldSerializestarred; - - private List _child; - - private string _id; - - private string _parent; - - private string _name; - - private System.DateTime _starred; - - private int _userRating; - - private double _averageRating; - - private long _playCount; - - private static XmlSerializer serializer; - - public Directory() - { - this._child = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("child")] - public List child - { - get - { - return this._child; - } - set - { - this._child = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string parent - { - get - { - return this._parent; - } - set - { - this._parent = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime starred - { - get - { - return this._starred; - } - set - { - this._starred = value; - _shouldSerializestarred = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public int userRating - { - get - { - return this._userRating; - } - set - { - this._userRating = value; - _shouldSerializeuserRating = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public double averageRating - { - get - { - return this._averageRating; - } - set - { - this._averageRating = value; - _shouldSerializeaverageRating = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long playCount - { - get - { - return this._playCount; - } - set - { - this._playCount = value; - _shouldSerializeplayCount = true; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Directory)); - } - return serializer; - } - } - - /// - /// Test whether child should be serialized - /// - public virtual bool ShouldSerializechild() - { - return child != null && child.Count > 0; - } - - /// - /// Test whether starred should be serialized - /// - public virtual bool ShouldSerializestarred() - { - if (_shouldSerializestarred) - { - return true; - } - return (_starred != default(System.DateTime)); - } - - /// - /// Test whether userRating should be serialized - /// - public virtual bool ShouldSerializeuserRating() - { - if (_shouldSerializeuserRating) - { - return true; - } - return (_userRating != default(int)); - } - - /// - /// Test whether averageRating should be serialized - /// - public virtual bool ShouldSerializeaverageRating() - { - if (_shouldSerializeaverageRating) - { - return true; - } - return (_averageRating != default(double)); - } - - /// - /// Test whether playCount should be serialized - /// - public virtual bool ShouldSerializeplayCount() - { - if (_shouldSerializeplayCount) - { - return true; - } - return (_playCount != default(long)); - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - return !string.IsNullOrEmpty(id); - } - - /// - /// Test whether parent should be serialized - /// - public virtual bool ShouldSerializeparent() - { - return !string.IsNullOrEmpty(parent); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - #region Serialize/Deserialize - /// - /// Serializes current Directory object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Directory object - /// - /// string workflow markup to deserialize - /// Output Directory object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Directory obj, out System.Exception exception) - { - exception = null; - obj = default(Directory); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Directory obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Directory Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Directory)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Directory Deserialize(System.IO.Stream s) - { - return ((Directory)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Directory object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Directory object - /// - /// string xml file to load and deserialize - /// Output Directory object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Directory obj, out System.Exception exception) - { - exception = null; - obj = default(Directory); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Directory obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Directory obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Directory LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Directory LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Index - { - - private List _artist; - - private string _name; - - private static XmlSerializer serializer; - - public Index() - { - this._artist = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("artist")] - public List artist - { - get - { - return this._artist; - } - set - { - this._artist = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Index)); - } - return serializer; - } - } - - /// - /// Test whether artist should be serialized - /// - public virtual bool ShouldSerializeartist() - { - return artist != null && artist.Count > 0; - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - #region Serialize/Deserialize - /// - /// Serializes current Index object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Index object - /// - /// string workflow markup to deserialize - /// Output Index object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Index obj, out System.Exception exception) - { - exception = null; - obj = default(Index); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Index obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Index Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Index)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Index Deserialize(System.IO.Stream s) - { - return ((Index)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Index object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Index object - /// - /// string xml file to load and deserialize - /// Output Index object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Index obj, out System.Exception exception) - { - exception = null; - obj = default(Index); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Index obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Index obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Index LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Index LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class Indexes - { - - private bool _shouldSerializelastModified; - - private List _shortcut; - - private List _index; - - private List _child; - - private long _lastModified; - - private string _ignoredArticles; - - private static XmlSerializer serializer; - - public Indexes() - { - this._child = new List(); - this._index = new List(); - this._shortcut = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("shortcut")] - public List shortcut - { - get - { - return this._shortcut; - } - set - { - this._shortcut = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("index")] - public List index - { - get - { - return this._index; - } - set - { - this._index = value; - } - } - - [System.Xml.Serialization.XmlElementAttribute("child")] - public List child - { - get - { - return this._child; - } - set - { - this._child = value; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public long lastModified - { - get - { - return this._lastModified; - } - set - { - this._lastModified = value; - _shouldSerializelastModified = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string ignoredArticles - { - get - { - return this._ignoredArticles; - } - set - { - this._ignoredArticles = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(Indexes)); - } - return serializer; - } - } - - /// - /// Test whether shortcut should be serialized - /// - public virtual bool ShouldSerializeshortcut() - { - return shortcut != null && shortcut.Count > 0; - } - - /// - /// Test whether index should be serialized - /// - public virtual bool ShouldSerializeindex() - { - return index != null && index.Count > 0; - } - - /// - /// Test whether child should be serialized - /// - public virtual bool ShouldSerializechild() - { - return child != null && child.Count > 0; - } - - /// - /// Test whether lastModified should be serialized - /// - public virtual bool ShouldSerializelastModified() - { - if (_shouldSerializelastModified) - { - return true; - } - return (_lastModified != default(long)); - } - - /// - /// Test whether ignoredArticles should be serialized - /// - public virtual bool ShouldSerializeignoredArticles() - { - return !string.IsNullOrEmpty(ignoredArticles); - } - - #region Serialize/Deserialize - /// - /// Serializes current Indexes object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an Indexes object - /// - /// string workflow markup to deserialize - /// Output Indexes object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out Indexes obj, out System.Exception exception) - { - exception = null; - obj = default(Indexes); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out Indexes obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static Indexes Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((Indexes)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static Indexes Deserialize(System.IO.Stream s) - { - return ((Indexes)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current Indexes object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an Indexes object - /// - /// string xml file to load and deserialize - /// Output Indexes object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Indexes obj, out System.Exception exception) - { - exception = null; - obj = default(Indexes); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out Indexes obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out Indexes obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static Indexes LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static Indexes LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class MusicFolders - { - - private List _musicFolder; - - private static XmlSerializer serializer; - - public MusicFolders() - { - this._musicFolder = new List(); - } - - [System.Xml.Serialization.XmlElementAttribute("musicFolder")] - public List musicFolder - { - get - { - return this._musicFolder; - } - set - { - this._musicFolder = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(MusicFolders)); - } - return serializer; - } - } - - /// - /// Test whether musicFolder should be serialized - /// - public virtual bool ShouldSerializemusicFolder() - { - return musicFolder != null && musicFolder.Count > 0; - } - - #region Serialize/Deserialize - /// - /// Serializes current MusicFolders object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an MusicFolders object - /// - /// string workflow markup to deserialize - /// Output MusicFolders object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out MusicFolders obj, out System.Exception exception) - { - exception = null; - obj = default(MusicFolders); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out MusicFolders obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static MusicFolders Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((MusicFolders)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static MusicFolders Deserialize(System.IO.Stream s) - { - return ((MusicFolders)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current MusicFolders object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an MusicFolders object - /// - /// string xml file to load and deserialize - /// Output MusicFolders object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out MusicFolders obj, out System.Exception exception) - { - exception = null; - obj = default(MusicFolders); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out MusicFolders obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out MusicFolders obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static MusicFolders LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static MusicFolders LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public partial class MusicFolder - { - - private bool _shouldSerializeid; - - private string _id; - - private string _name; - - private static XmlSerializer serializer; - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string id - { - get - { - return this._id; - } - set - { - this._id = value; - _shouldSerializeid = true; - } - } - - [System.Xml.Serialization.XmlAttributeAttribute()] - public string name - { - get - { - return this._name; - } - set - { - this._name = value; - } - } - - private static XmlSerializer Serializer - { - get - { - if ((serializer == null)) - { - serializer = new XmlSerializerFactory().CreateSerializer(typeof(MusicFolder)); - } - return serializer; - } - } - - /// - /// Test whether id should be serialized - /// - public virtual bool ShouldSerializeid() - { - if (_shouldSerializeid) - { - return true; - } - return !string.IsNullOrEmpty(_id); - } - - /// - /// Test whether name should be serialized - /// - public virtual bool ShouldSerializename() - { - return !string.IsNullOrEmpty(name); - } - - #region Serialize/Deserialize - /// - /// Serializes current MusicFolder object into an XML string - /// - /// string XML value - public virtual string Serialize(System.Text.Encoding encoding) - { - System.IO.StreamReader streamReader = null; - System.IO.MemoryStream memoryStream = null; - try - { - memoryStream = new System.IO.MemoryStream(); - System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings(); - xmlWriterSettings.Encoding = encoding; - xmlWriterSettings.Indent = true; - System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings); - Serializer.Serialize(xmlWriter, this); - memoryStream.Seek(0, System.IO.SeekOrigin.Begin); - streamReader = new System.IO.StreamReader(memoryStream, encoding); - return streamReader.ReadToEnd(); - } - finally - { - if ((streamReader != null)) - { - streamReader.Dispose(); - } - if ((memoryStream != null)) - { - memoryStream.Dispose(); - } - } - } - - public virtual string Serialize() - { - return Serialize(System.Text.Encoding.UTF8); - } - - /// - /// Deserializes workflow markup into an MusicFolder object - /// - /// string workflow markup to deserialize - /// Output MusicFolder object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool Deserialize(string input, out MusicFolder obj, out System.Exception exception) - { - exception = null; - obj = default(MusicFolder); - try - { - obj = Deserialize(input); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool Deserialize(string input, out MusicFolder obj) - { - System.Exception exception = null; - return Deserialize(input, out obj, out exception); - } - - public static MusicFolder Deserialize(string input) - { - System.IO.StringReader stringReader = null; - try - { - stringReader = new System.IO.StringReader(input); - return ((MusicFolder)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); - } - finally - { - if ((stringReader != null)) - { - stringReader.Dispose(); - } - } - } - - public static MusicFolder Deserialize(System.IO.Stream s) - { - return ((MusicFolder)(Serializer.Deserialize(s))); - } - #endregion - - /// - /// Serializes current MusicFolder object into file - /// - /// full path of outupt xml file - /// output Exception value if failed - /// true if can serialize and save into file; otherwise, false - public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception) - { - exception = null; - try - { - SaveToFile(fileName, encoding); - return true; - } - catch (System.Exception e) - { - exception = e; - return false; - } - } - - public virtual bool SaveToFile(string fileName, out System.Exception exception) - { - return SaveToFile(fileName, System.Text.Encoding.UTF8, out exception); - } - - public virtual void SaveToFile(string fileName) - { - SaveToFile(fileName, System.Text.Encoding.UTF8); - } - - public virtual void SaveToFile(string fileName, System.Text.Encoding encoding) - { - System.IO.StreamWriter streamWriter = null; - try - { - string xmlString = Serialize(encoding); - streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.UTF8); - streamWriter.WriteLine(xmlString); - streamWriter.Close(); - } - finally - { - if ((streamWriter != null)) - { - streamWriter.Dispose(); - } - } - } - - /// - /// Deserializes xml markup from file into an MusicFolder object - /// - /// string xml file to load and deserialize - /// Output MusicFolder object - /// output Exception value if deserialize failed - /// true if this Serializer can deserialize the object; otherwise, false - public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out MusicFolder obj, out System.Exception exception) - { - exception = null; - obj = default(MusicFolder); - try - { - obj = LoadFromFile(fileName, encoding); - return true; - } - catch (System.Exception ex) - { - exception = ex; - return false; - } - } - - public static bool LoadFromFile(string fileName, out MusicFolder obj, out System.Exception exception) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8, out obj, out exception); - } - - public static bool LoadFromFile(string fileName, out MusicFolder obj) - { - System.Exception exception = null; - return LoadFromFile(fileName, out obj, out exception); - } - - public static MusicFolder LoadFromFile(string fileName) - { - return LoadFromFile(fileName, System.Text.Encoding.UTF8); - } - - public static MusicFolder LoadFromFile(string fileName, System.Text.Encoding encoding) - { - System.IO.FileStream file = null; - System.IO.StreamReader sr = null; - try - { - file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); - sr = new System.IO.StreamReader(file, encoding); - string xmlString = sr.ReadToEnd(); - sr.Close(); - file.Close(); - return Deserialize(xmlString); - } - finally - { - if ((file != null)) - { - file.Dispose(); - } - if ((sr != null)) - { - sr.Dispose(); - } - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi", IncludeInSchema=false)] - public enum ItemChoiceType - { - - /// - album, - - /// - albumInfo, - - /// - albumList, - - /// - albumList2, - - /// - artist, - - /// - artistInfo, - - /// - artistInfo2, - - /// - artists, - - /// - bookmarks, - - /// - chatMessages, - - /// - directory, - - /// - error, - - /// - genres, - - /// - indexes, - - /// - internetRadioStations, - - /// - jukeboxPlaylist, - - /// - jukeboxStatus, - - /// - license, - - /// - lyrics, - - /// - musicFolders, - - /// - newestPodcasts, - - /// - nowPlaying, - - /// - playQueue, - - /// - playlist, - - /// - playlists, - - /// - podcasts, - - /// - randomSongs, - - /// - searchResult, - - /// - searchResult2, - - /// - searchResult3, - - /// - shares, - - /// - similarSongs, - - /// - similarSongs2, - - /// - song, - - /// - songsByGenre, - - /// - starred, - - /// - starred2, - - /// - topSongs, - - /// - user, - - /// - users, - - /// - videoInfo, - - /// - videos, - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://subsonic.org/restapi")] - public enum ResponseStatus - { - - /// - ok, - - /// - failed, - } -} -#pragma warning restore diff --git a/MB_SubSonic/Domain/subsonic-rest-api-1.15.0.xsd b/MB_SubSonic/Domain/subsonic-rest-api-1.15.0.xsd new file mode 100644 index 0000000..44d5103 --- /dev/null +++ b/MB_SubSonic/Domain/subsonic-rest-api-1.15.0.xsd @@ -0,0 +1,638 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MB_SubSonic/Domain/subsonic-rest-api-1.16.0.xsd b/MB_SubSonic/Domain/subsonic-rest-api-1.16.0.xsd new file mode 100644 index 0000000..5a026f4 --- /dev/null +++ b/MB_SubSonic/Domain/subsonic-rest-api-1.16.0.xsd @@ -0,0 +1,638 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MB_SubSonic/Domain/subsonic-rest-api-1.16.1.xsd b/MB_SubSonic/Domain/subsonic-rest-api-1.16.1.xsd new file mode 100644 index 0000000..8f70274 --- /dev/null +++ b/MB_SubSonic/Domain/subsonic-rest-api-1.16.1.xsd @@ -0,0 +1,640 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MB_SubSonic/Domain/subsonic-rest-api-1_16_1.cs b/MB_SubSonic/Domain/subsonic-rest-api-1_16_1.cs new file mode 100644 index 0000000..777ab27 --- /dev/null +++ b/MB_SubSonic/Domain/subsonic-rest-api-1_16_1.cs @@ -0,0 +1,3645 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Xml.Serialization; +namespace MusicBeePlugin.SubsonicAPI +{ + // + // This source code was auto-generated by xsd, Version=4.8.4084.0. + // + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + [System.Xml.Serialization.XmlRootAttribute("subsonic-response", Namespace = "http://subsonic.org/restapi", + IsNullable = false)] + public partial class Response + { + + private object itemField; + + private ItemChoiceType itemElementNameField; + + private ResponseStatus statusField; + + private string versionField; + + /// + [System.Xml.Serialization.XmlElementAttribute("album", typeof(AlbumWithSongsID3))] + [System.Xml.Serialization.XmlElementAttribute("albumInfo", typeof(AlbumInfo))] + [System.Xml.Serialization.XmlElementAttribute("albumList", typeof(AlbumList))] + [System.Xml.Serialization.XmlElementAttribute("albumList2", typeof(AlbumList2))] + [System.Xml.Serialization.XmlElementAttribute("artist", typeof(ArtistWithAlbumsID3))] + [System.Xml.Serialization.XmlElementAttribute("artistInfo", typeof(ArtistInfo))] + [System.Xml.Serialization.XmlElementAttribute("artistInfo2", typeof(ArtistInfo2))] + [System.Xml.Serialization.XmlElementAttribute("artists", typeof(ArtistsID3))] + [System.Xml.Serialization.XmlElementAttribute("bookmarks", typeof(Bookmarks))] + [System.Xml.Serialization.XmlElementAttribute("chatMessages", typeof(ChatMessages))] + [System.Xml.Serialization.XmlElementAttribute("directory", typeof(Directory))] + [System.Xml.Serialization.XmlElementAttribute("error", typeof(Error))] + [System.Xml.Serialization.XmlElementAttribute("genres", typeof(Genres))] + [System.Xml.Serialization.XmlElementAttribute("indexes", typeof(Indexes))] + [System.Xml.Serialization.XmlElementAttribute("internetRadioStations", typeof(InternetRadioStations))] + [System.Xml.Serialization.XmlElementAttribute("jukeboxPlaylist", typeof(JukeboxPlaylist))] + [System.Xml.Serialization.XmlElementAttribute("jukeboxStatus", typeof(JukeboxStatus))] + [System.Xml.Serialization.XmlElementAttribute("license", typeof(License))] + [System.Xml.Serialization.XmlElementAttribute("lyrics", typeof(Lyrics))] + [System.Xml.Serialization.XmlElementAttribute("musicFolders", typeof(MusicFolders))] + [System.Xml.Serialization.XmlElementAttribute("newestPodcasts", typeof(NewestPodcasts))] + [System.Xml.Serialization.XmlElementAttribute("nowPlaying", typeof(NowPlaying))] + [System.Xml.Serialization.XmlElementAttribute("playQueue", typeof(PlayQueue))] + [System.Xml.Serialization.XmlElementAttribute("playlist", typeof(PlaylistWithSongs))] + [System.Xml.Serialization.XmlElementAttribute("playlists", typeof(Playlists))] + [System.Xml.Serialization.XmlElementAttribute("podcasts", typeof(Podcasts))] + [System.Xml.Serialization.XmlElementAttribute("randomSongs", typeof(Songs))] + [System.Xml.Serialization.XmlElementAttribute("scanStatus", typeof(ScanStatus))] + [System.Xml.Serialization.XmlElementAttribute("searchResult", typeof(SearchResult))] + [System.Xml.Serialization.XmlElementAttribute("searchResult2", typeof(SearchResult2))] + [System.Xml.Serialization.XmlElementAttribute("searchResult3", typeof(SearchResult3))] + [System.Xml.Serialization.XmlElementAttribute("shares", typeof(Shares))] + [System.Xml.Serialization.XmlElementAttribute("similarSongs", typeof(SimilarSongs))] + [System.Xml.Serialization.XmlElementAttribute("similarSongs2", typeof(SimilarSongs2))] + [System.Xml.Serialization.XmlElementAttribute("song", typeof(Child))] + [System.Xml.Serialization.XmlElementAttribute("songsByGenre", typeof(Songs))] + [System.Xml.Serialization.XmlElementAttribute("starred", typeof(Starred))] + [System.Xml.Serialization.XmlElementAttribute("starred2", typeof(Starred2))] + [System.Xml.Serialization.XmlElementAttribute("topSongs", typeof(TopSongs))] + [System.Xml.Serialization.XmlElementAttribute("user", typeof(User))] + [System.Xml.Serialization.XmlElementAttribute("users", typeof(Users))] + [System.Xml.Serialization.XmlElementAttribute("videoInfo", typeof(VideoInfo))] + [System.Xml.Serialization.XmlElementAttribute("videos", typeof(Videos))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] + public object Item + { + get { return this.itemField; } + set { this.itemField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemChoiceType ItemElementName + { + get { return this.itemElementNameField; } + set { this.itemElementNameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ResponseStatus status + { + get { return this.statusField; } + set { this.statusField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string version + { + get { return this.versionField; } + set { this.versionField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class AlbumWithSongsID3 : AlbumID3 + { + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PodcastEpisode))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NowPlayingEntry))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Child + { + + private string idField; + + private string parentField; + + private bool isDirField; + + private string titleField; + + private string albumField; + + private string artistField; + + private int trackField; + + private bool trackFieldSpecified; + + private int yearField; + + private bool yearFieldSpecified; + + private string genreField; + + private string coverArtField; + + private long sizeField; + + private bool sizeFieldSpecified; + + private string contentTypeField; + + private string suffixField; + + private string transcodedContentTypeField; + + private string transcodedSuffixField; + + private int durationField; + + private bool durationFieldSpecified; + + private int bitRateField; + + private bool bitRateFieldSpecified; + + private string pathField; + + private bool isVideoField; + + private bool isVideoFieldSpecified; + + private int userRatingField; + + private bool userRatingFieldSpecified; + + private double averageRatingField; + + private bool averageRatingFieldSpecified; + + private long playCountField; + + private bool playCountFieldSpecified; + + private int discNumberField; + + private bool discNumberFieldSpecified; + + private System.DateTime createdField; + + private bool createdFieldSpecified; + + private System.DateTime starredField; + + private bool starredFieldSpecified; + + private string albumIdField; + + private string artistIdField; + + private MediaType typeField; + + private bool typeFieldSpecified; + + private long bookmarkPositionField; + + private bool bookmarkPositionFieldSpecified; + + private int originalWidthField; + + private bool originalWidthFieldSpecified; + + private int originalHeightField; + + private bool originalHeightFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string parent + { + get { return this.parentField; } + set { this.parentField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool isDir + { + get { return this.isDirField; } + set { this.isDirField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string title + { + get { return this.titleField; } + set { this.titleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string album + { + get { return this.albumField; } + set { this.albumField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int track + { + get { return this.trackField; } + set { this.trackField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool trackSpecified + { + get { return this.trackFieldSpecified; } + set { this.trackFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int year + { + get { return this.yearField; } + set { this.yearField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool yearSpecified + { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string genre + { + get { return this.genreField; } + set { this.genreField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string coverArt + { + get { return this.coverArtField; } + set { this.coverArtField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long size + { + get { return this.sizeField; } + set { this.sizeField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool sizeSpecified + { + get { return this.sizeFieldSpecified; } + set { this.sizeFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string contentType + { + get { return this.contentTypeField; } + set { this.contentTypeField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string suffix + { + get { return this.suffixField; } + set { this.suffixField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string transcodedContentType + { + get { return this.transcodedContentTypeField; } + set { this.transcodedContentTypeField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string transcodedSuffix + { + get { return this.transcodedSuffixField; } + set { this.transcodedSuffixField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int duration + { + get { return this.durationField; } + set { this.durationField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool durationSpecified + { + get { return this.durationFieldSpecified; } + set { this.durationFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int bitRate + { + get { return this.bitRateField; } + set { this.bitRateField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool bitRateSpecified + { + get { return this.bitRateFieldSpecified; } + set { this.bitRateFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string path + { + get { return this.pathField; } + set { this.pathField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool isVideo + { + get { return this.isVideoField; } + set { this.isVideoField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool isVideoSpecified + { + get { return this.isVideoFieldSpecified; } + set { this.isVideoFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int userRating + { + get { return this.userRatingField; } + set { this.userRatingField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool userRatingSpecified + { + get { return this.userRatingFieldSpecified; } + set { this.userRatingFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double averageRating + { + get { return this.averageRatingField; } + set { this.averageRatingField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool averageRatingSpecified + { + get { return this.averageRatingFieldSpecified; } + set { this.averageRatingFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long playCount + { + get { return this.playCountField; } + set { this.playCountField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool playCountSpecified + { + get { return this.playCountFieldSpecified; } + set { this.playCountFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int discNumber + { + get { return this.discNumberField; } + set { this.discNumberField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool discNumberSpecified + { + get { return this.discNumberFieldSpecified; } + set { this.discNumberFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime created + { + get { return this.createdField; } + set { this.createdField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool createdSpecified + { + get { return this.createdFieldSpecified; } + set { this.createdFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime starred + { + get { return this.starredField; } + set { this.starredField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool starredSpecified + { + get { return this.starredFieldSpecified; } + set { this.starredFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string albumId + { + get { return this.albumIdField; } + set { this.albumIdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string artistId + { + get { return this.artistIdField; } + set { this.artistIdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public MediaType type + { + get { return this.typeField; } + set { this.typeField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool typeSpecified + { + get { return this.typeFieldSpecified; } + set { this.typeFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long bookmarkPosition + { + get { return this.bookmarkPositionField; } + set { this.bookmarkPositionField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool bookmarkPositionSpecified + { + get { return this.bookmarkPositionFieldSpecified; } + set { this.bookmarkPositionFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int originalWidth + { + get { return this.originalWidthField; } + set { this.originalWidthField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool originalWidthSpecified + { + get { return this.originalWidthFieldSpecified; } + set { this.originalWidthFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int originalHeight + { + get { return this.originalHeightField; } + set { this.originalHeightField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool originalHeightSpecified + { + get { return this.originalHeightFieldSpecified; } + set { this.originalHeightFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public enum MediaType + { + + /// + music, + + /// + podcast, + + /// + audiobook, + + /// + video, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Error + { + + private int codeField; + + private string messageField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int code + { + get { return this.codeField; } + set { this.codeField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string message + { + get { return this.messageField; } + set { this.messageField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ScanStatus + { + + private bool scanningField; + + private long countField; + + private bool countFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool scanning + { + get { return this.scanningField; } + set { this.scanningField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long count + { + get { return this.countField; } + set { this.countField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool countSpecified + { + get { return this.countFieldSpecified; } + set { this.countFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class TopSongs + { + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class SimilarSongs2 + { + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class SimilarSongs + { + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArtistInfo2))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArtistInfo))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ArtistInfoBase + { + + private string biographyField; + + private string musicBrainzIdField; + + private string lastFmUrlField; + + private string smallImageUrlField; + + private string mediumImageUrlField; + + private string largeImageUrlField; + + /// + public string biography + { + get { return this.biographyField; } + set { this.biographyField = value; } + } + + /// + public string musicBrainzId + { + get { return this.musicBrainzIdField; } + set { this.musicBrainzIdField = value; } + } + + /// + public string lastFmUrl + { + get { return this.lastFmUrlField; } + set { this.lastFmUrlField = value; } + } + + /// + public string smallImageUrl + { + get { return this.smallImageUrlField; } + set { this.smallImageUrlField = value; } + } + + /// + public string mediumImageUrl + { + get { return this.mediumImageUrlField; } + set { this.mediumImageUrlField = value; } + } + + /// + public string largeImageUrl + { + get { return this.largeImageUrlField; } + set { this.largeImageUrlField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ArtistInfo2 : ArtistInfoBase + { + + private ArtistID3[] similarArtistField; + + /// + [System.Xml.Serialization.XmlElementAttribute("similarArtist")] + public ArtistID3[] similarArtist + { + get { return this.similarArtistField; } + set { this.similarArtistField = value; } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ArtistWithAlbumsID3))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ArtistID3 + { + + private string idField; + + private string nameField; + + private string coverArtField; + + private string artistImageUrlField; + + private int albumCountField; + + private System.DateTime starredField; + + private bool starredFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string coverArt + { + get { return this.coverArtField; } + set { this.coverArtField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string artistImageUrl + { + get { return this.artistImageUrlField; } + set { this.artistImageUrlField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int albumCount + { + get { return this.albumCountField; } + set { this.albumCountField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime starred + { + get { return this.starredField; } + set { this.starredField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool starredSpecified + { + get { return this.starredFieldSpecified; } + set { this.starredFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ArtistWithAlbumsID3 : ArtistID3 + { + + private AlbumID3[] albumField; + + /// + [System.Xml.Serialization.XmlElementAttribute("album")] + public AlbumID3[] album + { + get { return this.albumField; } + set { this.albumField = value; } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlbumWithSongsID3))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class AlbumID3 + { + + private string idField; + + private string nameField; + + private string artistField; + + private string artistIdField; + + private string coverArtField; + + private int songCountField; + + private int durationField; + + private long playCountField; + + private bool playCountFieldSpecified; + + private System.DateTime createdField; + + private System.DateTime starredField; + + private bool starredFieldSpecified; + + private int yearField; + + private bool yearFieldSpecified; + + private string genreField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string artistId + { + get { return this.artistIdField; } + set { this.artistIdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string coverArt + { + get { return this.coverArtField; } + set { this.coverArtField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int songCount + { + get { return this.songCountField; } + set { this.songCountField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int duration + { + get { return this.durationField; } + set { this.durationField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long playCount + { + get { return this.playCountField; } + set { this.playCountField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool playCountSpecified + { + get { return this.playCountFieldSpecified; } + set { this.playCountFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime created + { + get { return this.createdField; } + set { this.createdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime starred + { + get { return this.starredField; } + set { this.starredField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool starredSpecified + { + get { return this.starredFieldSpecified; } + set { this.starredFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int year + { + get { return this.yearField; } + set { this.yearField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool yearSpecified + { + get { return this.yearFieldSpecified; } + set { this.yearFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string genre + { + get { return this.genreField; } + set { this.genreField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ArtistInfo : ArtistInfoBase + { + + private Artist[] similarArtistField; + + /// + [System.Xml.Serialization.XmlElementAttribute("similarArtist")] + public Artist[] similarArtist + { + get { return this.similarArtistField; } + set { this.similarArtistField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Artist + { + + private string idField; + + private string nameField; + + private string artistImageUrlField; + + private System.DateTime starredField; + + private bool starredFieldSpecified; + + private int userRatingField; + + private bool userRatingFieldSpecified; + + private double averageRatingField; + + private bool averageRatingFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string artistImageUrl + { + get { return this.artistImageUrlField; } + set { this.artistImageUrlField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime starred + { + get { return this.starredField; } + set { this.starredField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool starredSpecified + { + get { return this.starredFieldSpecified; } + set { this.starredFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int userRating + { + get { return this.userRatingField; } + set { this.userRatingField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool userRatingSpecified + { + get { return this.userRatingFieldSpecified; } + set { this.userRatingFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double averageRating + { + get { return this.averageRatingField; } + set { this.averageRatingField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool averageRatingSpecified + { + get { return this.averageRatingFieldSpecified; } + set { this.averageRatingFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class AlbumInfo + { + + private string notesField; + + private string musicBrainzIdField; + + private string lastFmUrlField; + + private string smallImageUrlField; + + private string mediumImageUrlField; + + private string largeImageUrlField; + + /// + public string notes + { + get { return this.notesField; } + set { this.notesField = value; } + } + + /// + public string musicBrainzId + { + get { return this.musicBrainzIdField; } + set { this.musicBrainzIdField = value; } + } + + /// + public string lastFmUrl + { + get { return this.lastFmUrlField; } + set { this.lastFmUrlField = value; } + } + + /// + public string smallImageUrl + { + get { return this.smallImageUrlField; } + set { this.smallImageUrlField = value; } + } + + /// + public string mediumImageUrl + { + get { return this.mediumImageUrlField; } + set { this.mediumImageUrlField = value; } + } + + /// + public string largeImageUrl + { + get { return this.largeImageUrlField; } + set { this.largeImageUrlField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Starred2 + { + + private ArtistID3[] artistField; + + private AlbumID3[] albumField; + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("artist")] + public ArtistID3[] artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("album")] + public AlbumID3[] album + { + get { return this.albumField; } + set { this.albumField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Starred + { + + private Artist[] artistField; + + private Child[] albumField; + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("artist")] + public Artist[] artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("album")] + public Child[] album + { + get { return this.albumField; } + set { this.albumField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Shares + { + + private Share[] shareField; + + /// + [System.Xml.Serialization.XmlElementAttribute("share")] + public Share[] share + { + get { return this.shareField; } + set { this.shareField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Share + { + + private Child[] entryField; + + private string idField; + + private string urlField; + + private string descriptionField; + + private string usernameField; + + private System.DateTime createdField; + + private System.DateTime expiresField; + + private bool expiresFieldSpecified; + + private System.DateTime lastVisitedField; + + private bool lastVisitedFieldSpecified; + + private int visitCountField; + + /// + [System.Xml.Serialization.XmlElementAttribute("entry")] + public Child[] entry + { + get { return this.entryField; } + set { this.entryField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string url + { + get { return this.urlField; } + set { this.urlField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string description + { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string username + { + get { return this.usernameField; } + set { this.usernameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime created + { + get { return this.createdField; } + set { this.createdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime expires + { + get { return this.expiresField; } + set { this.expiresField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool expiresSpecified + { + get { return this.expiresFieldSpecified; } + set { this.expiresFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime lastVisited + { + get { return this.lastVisitedField; } + set { this.lastVisitedField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool lastVisitedSpecified + { + get { return this.lastVisitedFieldSpecified; } + set { this.lastVisitedFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int visitCount + { + get { return this.visitCountField; } + set { this.visitCountField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class PlayQueue + { + + private Child[] entryField; + + private int currentField; + + private bool currentFieldSpecified; + + private long positionField; + + private bool positionFieldSpecified; + + private string usernameField; + + private System.DateTime changedField; + + private string changedByField; + + /// + [System.Xml.Serialization.XmlElementAttribute("entry")] + public Child[] entry + { + get { return this.entryField; } + set { this.entryField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int current + { + get { return this.currentField; } + set { this.currentField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool currentSpecified + { + get { return this.currentFieldSpecified; } + set { this.currentFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long position + { + get { return this.positionField; } + set { this.positionField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool positionSpecified + { + get { return this.positionFieldSpecified; } + set { this.positionFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string username + { + get { return this.usernameField; } + set { this.usernameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime changed + { + get { return this.changedField; } + set { this.changedField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string changedBy + { + get { return this.changedByField; } + set { this.changedByField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Bookmarks + { + + private Bookmark[] bookmarkField; + + /// + [System.Xml.Serialization.XmlElementAttribute("bookmark")] + public Bookmark[] bookmark + { + get { return this.bookmarkField; } + set { this.bookmarkField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Bookmark + { + + private Child entryField; + + private long positionField; + + private string usernameField; + + private string commentField; + + private System.DateTime createdField; + + private System.DateTime changedField; + + /// + public Child entry + { + get { return this.entryField; } + set { this.entryField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long position + { + get { return this.positionField; } + set { this.positionField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string username + { + get { return this.usernameField; } + set { this.usernameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string comment + { + get { return this.commentField; } + set { this.commentField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime created + { + get { return this.createdField; } + set { this.createdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime changed + { + get { return this.changedField; } + set { this.changedField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class InternetRadioStations + { + + private InternetRadioStation[] internetRadioStationField; + + /// + [System.Xml.Serialization.XmlElementAttribute("internetRadioStation")] + public InternetRadioStation[] internetRadioStation + { + get { return this.internetRadioStationField; } + set { this.internetRadioStationField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class InternetRadioStation + { + + private string idField; + + private string nameField; + + private string streamUrlField; + + private string homePageUrlField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string streamUrl + { + get { return this.streamUrlField; } + set { this.streamUrlField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string homePageUrl + { + get { return this.homePageUrlField; } + set { this.homePageUrlField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class NewestPodcasts + { + + private PodcastEpisode[] episodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute("episode")] + public PodcastEpisode[] episode + { + get { return this.episodeField; } + set { this.episodeField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class PodcastEpisode : Child + { + + private string streamIdField; + + private string channelIdField; + + private string descriptionField; + + private PodcastStatus statusField; + + private System.DateTime publishDateField; + + private bool publishDateFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string streamId + { + get { return this.streamIdField; } + set { this.streamIdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string channelId + { + get { return this.channelIdField; } + set { this.channelIdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string description + { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public PodcastStatus status + { + get { return this.statusField; } + set { this.statusField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime publishDate + { + get { return this.publishDateField; } + set { this.publishDateField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool publishDateSpecified + { + get { return this.publishDateFieldSpecified; } + set { this.publishDateFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public enum PodcastStatus + { + + /// + @new, + + /// + downloading, + + /// + completed, + + /// + error, + + /// + deleted, + + /// + skipped, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Podcasts + { + + private PodcastChannel[] channelField; + + /// + [System.Xml.Serialization.XmlElementAttribute("channel")] + public PodcastChannel[] channel + { + get { return this.channelField; } + set { this.channelField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class PodcastChannel + { + + private PodcastEpisode[] episodeField; + + private string idField; + + private string urlField; + + private string titleField; + + private string descriptionField; + + private string coverArtField; + + private string originalImageUrlField; + + private PodcastStatus statusField; + + private string errorMessageField; + + /// + [System.Xml.Serialization.XmlElementAttribute("episode")] + public PodcastEpisode[] episode + { + get { return this.episodeField; } + set { this.episodeField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string url + { + get { return this.urlField; } + set { this.urlField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string title + { + get { return this.titleField; } + set { this.titleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string description + { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string coverArt + { + get { return this.coverArtField; } + set { this.coverArtField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string originalImageUrl + { + get { return this.originalImageUrlField; } + set { this.originalImageUrlField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public PodcastStatus status + { + get { return this.statusField; } + set { this.statusField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string errorMessage + { + get { return this.errorMessageField; } + set { this.errorMessageField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Lyrics + { + + private string artistField; + + private string titleField; + + private string[] textField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string title + { + get { return this.titleField; } + set { this.titleField = value; } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string[] Text + { + get { return this.textField; } + set { this.textField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Songs + { + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class AlbumList2 + { + + private AlbumID3[] albumField; + + /// + [System.Xml.Serialization.XmlElementAttribute("album")] + public AlbumID3[] album + { + get { return this.albumField; } + set { this.albumField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class AlbumList + { + + private Child[] albumField; + + /// + [System.Xml.Serialization.XmlElementAttribute("album")] + public Child[] album + { + get { return this.albumField; } + set { this.albumField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ChatMessages + { + + private ChatMessage[] chatMessageField; + + /// + [System.Xml.Serialization.XmlElementAttribute("chatMessage")] + public ChatMessage[] chatMessage + { + get { return this.chatMessageField; } + set { this.chatMessageField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ChatMessage + { + + private string usernameField; + + private long timeField; + + private string messageField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string username + { + get { return this.usernameField; } + set { this.usernameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long time + { + get { return this.timeField; } + set { this.timeField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string message + { + get { return this.messageField; } + set { this.messageField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Users + { + + private User[] userField; + + /// + [System.Xml.Serialization.XmlElementAttribute("user")] + public User[] user + { + get { return this.userField; } + set { this.userField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class User + { + + private int[] folderField; + + private string usernameField; + + private string emailField; + + private bool scrobblingEnabledField; + + private int maxBitRateField; + + private bool maxBitRateFieldSpecified; + + private bool adminRoleField; + + private bool settingsRoleField; + + private bool downloadRoleField; + + private bool uploadRoleField; + + private bool playlistRoleField; + + private bool coverArtRoleField; + + private bool commentRoleField; + + private bool podcastRoleField; + + private bool streamRoleField; + + private bool jukeboxRoleField; + + private bool shareRoleField; + + private bool videoConversionRoleField; + + private System.DateTime avatarLastChangedField; + + private bool avatarLastChangedFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute("folder")] + public int[] folder + { + get { return this.folderField; } + set { this.folderField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string username + { + get { return this.usernameField; } + set { this.usernameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string email + { + get { return this.emailField; } + set { this.emailField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool scrobblingEnabled + { + get { return this.scrobblingEnabledField; } + set { this.scrobblingEnabledField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int maxBitRate + { + get { return this.maxBitRateField; } + set { this.maxBitRateField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool maxBitRateSpecified + { + get { return this.maxBitRateFieldSpecified; } + set { this.maxBitRateFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool adminRole + { + get { return this.adminRoleField; } + set { this.adminRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool settingsRole + { + get { return this.settingsRoleField; } + set { this.settingsRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool downloadRole + { + get { return this.downloadRoleField; } + set { this.downloadRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool uploadRole + { + get { return this.uploadRoleField; } + set { this.uploadRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool playlistRole + { + get { return this.playlistRoleField; } + set { this.playlistRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool coverArtRole + { + get { return this.coverArtRoleField; } + set { this.coverArtRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool commentRole + { + get { return this.commentRoleField; } + set { this.commentRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool podcastRole + { + get { return this.podcastRoleField; } + set { this.podcastRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool streamRole + { + get { return this.streamRoleField; } + set { this.streamRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool jukeboxRole + { + get { return this.jukeboxRoleField; } + set { this.jukeboxRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool shareRole + { + get { return this.shareRoleField; } + set { this.shareRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool videoConversionRole + { + get { return this.videoConversionRoleField; } + set { this.videoConversionRoleField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime avatarLastChanged + { + get { return this.avatarLastChangedField; } + set { this.avatarLastChangedField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool avatarLastChangedSpecified + { + get { return this.avatarLastChangedFieldSpecified; } + set { this.avatarLastChangedFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class License + { + + private bool validField; + + private string emailField; + + private System.DateTime licenseExpiresField; + + private bool licenseExpiresFieldSpecified; + + private System.DateTime trialExpiresField; + + private bool trialExpiresFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool valid + { + get { return this.validField; } + set { this.validField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string email + { + get { return this.emailField; } + set { this.emailField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime licenseExpires + { + get { return this.licenseExpiresField; } + set { this.licenseExpiresField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool licenseExpiresSpecified + { + get { return this.licenseExpiresFieldSpecified; } + set { this.licenseExpiresFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime trialExpires + { + get { return this.trialExpiresField; } + set { this.trialExpiresField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool trialExpiresSpecified + { + get { return this.trialExpiresFieldSpecified; } + set { this.trialExpiresFieldSpecified = value; } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(JukeboxPlaylist))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class JukeboxStatus + { + + private int currentIndexField; + + private bool playingField; + + private float gainField; + + private int positionField; + + private bool positionFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int currentIndex + { + get { return this.currentIndexField; } + set { this.currentIndexField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool playing + { + get { return this.playingField; } + set { this.playingField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public float gain + { + get { return this.gainField; } + set { this.gainField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int position + { + get { return this.positionField; } + set { this.positionField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool positionSpecified + { + get { return this.positionFieldSpecified; } + set { this.positionFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class JukeboxPlaylist : JukeboxStatus + { + + private Child[] entryField; + + /// + [System.Xml.Serialization.XmlElementAttribute("entry")] + public Child[] entry + { + get { return this.entryField; } + set { this.entryField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Playlists + { + + private Playlist[] playlistField; + + /// + [System.Xml.Serialization.XmlElementAttribute("playlist")] + public Playlist[] playlist + { + get { return this.playlistField; } + set { this.playlistField = value; } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PlaylistWithSongs))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Playlist + { + + private string[] allowedUserField; + + private string idField; + + private string nameField; + + private string commentField; + + private string ownerField; + + private bool publicField; + + private bool publicFieldSpecified; + + private int songCountField; + + private int durationField; + + private System.DateTime createdField; + + private System.DateTime changedField; + + private string coverArtField; + + /// + [System.Xml.Serialization.XmlElementAttribute("allowedUser")] + public string[] allowedUser + { + get { return this.allowedUserField; } + set { this.allowedUserField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string comment + { + get { return this.commentField; } + set { this.commentField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string owner + { + get { return this.ownerField; } + set { this.ownerField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool @public + { + get { return this.publicField; } + set { this.publicField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool publicSpecified + { + get { return this.publicFieldSpecified; } + set { this.publicFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int songCount + { + get { return this.songCountField; } + set { this.songCountField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int duration + { + get { return this.durationField; } + set { this.durationField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime created + { + get { return this.createdField; } + set { this.createdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime changed + { + get { return this.changedField; } + set { this.changedField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string coverArt + { + get { return this.coverArtField; } + set { this.coverArtField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class PlaylistWithSongs : Playlist + { + + private Child[] entryField; + + /// + [System.Xml.Serialization.XmlElementAttribute("entry")] + public Child[] entry + { + get { return this.entryField; } + set { this.entryField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class SearchResult3 + { + + private ArtistID3[] artistField; + + private AlbumID3[] albumField; + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("artist")] + public ArtistID3[] artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("album")] + public AlbumID3[] album + { + get { return this.albumField; } + set { this.albumField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class SearchResult2 + { + + private Artist[] artistField; + + private Child[] albumField; + + private Child[] songField; + + /// + [System.Xml.Serialization.XmlElementAttribute("artist")] + public Artist[] artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("album")] + public Child[] album + { + get { return this.albumField; } + set { this.albumField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("song")] + public Child[] song + { + get { return this.songField; } + set { this.songField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class SearchResult + { + + private Child[] matchField; + + private int offsetField; + + private int totalHitsField; + + /// + [System.Xml.Serialization.XmlElementAttribute("match")] + public Child[] match + { + get { return this.matchField; } + set { this.matchField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int offset + { + get { return this.offsetField; } + set { this.offsetField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int totalHits + { + get { return this.totalHitsField; } + set { this.totalHitsField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class NowPlaying + { + + private NowPlayingEntry[] entryField; + + /// + [System.Xml.Serialization.XmlElementAttribute("entry")] + public NowPlayingEntry[] entry + { + get { return this.entryField; } + set { this.entryField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class NowPlayingEntry : Child + { + + private string usernameField; + + private int minutesAgoField; + + private int playerIdField; + + private string playerNameField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string username + { + get { return this.usernameField; } + set { this.usernameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int minutesAgo + { + get { return this.minutesAgoField; } + set { this.minutesAgoField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int playerId + { + get { return this.playerIdField; } + set { this.playerIdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string playerName + { + get { return this.playerNameField; } + set { this.playerNameField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class VideoConversion + { + + private string idField; + + private int bitRateField; + + private bool bitRateFieldSpecified; + + private int audioTrackIdField; + + private bool audioTrackIdFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int bitRate + { + get { return this.bitRateField; } + set { this.bitRateField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool bitRateSpecified + { + get { return this.bitRateFieldSpecified; } + set { this.bitRateFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int audioTrackId + { + get { return this.audioTrackIdField; } + set { this.audioTrackIdField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool audioTrackIdSpecified + { + get { return this.audioTrackIdFieldSpecified; } + set { this.audioTrackIdFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class AudioTrack + { + + private string idField; + + private string nameField; + + private string languageCodeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string languageCode + { + get { return this.languageCodeField; } + set { this.languageCodeField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Captions + { + + private string idField; + + private string nameField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class VideoInfo + { + + private Captions[] captionsField; + + private AudioTrack[] audioTrackField; + + private VideoConversion[] conversionField; + + private string idField; + + /// + [System.Xml.Serialization.XmlElementAttribute("captions")] + public Captions[] captions + { + get { return this.captionsField; } + set { this.captionsField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("audioTrack")] + public AudioTrack[] audioTrack + { + get { return this.audioTrackField; } + set { this.audioTrackField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("conversion")] + public VideoConversion[] conversion + { + get { return this.conversionField; } + set { this.conversionField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Videos + { + + private Child[] videoField; + + /// + [System.Xml.Serialization.XmlElementAttribute("video")] + public Child[] video + { + get { return this.videoField; } + set { this.videoField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class IndexID3 + { + + private ArtistID3[] artistField; + + private string nameField; + + /// + [System.Xml.Serialization.XmlElementAttribute("artist")] + public ArtistID3[] artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class ArtistsID3 + { + + private IndexID3[] indexField; + + private string ignoredArticlesField; + + /// + [System.Xml.Serialization.XmlElementAttribute("index")] + public IndexID3[] index + { + get { return this.indexField; } + set { this.indexField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ignoredArticles + { + get { return this.ignoredArticlesField; } + set { this.ignoredArticlesField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Genres + { + + private Genre[] genreField; + + /// + [System.Xml.Serialization.XmlElementAttribute("genre")] + public Genre[] genre + { + get { return this.genreField; } + set { this.genreField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Genre + { + + private int songCountField; + + private int albumCountField; + + private string[] textField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int songCount + { + get { return this.songCountField; } + set { this.songCountField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int albumCount + { + get { return this.albumCountField; } + set { this.albumCountField = value; } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string[] Text + { + get { return this.textField; } + set { this.textField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Directory + { + + private Child[] childField; + + private string idField; + + private string parentField; + + private string nameField; + + private System.DateTime starredField; + + private bool starredFieldSpecified; + + private int userRatingField; + + private bool userRatingFieldSpecified; + + private double averageRatingField; + + private bool averageRatingFieldSpecified; + + private long playCountField; + + private bool playCountFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute("child")] + public Child[] child + { + get { return this.childField; } + set { this.childField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string parent + { + get { return this.parentField; } + set { this.parentField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime starred + { + get { return this.starredField; } + set { this.starredField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool starredSpecified + { + get { return this.starredFieldSpecified; } + set { this.starredFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int userRating + { + get { return this.userRatingField; } + set { this.userRatingField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool userRatingSpecified + { + get { return this.userRatingFieldSpecified; } + set { this.userRatingFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double averageRating + { + get { return this.averageRatingField; } + set { this.averageRatingField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool averageRatingSpecified + { + get { return this.averageRatingFieldSpecified; } + set { this.averageRatingFieldSpecified = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long playCount + { + get { return this.playCountField; } + set { this.playCountField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool playCountSpecified + { + get { return this.playCountFieldSpecified; } + set { this.playCountFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Index + { + + private Artist[] artistField; + + private string nameField; + + /// + [System.Xml.Serialization.XmlElementAttribute("artist")] + public Artist[] artist + { + get { return this.artistField; } + set { this.artistField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class Indexes + { + + private Artist[] shortcutField; + + private Index[] indexField; + + private Child[] childField; + + private long lastModifiedField; + + private string ignoredArticlesField; + + /// + [System.Xml.Serialization.XmlElementAttribute("shortcut")] + public Artist[] shortcut + { + get { return this.shortcutField; } + set { this.shortcutField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("index")] + public Index[] index + { + get { return this.indexField; } + set { this.indexField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("child")] + public Child[] child + { + get { return this.childField; } + set { this.childField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public long lastModified + { + get { return this.lastModifiedField; } + set { this.lastModifiedField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ignoredArticles + { + get { return this.ignoredArticlesField; } + set { this.ignoredArticlesField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class MusicFolders + { + + private MusicFolder[] musicFolderField; + + /// + [System.Xml.Serialization.XmlElementAttribute("musicFolder")] + public MusicFolder[] musicFolder + { + get { return this.musicFolderField; } + set { this.musicFolderField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public partial class MusicFolder + { + + private int idField; + + private string nameField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int id + { + get { return this.idField; } + set { this.idField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name + { + get { return this.nameField; } + set { this.nameField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi", IncludeInSchema = false)] + public enum ItemChoiceType + { + + /// + album, + + /// + albumInfo, + + /// + albumList, + + /// + albumList2, + + /// + artist, + + /// + artistInfo, + + /// + artistInfo2, + + /// + artists, + + /// + bookmarks, + + /// + chatMessages, + + /// + directory, + + /// + error, + + /// + genres, + + /// + indexes, + + /// + internetRadioStations, + + /// + jukeboxPlaylist, + + /// + jukeboxStatus, + + /// + license, + + /// + lyrics, + + /// + musicFolders, + + /// + newestPodcasts, + + /// + nowPlaying, + + /// + playQueue, + + /// + playlist, + + /// + playlists, + + /// + podcasts, + + /// + randomSongs, + + /// + scanStatus, + + /// + searchResult, + + /// + searchResult2, + + /// + searchResult3, + + /// + shares, + + /// + similarSongs, + + /// + similarSongs2, + + /// + song, + + /// + songsByGenre, + + /// + starred, + + /// + starred2, + + /// + topSongs, + + /// + user, + + /// + users, + + /// + videoInfo, + + /// + videos, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.4084.0")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://subsonic.org/restapi")] + public enum ResponseStatus + { + + /// + ok, + + /// + failed, + } +} \ No newline at end of file diff --git a/MB_SubSonic/SubSonic.csproj b/MB_SubSonic/SubSonic.csproj index d023a62..f6440c1 100644 --- a/MB_SubSonic/SubSonic.csproj +++ b/MB_SubSonic/SubSonic.csproj @@ -23,6 +23,7 @@ DEBUG;TRACE prompt 4 + latest pdbonly @@ -31,6 +32,7 @@ TRACE prompt 4 + latest @@ -44,7 +46,7 @@ - + @@ -74,9 +76,24 @@ + + Designer + + + Designer + Designer + + Designer + + + Designer + + + Designer + diff --git a/MB_SubSonic/Subsonic.cs b/MB_SubSonic/Subsonic.cs index 12476e9..d085f08 100644 --- a/MB_SubSonic/Subsonic.cs +++ b/MB_SubSonic/Subsonic.cs @@ -9,8 +9,6 @@ using MusicBeePlugin.Helpers; using MusicBeePlugin.SubsonicAPI; using RestSharp; -using Directory = MusicBeePlugin.SubsonicAPI.Directory; -using ResponseStatus = MusicBeePlugin.SubsonicAPI.ResponseStatus; namespace MusicBeePlugin { @@ -34,11 +32,11 @@ public static class Subsonic public static Interfaces.Plugin.Playlist_QueryFilesExDelegate QueryPlaylistFilesEx; private static string _serverName; private static Exception _lastEx; - private static readonly object CacheFileLock = new object(); + private static readonly object CacheFileLock = new(); private static string[] _collectionNames; - private static readonly Dictionary LastModified = new Dictionary(); - private static readonly object FolderLookupLock = new object(); - private static readonly Dictionary FolderLookup = new Dictionary(); + private static readonly Dictionary LastModified = new(); + private static readonly object FolderLookupLock = new(); + private static readonly Dictionary FolderLookup = new(); public static bool Initialize() { @@ -68,9 +66,9 @@ public static bool PingServer(SubsonicSettings settings) try { var request = new RestRequest("ping"); - var response = SendRequest(request); - _serverType = GetServerTypeFromResponse(response); - return IsPingOk(response); + var result = SendRequest(request); + _serverType = result != null ? SubsonicSettings.ServerType.Subsonic : SubsonicSettings.ServerType.None; + return IsPingOk(result); } catch (Exception ex) { @@ -79,24 +77,14 @@ public static bool PingServer(SubsonicSettings settings) } } - private static SubsonicSettings.ServerType GetServerTypeFromResponse(string response) - { - if (string.IsNullOrEmpty(response)) return SubsonicSettings.ServerType.None; - // Default server type is Subsonic - return response.Contains("subsonic-response") - ? SubsonicSettings.ServerType.Subsonic - : SubsonicSettings.ServerType.None; - } - - private static bool IsPingOk(string response) + private static bool IsPingOk(Response response) { switch (_serverType) { case SubsonicSettings.ServerType.Subsonic: { - SetBackgroundTaskMessage("Detected a Subsonic server, Ping response was OK"); - var result = Response.Deserialize(response); - return result.status == ResponseStatus.ok; + SetBackgroundTaskMessage($"Detected a Subsonic server, Ping response was {response.status}"); + return response.status == SubsonicAPI.ResponseStatus.ok; } case SubsonicSettings.ServerType.None: default: @@ -195,38 +183,34 @@ public static string[] GetFolders(string path) { var request = new RestRequest("getMusicDirectory"); request.AddParameter("id", folderId); - var response = SendRequest(request); + var result = SendRequest(request); var list = new List(); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = result.Item as Directory; - if (content?.child != null) + var content = result.Item as SubsonicAPI.Directory; + if (content?.child != null) + { + var total = content.child.Length; + for (var index = 0; index < total; index++) { - var total = content.child.Count; - for (var index = 0; index < total; index++) - { - var dirChild = content.child[index]; - SetBackgroundTaskMessage($"Processing {index} of {total} Folders..."); + var dirChild = content.child[index]; + SetBackgroundTaskMessage($"Processing {index} of {total} Folders..."); - if (!dirChild.isDir) continue; + if (!dirChild.isDir) continue; - folderId = dirChild.id; - var folderName = path + dirChild.title; - list.Add(folderName); - if (!FolderLookup.ContainsKey(folderName)) - FolderLookup.Add(folderName, folderId); - } - SetBackgroundTaskMessage(""); + folderId = dirChild.id; + var folderName = path + dirChild.title; + list.Add(folderName); + if (!FolderLookup.ContainsKey(folderName)) + FolderLookup.Add(folderName, folderId); } + SetBackgroundTaskMessage(""); } folders = list.ToArray(); @@ -261,37 +245,34 @@ private static List> GetRootFolders(bool collection var collection = new List>(); var request = new RestRequest("getMusicFolders"); - var response = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + var result = SendRequest(request); + + if (result.Item is Error error) { - var result = Response.Deserialize(response); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = (MusicFolders) result.Item; - if (content.musicFolder != null) + var content = (MusicFolders) result.Item; + if (content.musicFolder != null) + { + var total = content.musicFolder.Length; + for (var index = 0; index < total; index++) { - var total = content.musicFolder.Count; - for (var index = 0; index < total; index++) - { - SetBackgroundTaskMessage($"Processing {index} of {total} music folders"); - var folder = content.musicFolder[index]; - var folderId = folder.id; - var folderName = folder.name; - - if (folderName != null && FolderLookup.ContainsKey(folderName)) - FolderLookup[folderName] = folderId; - else if (folderName != null) FolderLookup.Add(folderName, folderId); + SetBackgroundTaskMessage($"Processing {index} of {total} music folders"); + var folder = content.musicFolder[index]; + var folderId = folder.id.ToString(); + var folderName = folder.name; - collection.Add(new KeyValuePair(folderId, folderName)); - } + if (folderName != null && FolderLookup.ContainsKey(folderName)) + FolderLookup[folderName] = folderId; + else if (folderName != null) FolderLookup.Add(folderName, folderId); - SetBackgroundTaskMessage(""); + collection.Add(new KeyValuePair(folderId, folderName)); } + + SetBackgroundTaskMessage(""); } _collectionNames = new string[collection.Count]; @@ -303,9 +284,11 @@ private static List> GetRootFolders(bool collection var isDirty = false; foreach (var collectionItem in collection) + { folders.AddRange(GetIndexes(collectionItem.Key, collectionItem.Value, true, refresh && dirtyOnly, ref isDirty)); + } if (dirtyOnly && !isDirty) return null; @@ -324,46 +307,44 @@ private static IEnumerable> GetIndexes(string colle var request = new RestRequest("getIndexes"); request.AddParameter("musicFolderId", collectionId); - var response = SendRequest(request); + var result = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = result.Item as Indexes; - if (updateIsDirty && content?.lastModified != null) + var content = result.Item as Indexes; + if (updateIsDirty && content?.lastModified != null) + { + var serverLastModified = (ulong) content.lastModified; + lock (CacheFileLock) { - var serverLastModified = (ulong) content.lastModified; - lock (CacheFileLock) + if (!LastModified.TryGetValue(collectionName, out var clientLastModified)) { - if (!LastModified.TryGetValue(collectionName, out var clientLastModified)) - { - isDirty = true; - LastModified.Add(collectionName, serverLastModified); - } - else if (serverLastModified > clientLastModified) - { - isDirty = true; - LastModified[collectionName] = serverLastModified; - } + isDirty = true; + LastModified.Add(collectionName, serverLastModified); } - } - - if (content?.index != null) - foreach (var indexChild in content.index) - foreach (var artistChild in indexChild.artist) + else if (serverLastModified > clientLastModified) { - var folderId = artistChild.id; - var folderName = $"{collectionName}\\{artistChild.name}"; - FolderLookup[folderName] = folderId; - folders.Add(new KeyValuePair(indices ? folderId : folderName, collectionName)); + isDirty = true; + LastModified[collectionName] = serverLastModified; } + } + } + + if (content?.index != null) + { + foreach (var indexChild in content.index) + foreach (var artistChild in indexChild.artist) + { + var folderId = artistChild.id; + var folderName = $"{collectionName}\\{artistChild.name}"; + FolderLookup[folderName] = folderId; + folders.Add(new KeyValuePair(indices ? folderId : folderName, collectionName)); + } } SetBackgroundTaskMessage("Done Running GetIndexes"); @@ -380,39 +361,35 @@ private static void GetFolderFiles(string baseFolderName, string folderPath, str var request = new RestRequest("getMusicDirectory"); request.AddParameter("id", folderId); - var response = SendRequest(request); + var result = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response.Replace("\0", string.Empty)); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } + return; + } - var content = result.Item as Directory; + var content = result.Item as SubsonicAPI.Directory; - if (content?.child != null) + if (content?.child != null) + { + var total = content.child.Length; + for (var index = 0; index < total; index++) { - var total = content.child.Count; - for (var index = 0; index < total; index++) + SetBackgroundTaskMessage($"Processing MusicDirectory {index} of {total}..."); + var childEntry = content.child[index]; + if (!childEntry.isDir) { - SetBackgroundTaskMessage($"Processing MusicDirectory {index} of {total}..."); - var childEntry = content.child[index]; - if (!childEntry.isDir) + // Support for servers that does not provide path (eg. ownCloud Music) + if (childEntry.path == null) { - // Support for servers that does not provide path (eg. ownCloud Music) - if (childEntry.path == null) - { - childEntry.path = string.Concat(folderPath.Substring(baseFolderName.Length + 1), childEntry.id); - } - - var tags = GetTags(childEntry, baseFolderName); - if (tags != null) - files.Add(tags); + childEntry.path = string.Concat(folderPath.Substring(baseFolderName.Length + 1), childEntry.id); } + + var tags = GetTags(childEntry, baseFolderName); + if (tags != null) + files.Add(tags); } } } @@ -465,29 +442,29 @@ private static string GetFolderId(string url) var folderName = url.Substring(sectionStartIndex, charIndex - sectionStartIndex); var request = new RestRequest("getMusicDirectory"); request.AddParameter("id", folderId); - var response = SendRequest(request); + var result = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response.Replace("\0", string.Empty)); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = result.Item as Directory; - - if (content?.child != null) - foreach (var childEntry in content.child) - if (childEntry.isDir && childEntry.title == folderName) - { - folderId = childEntry.id; - if (!FolderLookup.ContainsKey(url.Substring(0, charIndex))) - FolderLookup.Add(url.Substring(0, charIndex), folderId); - break; - } + var content = result.Item as SubsonicAPI.Directory; + + if (content?.child != null) + { + foreach (var childEntry in content.child) + { + if (childEntry.isDir && childEntry.title == folderName) + { + folderId = childEntry.id; + if (!FolderLookup.ContainsKey(url.Substring(0, charIndex))) + FolderLookup.Add(url.Substring(0, charIndex), folderId); + break; + } + } } } @@ -516,36 +493,32 @@ private static string GetFileId(string url) var request = new RestRequest("getMusicDirectory"); request.AddParameter("id", folderId); - var response = SendRequest(request); + var result = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response.Replace("\0", string.Empty)); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = result.Item as Directory; - var filePath = GetTranslatedUrl(url.Substring(url.IndexOf(@"\", StringComparison.Ordinal) + 1)); + var content = result.Item as SubsonicAPI.Directory; + var filePath = GetTranslatedUrl(url.Substring(url.IndexOf(@"\", StringComparison.Ordinal) + 1)); - if (content?.child == null) - return null; + if (content?.child == null) + return null; - foreach (var childEntry in content.child) + foreach (var childEntry in content.child) + { + // Support for servers that does not provide path (eg. ownCloud Music) + if (childEntry.path == null && filePath.EndsWith(childEntry.id)) { - // Support for servers that does not provide path (eg. ownCloud Music) - if (childEntry.path == null && filePath.EndsWith(childEntry.id)) - { - return childEntry.id; - } + return childEntry.id; + } - if (childEntry.path == filePath) - { - return childEntry.id; - } + if (childEntry.path == filePath) + { + return childEntry.id; } } @@ -592,26 +565,24 @@ private static string GetCoverArtId(string url) var request = new RestRequest("getMusicDirectory"); request.AddParameter("id", folderId); - var response = SendRequest(request); + var result = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = result.Item as Directory; - var filePath = GetTranslatedUrl(url.Substring(url.IndexOf(@"\", StringComparison.Ordinal) + 1)); + var content = result.Item as SubsonicAPI.Directory; + var filePath = GetTranslatedUrl(url.Substring(url.IndexOf(@"\", StringComparison.Ordinal) + 1)); - if (content?.child == null) return null; + if (content?.child == null) return null; - foreach (var childEntry in content.child) - if (childEntry.path == filePath) - return childEntry.coverArt; + foreach (var childEntry in content.child) + { + if (childEntry.path == filePath) + return childEntry.coverArt; } return null; @@ -636,26 +607,24 @@ public static KeyValuePair[] GetFile(string url) var request = new RestRequest("getMusicDirectory"); request.AddParameter("id", folderId); - var response = SendRequest(request); + var result = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response.Replace("\0", string.Empty)); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = result.Item as Directory; - var filePath = GetTranslatedUrl(url.Substring(url.IndexOf(@"\", StringComparison.Ordinal) + 1)); + var content = result.Item as SubsonicAPI.Directory; + var filePath = GetTranslatedUrl(url.Substring(url.IndexOf(@"\", StringComparison.Ordinal) + 1)); - if (content?.child == null) return null; + if (content?.child == null) return null; - foreach (var childEntry in content.child) - if (childEntry.path == filePath) - return GetTags(childEntry, baseFolderName); + foreach (var childEntry in content.child) + { + if (childEntry.path == filePath) + return GetTags(childEntry, baseFolderName); } return null; @@ -728,23 +697,21 @@ public static KeyValuePair[] GetPlaylists() var playlists = new List>(); var request = new RestRequest("getPlaylists"); - var response = SendRequest(request); + var result = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = result.Item as Playlists; - if (content?.playlist == null) return playlists.ToArray(); + var content = result.Item as Playlists; + if (content?.playlist == null) return playlists.ToArray(); - foreach (var playlistEntry in content.playlist) - playlists.Add(new KeyValuePair(playlistEntry.id, playlistEntry.name)); + foreach (var playlistEntry in content.playlist) + { + playlists.Add(new KeyValuePair(playlistEntry.id, playlistEntry.name)); } return playlists.ToArray(); @@ -756,29 +723,25 @@ public static KeyValuePair[][] GetPlaylistFiles(string id) var files = new List[]>(); var request = new RestRequest("getPlaylist"); request.AddParameter("id", id); - var response = SendRequest(request); + var result = SendRequest(request); - if (_serverType == SubsonicSettings.ServerType.Subsonic) + if (result.Item is Error error) { - var result = Response.Deserialize(response.Replace("\0", string.Empty)); - if (result.Item is Error error) - { - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } + return null; + } - var content = result.Item as PlaylistWithSongs; - if (content?.entry == null) return files.ToArray(); + var content = result.Item as PlaylistWithSongs; + if (content?.entry == null) return files.ToArray(); - foreach (var playlistEntry in content.entry) - { - var tags = GetTags(playlistEntry, null); - if (tags != null) - files.Add(tags); - } + foreach (var playlistEntry in content.entry) + { + var tags = GetTags(playlistEntry, null); + if (tags != null) + files.Add(tags); } - + return files.ToArray(); } @@ -892,7 +855,7 @@ public static Exception GetError() return _lastEx; } - private static string SendRequest(RestRequest request) + private static Response SendRequest(RestRequest request) { var client = new RestClient(_serverName + "rest/"); request.AddParameter("u", _currentSettings.Username); @@ -917,15 +880,15 @@ private static string SendRequest(RestRequest request) request.AddParameter("c", "MusicBee"); - var response = client.ExecuteAsync(request).Result; - if (response.IsSuccessful) return response.Content; + var response = client.ExecuteAsync(request).Result; + if (response.IsSuccessful) return response.Data; const string message = "Error retrieving response from Subsonic server:"; MessageBox.Show($@"{message} {response.ErrorException}", @"Subsonic Plugin Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - return response.Content; + return response.Data; } private static byte[] DownloadData(RestRequest request) @@ -953,20 +916,14 @@ private static byte[] DownloadData(RestRequest request) request.AddParameter("c", "MusicBee"); - var response = client.ExecuteAsync(request).Result; + var response = client.ExecuteAsync(request).Result; - if (!response.ContentType.StartsWith("text/xml")) return response.RawBytes; + if (response.ContentType != null && !response.ContentType.StartsWith("text/xml")) return response.RawBytes; - if (_serverType == SubsonicSettings.ServerType.Subsonic) - { - var result = Response.Deserialize(response.Content.Replace("\0", string.Empty)); - if (!(result.Item is Error error)) return response.RawBytes; + if (response.Data?.Item is not Error error) return response.RawBytes; - MessageBox.Show($@"An error has occurred: + MessageBox.Show($@"An error has occurred: {error.message}", CaptionServerError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return null; - } - return null; }