C# Класс TVSorter.Storage.Xml

Class that manages access to the XML file.
Наследование: IStorageProvider
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

GetDuplicateEpisodes() публичный Метод

Gets the episodes that have more than 1 file grouped by show.
public GetDuplicateEpisodes ( ) : IEnumerable
Результат IEnumerable

GetMissingEpisodes() публичный Метод

Gets the episodes that are missing grouped by show.
public GetMissingEpisodes ( ) : IEnumerable
Результат IEnumerable

GetName() публичный статический Метод

Gets the XName for a name.
public static GetName ( string name ) : System.Xml.Linq.XName
name string /// The name to get. ///
Результат System.Xml.Linq.XName

LoadMissingEpisodeSettings() публичный Метод

Loads the missing episode settings from the XML file.
public LoadMissingEpisodeSettings ( MissingEpisodeSettings settings ) : void
settings TVSorter.Model.MissingEpisodeSettings /// The settings to load into. ///
Результат void

LoadSettings() публичный Метод

Reads the settings from the XML file.
public LoadSettings ( Settings settings ) : void
settings TVSorter.Model.Settings /// The settings to set from the XML. ///
Результат void

LoadTvShows() публичный Метод

Loads all the TVShows from the XML file.
public LoadTvShows ( ) : IEnumerable
Результат IEnumerable

RemoveShow() публичный Метод

Removes the specified show from the storage.
public RemoveShow ( TvShow show ) : void
show TvShow /// The show to remove. ///
Результат void

SaveEpisode() публичный Метод

Saves the specified episode.
public SaveEpisode ( Episode episode ) : void
episode Episode /// The episode to save. ///
Результат void

SaveMissingEpisodeSettings() публичный Метод

Saves the missing episode settings into the XML file.
public SaveMissingEpisodeSettings ( MissingEpisodeSettings settings ) : void
settings TVSorter.Model.MissingEpisodeSettings /// The settings to save. ///
Результат void

SaveSettings() публичный Метод

Saves the specified settings into the XML file.
public SaveSettings ( Settings settings ) : void
settings TVSorter.Model.Settings /// The settings to save. ///
Результат void

SaveShow() публичный Метод

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. ///
Результат void

SaveShows() публичный Метод

Saves a collection of shows.
public SaveShows ( IEnumerable shows ) : void
shows IEnumerable /// The shows to save. ///
Результат void

Xml() публичный Метод

Initializes a new instance of the Xml class. Initialises a new instance of the TvShowXml class.
public Xml ( ) : System
Результат System