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

Retrieves mylist stats.
public MyListStats ( ) : int[]
Результат int[]
Пример #1
0
        /// <summary>
        /// Retrieves and formats mylist stats.
        /// </summary>
        private void InitializeStats()
        {
            int[] stats = m_aniDBAPI.MyListStats();

            for (int i = 0; i < stats.Length; i++)
            {
                string text = AniDBAPI.statsText[i], value;
                int    stat = stats[i];

                if (text != "x")
                {
                    if (i == 3)
                    {
                        value = ((double)stat).ToFormattedBytes(ExtensionMethods.BYTE_UNIT.MB, ExtensionMethods.BYTE_UNIT.GB);
                    }
                    else if (i == 16)
                    {
                        int days    = (int)Math.Floor((stat / 60f) / 24f);
                        int hours   = (int)Math.Floor((((stat / 60f) / 24f) - (int)Math.Floor((stat / 60f) / 24f)) * 24);
                        int minutes = (int)((Math.Round((((stat / 60f) / 24f) - (int)Math.Floor((stat / 60f) / 24f)) * 24, 2) - hours) * 60);
                        value = days + "d " + hours + "h " + minutes + "m";
                    }
                    else if (i >= 10 && i <= 12)
                    {
                        value = stat + "%";
                    }
                    else
                    {
                        value = stat.ToString();
                    }

                    mylistStatsList.Add(new MylistStat(text, value));
                }
            }
        }