Ejemplo n.º 1
0
 // название жанра (код)
 public static string cyrillicGenreNameAndCode(string GenreCodes, ref FB2UnionGenres fb2g)
 {
     if (GenreCodes.IndexOf(';') != -1)
     {
         string   ret   = string.Empty;
         string[] Codes = GenreCodes.Split(';');
         foreach (string code in Codes)
         {
             string Name = fb2g.GetFBGenreName(code.Trim());
             ret += (string.IsNullOrEmpty(Name) ? "?" : Name) + " (" + code.Trim() + ")" + "; ";
             ret.Trim();
         }
         return(ret.Substring(0, ret.LastIndexOf(";")).Trim());
     }
     return(fb2g.GetFBGenreName(GenreCodes) + " (" + GenreCodes + ")");
 }
Ejemplo n.º 2
0
        // загрузка Жанров для правки
        private void loadGenresFromFB2Files(Enums.TitleInfoEnum TitleInfoType)
        {
            FB2UnionGenres fb2g = new FB2UnionGenres();

            foreach (FB2ItemInfo Info in m_GenreFB2InfoList)
            {
                if (Info.FictionBook != null)
                {
                    IList <Genre> GenresList = TitleInfoType == Enums.TitleInfoEnum.TitleInfo
                                                ? Info.FictionBook.TIGenres : Info.FictionBook.STIGenres;
                    if (GenresList != null)
                    {
                        foreach (Genre g in GenresList)
                        {
                            if (g != null)
                            {
                                if (!WorksWithBooks.genreIsExist(GenresListView, g, fb2g))
                                {
                                    ListViewItem lvi = new ListViewItem(
                                        !string.IsNullOrEmpty(g.Name)
                                                                                ? fb2g.GetFBGenreName(g.Name) + " (" + g.Name + ")"
                                                                                : string.Empty
                                        );
                                    lvi.SubItems.Add(!string.IsNullOrEmpty(g.Math.ToString()) ? g.Math.ToString() : string.Empty);
                                    if (!string.IsNullOrEmpty(g.Name))
                                    {
                                        GenresListView.Items.Add(lvi);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        // название жанра по его коду
        public static string cyrillicGenreName(string GenreCodes, ref FB2UnionGenres fb2g)
        {
            if (GenreCodes.IndexOf(';') != -1)
            {
                string   ret   = string.Empty;
                string[] Codes = GenreCodes.Split(';');
                foreach (string code in Codes)
                {
                    string Name = fb2g.GetFBGenreName(code.Trim());
                    ret += (string.IsNullOrEmpty(Name) ? "?" : Name) + "; ";
                    ret.Trim();
                }
                string ReturnValue = ret.Substring(0, ret.LastIndexOf(";")).Trim();
                return(ReturnValue.IndexOf(";") != 0 ? ReturnValue : GenreCodes);
            }
            string RetValue = fb2g.GetFBGenreName(GenreCodes);

            return(!string.IsNullOrEmpty(RetValue) ? RetValue : GenreCodes);
        }