/// <summary>
        /// Class constructor
        /// </summary>
        /// <param name="conflicts">The list of file conflicts.</param>
        public HifConflictsForm(HifConflictCollection conflicts)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            pictureBox.Image = SystemIcons.Exclamation.ToBitmap();

            // There appears to be a bug in the 1.0 version of the framework.  On my
            // 3.2ghz machine, if listBox.Items.Add(conflict) is placed in the
            // foreach array it hangs, unless you slow it down somehow.  Moving
            // the add outside the loop and changing it to an AddRange() to add all
            // of the conflicts in one shot makes it work correctly, thus the change
            // to the code.

            // Add all of the conflicts to the list box.
            HifConflict[] conflictArray = new HifConflict[conflicts.Count];
            for (int i = 0; i < conflicts.Count; i++)
                conflictArray[i] = conflicts[i];
            listBox.Items.AddRange(conflictArray);
        }
        /// <summary>
        /// This method checks to see if any of the proposed hifs are installed on any of the
        /// given modules, returning a collection of conflicts that can be displayed to the user.
        /// </summary>
        /// <param name="proposedHifs">The list of hifs that the user wants to add to the modules</param>
        /// <param name="modules">The list of modules</param>
        /// <returns>A collection containing the list of conflicts, or null if there are no
        /// conflicts</returns>
        public static HifConflictCollection CheckInstalledHifs(HakInfo[] proposedHifs, string[] modules)
        {
            // Force the thread to use the invariant culture to make the install
            // code work on foreign language versions of windows.
            CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            try
            {
                HifConflictCollection conflicts = null;
                foreach (string module in modules)
                {
                    // Load the module info data and create an object for it.
                    MemoryStream stream = Erf.GetFile(NWNInfo.GetFullFilePath(module), ModuleInfo.FileName);
                    if (null == stream) NWN.FileTypes.Tools.NWNLogger.Log(10, "HakInstaller.CheckInstalledHifs, Erf.GetFile() returned null!!!");
                    ModuleInfo info = new ModuleInfo(stream);

                    // Load the installed hifs in module if any.
                    string[] installedHifs;
                    float[] installedVersions;
                    info.GetInstalledHakInfos(out installedHifs, out installedVersions);

                    // Create a StringCollection of the proposed hifs so we can use IndexOf(),
                    // then check to see if there are any hif conflicts, if there are then
                    // add them to the conflict list.
                    StringCollection proposedHifsColl = new StringCollection();
                    foreach (HakInfo hif in proposedHifs)
                        proposedHifsColl.Add(Path.GetFileNameWithoutExtension(hif.Name).ToLower());
                    for (int i = 0; i < installedHifs.Length; i++)
                    {
                        if (proposedHifsColl.Contains(installedHifs[i].ToLower()))
                        {
                            HifConflict conflict = new HifConflict(module,
                                installedHifs[i], installedVersions[i], 0);
                            if (null == conflicts) conflicts = new HifConflictCollection();
                            conflicts.Add(conflict);
                        }
                    }
                }

                return conflicts;
            }
            finally
            {
                Thread.CurrentThread.CurrentCulture = currentCulture;
            }
        }
 /// <summary>
 /// Adds a conflict to the collection.
 /// </summary>
 /// <param name="conflict"></param>
 public void Add(HifConflict conflict)
 {
     InnerList.Add(conflict);
 }