private int countAnimeEpisodes(string anime_name) { DirectoryHandler anime_dir = new DirectoryHandler(); int count = anime_dir.getEpisodes(@"M:/anime\", anime_name).Count; return(count); }
public void createXml() { DirectoryHandler directory = new DirectoryHandler(); List <string> animelist = new List <string>(); animelist = directory.getNameList("M:/anime"); List <string> pathlist = new List <string>(); XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; XmlWriter xmlWriter = XmlWriter.Create(@"C:\Users\Toricima\Desktop\Audio\Work music\Animelist.xml", settings); xmlWriter.WriteStartDocument(); xmlWriter.WriteStartElement("animes"); foreach (string anime in animelist) { pathlist = getAnimePath(anime); xmlWriter.WriteStartElement("anime"); xmlWriter.WriteAttributeString("title", anime); xmlWriter.WriteStartElement("story"); xmlWriter.WriteString(""); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("episodes"); xmlWriter.WriteString(countAnimeEpisodes(anime).ToString()); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("studio"); xmlWriter.WriteString(""); xmlWriter.WriteEndElement(); xmlWriter.WriteStartElement("path"); xmlWriter.WriteString(""); xmlWriter.WriteEndElement(); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndDocument(); xmlWriter.Flush(); xmlWriter.Close(); }
public Mfield() { InitializeComponent(); DirectoryHandler directory = new DirectoryHandler(); _items = directory.getNameList("M:/anime"); _items = directory.getNameList("H:/Anime"); AnimeList.DataSource = _items; AnimeCount = _items.Count; _items.Clear(); Check_label.Text = AnimeCount.ToString(); _items = directory.getNameList("M:/movie"); MovieList.DataSource = _items; MovieCount = _items.Count; }
private void AnimeList_SelectedIndexChanged(object sender, EventArgs e) { string Path = ""; string selected_episode; if (PathSwitch() == MovieTab) { Check_label.Text = MovieCount.ToString(); selected_episode = MovieList.Text; Path = "M:/Movie/"; } else { Check_label.Text = AnimeCount.ToString(); selected_episode = AnimeList.Text; Path = @"M:\anime\"; if (!Directory.Exists(Path + selected_episode)) { Path = @"H:\anime\"; } } string[] ext = { "mkv", "avi", "MP4", "m4p" }; _episode.Clear(); DirectoryHandler episodes = new DirectoryHandler(); _episode = episodes.getEpisodes(Path, selected_episode); EpisodeList.DataSource = null; EpisodeList.DataSource = _episode; ep_label.Text = "Episode: " + _episode.Count.ToString(); Name_label.Text = "Name: " + selected_episode; }
private List <string> getAnimePath(string anime_name) { DirectoryHandler anime_dir = new DirectoryHandler(); return(anime_dir.getEpisodes(@"M:/anime\", anime_name)); }