C# Class TVSorter.Storage.Xml

Class that manages access to the XML file.
Inheritance: IStorageProvider
Afficher le fichier Open project: a-jackson/tvsorter

Méthodes publiques

Méthode Description
GetDuplicateEpisodes ( ) : IEnumerable

Gets the episodes that have more than 1 file grouped by show.

GetMissingEpisodes ( ) : IEnumerable

Gets the episodes that are missing grouped by show.

GetName ( string name ) : System.Xml.Linq.XName

Gets the XName for a name.

LoadMissingEpisodeSettings ( MissingEpisodeSettings settings ) : void

Loads the missing episode settings from the XML file.

LoadSettings ( Settings settings ) : void

Reads the settings from the XML file.

LoadTvShows ( ) : IEnumerable

Loads all the TVShows from the XML file.

RemoveShow ( TvShow show ) : void

Removes the specified show from the storage.

SaveEpisode ( Episode episode ) : void

Saves the specified episode.

SaveMissingEpisodeSettings ( MissingEpisodeSettings settings ) : void

Saves the missing episode settings into the XML file.

SaveSettings ( Settings settings ) : void

Saves the specified settings into the XML file.

SaveShow ( TvShow show ) : void

Saves the specified show. Updates if it already exists and adds if it doesn't

SaveShows ( IEnumerable shows ) : void

Saves a collection of shows.

Xml ( ) : System

Initializes a new instance of the Xml class. Initialises a new instance of the TvShowXml class.

Private Methods

Méthode Description
GetDocument ( ) : void

Get the XDocument instance of the XML file.

GetEpisodes ( bool>.Func fileCountSelector ) : IEnumerable

Gets the episodes based on the specified function of file count.

Initialise ( ) : void

Initialises the class for reading the XML file.

NewTvShow ( System.Xml.Linq.XElement element ) : TvShow

Gets a new TVShow from the specified element.

OnSettingsSaved ( ) : void

Fires the SettingsSaved event.

OnTvShowAdded ( TvShow show ) : void

Fires a TVShow added event.

OnTvShowChanged ( TvShow show ) : void

Fires a TvShowChanged event.

OnTvShowRemoved ( TvShow show ) : void

Fires a TvShowRemoved event.

SanitizeXml ( System.Xml.Linq.XElement root ) : void

Santizes the XML file of empty namespaces

UpdateToVersion2 ( System.Xml.Linq.XElement root ) : void

Updates the specified element to XML format version 2.

UpdateToVersion3 ( System.Xml.Linq.XElement root ) : void

Updates the XML to verison 3.

UpdateToVersion4 ( System.Xml.Linq.XElement root ) : void

Updates the XML to version 4

UpdateToVersion5 ( System.Xml.Linq.XElement root ) : void

Updates the xml to version 5

ValidateXml ( string schema ) : void

Validates the XML file against the specified schema.

Method Details

GetDuplicateEpisodes() public méthode

Gets the episodes that have more than 1 file grouped by show.
public GetDuplicateEpisodes ( ) : IEnumerable
Résultat IEnumerable

GetMissingEpisodes() public méthode

Gets the episodes that are missing grouped by show.
public GetMissingEpisodes ( ) : IEnumerable
Résultat IEnumerable

GetName() public static méthode

Gets the XName for a name.
public static GetName ( string name ) : System.Xml.Linq.XName
name string /// The name to get. ///
Résultat System.Xml.Linq.XName

LoadMissingEpisodeSettings() public méthode

Loads the missing episode settings from the XML file.
public LoadMissingEpisodeSettings ( MissingEpisodeSettings settings ) : void
settings TVSorter.Model.MissingEpisodeSettings /// The settings to load into. ///
Résultat void

LoadSettings() public méthode

Reads the settings from the XML file.
public LoadSettings ( Settings settings ) : void
settings TVSorter.Model.Settings /// The settings to set from the XML. ///
Résultat void

LoadTvShows() public méthode

Loads all the TVShows from the XML file.
public LoadTvShows ( ) : IEnumerable
Résultat IEnumerable

RemoveShow() public méthode

Removes the specified show from the storage.
public RemoveShow ( TvShow show ) : void
show TvShow /// The show to remove. ///
Résultat void

SaveEpisode() public méthode

Saves the specified episode.
public SaveEpisode ( Episode episode ) : void
episode Episode /// The episode to save. ///
Résultat void

SaveMissingEpisodeSettings() public méthode

Saves the missing episode settings into the XML file.
public SaveMissingEpisodeSettings ( MissingEpisodeSettings settings ) : void
settings TVSorter.Model.MissingEpisodeSettings /// The settings to save. ///
Résultat void

SaveSettings() public méthode

Saves the specified settings into the XML file.
public SaveSettings ( Settings settings ) : void
settings TVSorter.Model.Settings /// The settings to save. ///
Résultat void

SaveShow() public méthode

Saves the specified show. Updates if it already exists and adds if it doesn't
public SaveShow ( TvShow show ) : void
show TvShow /// The show to save. ///
Résultat void

SaveShows() public méthode

Saves a collection of shows.
public SaveShows ( IEnumerable shows ) : void
shows IEnumerable /// The shows to save. ///
Résultat void

Xml() public méthode

Initializes a new instance of the Xml class. Initialises a new instance of the TvShowXml class.
public Xml ( ) : System
Résultat System