/// <summary>
        /// Returns a FileID for a rogue file (file that isn't archived).
        /// </summary>
        /// <param name="Entry">The entry generated for the file.</param>
        /// <returns>A FileID (see RogueFileIDs enum in Database.cs)</returns>
        public static uint GetFileID(Far3Entry Entry)
        {
            try
            {
                string Filename = Path.GetFileName(Entry.Filename);
                Filename = Filename.Replace("-", "_");
                Filename = Filename.Substring(0, Filename.IndexOf("."));

                return (uint)Enum.Parse(typeof(RogueFileIDs), Filename);
            }
            catch (ArgumentException)
            {
                return (uint)Entry.GetHashCode();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns a FileID for a rogue file (file that isn't archived).
        /// </summary>
        /// <param name="Entry">The entry generated for the file.</param>
        /// <returns>A FileID (see RogueFileIDs enum in Database.cs)</returns>
        public static uint GetFileID(Far3Entry Entry)
        {
            try
            {
                string[] Dirs = Path.GetDirectoryName(Entry.Filename).Split("\\".ToCharArray());
                string Filename = Dirs[1] + "_" + Path.GetFileName(Entry.Filename);
                Filename = Filename.Replace("-", "_");
                Filename = Filename.Substring(0, Filename.IndexOf("."));

                return (uint)Enum.Parse(typeof(RogueFileIDs), Filename);
            }
            catch (ArgumentException)
            {
                return (uint)Entry.GetHashCode();
            }
        }