Ejemplo n.º 1
0
        /// <summary>
        /// Remove a directory that will be searched for mods
        /// </summary>
        /// <param name="path">The path of the search directory.</param>
        public void RemoveSearchDirectory(string path)
        {
            ModSearchDirectory directory = searchDirectories.Find(s => s.path.NormalizedPath() == path.NormalizedPath());

            if (directory == null)
            {
                return;
            }

            directory.Dispose();

            searchDirectories.Remove(directory);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a directory that will be searched for Mods
        /// </summary>
        /// <param name="path">The path of the search directory.</param>
        public void AddSearchDirectory(string path)
        {
            if (searchDirectories.Any(s => s.path.NormalizedPath() == path.NormalizedPath()))
            {
                return;
            }

            ModSearchDirectory directory = new ModSearchDirectory(path);

            directory.ModFound   += OnModFound;
            directory.ModRemoved += OnModRemoved;
            directory.ModChanged += OnModChanged;

            searchDirectories.Add(directory);

            directory.Refresh();
        }