AniDBmini.Collections.MylistEntry.FromFile C# (CSharp) Méthode

FromFile() public static méthode

public static FromFile ( FileEntry entry ) : MylistEntry
entry FileEntry
Résultat MylistEntry
        public static MylistEntry FromFile(FileEntry entry)
        {
            MylistEntry m_entry = new MylistEntry();
            TimeSpan length = TimeSpan.FromSeconds(entry.length);

            m_entry.OriginalEntry = entry;
            m_entry.ID = entry.fid;

            string fileInfo = String.Empty;

            if (!string.IsNullOrEmpty(entry.vres) || !string.IsNullOrEmpty(entry.source) ||
                !string.IsNullOrEmpty(entry.vcodec) || !string.IsNullOrEmpty(entry.acodec))
                fileInfo = String.Format(" ({0} {1} {2} {3})", entry.vres, entry.source, entry.vcodec, "- " + entry.acodec);

            if (!entry.generic)
                m_entry.Col0 = String.Format("[{0}]{1}", entry.Group.group_abbr, fileInfo.Replace("  ", " "));
            else
                m_entry.Col0 = "generic file";

            if (entry.watcheddate != null)
                m_entry.Col2 = String.Format("{0} {1}", entry.watcheddate.ToDateTime().ToShortDateString(),
                                                        entry.watcheddate.ToDateTime().ToShortTimeString());
            m_entry.Col4 = length.ToFormattedLength();
            m_entry.Col5 = entry.size.ToFormattedBytes();

            return m_entry;
        }