Controls the application, setting up and updating all windows, scanning directories for Hostile Worlds logs and parsing them using an additional thread.
Ejemplo n.º 1
0
        /// <summary>
        /// Constructs and initialized a new main window for the application.
        /// </summary>
        /// <param name="controller">
        /// the controller to be notified whenever the user interacts with
        /// the new window
        /// </param>
        public MainForm(Controller controller)
        {
            InitializeComponent();

            this.controller = controller;

            // set title
            this.Text = controller.GetApplicationTitle() + " " + controller.GetApplicationVersion();

            // prepare browse folder dialog
            FolderBrowserDialog.Description = "Select a folder to be recursively scanned for log files!";
            FolderBrowserDialog.ShowNewFolderButton = false;

            // prepare export results dialog
            SaveFileDialog.AddExtension = true;
            SaveFileDialog.FileName = "results.txt";
            SaveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            SaveFileDialog.OverwritePrompt = true;
            SaveFileDialog.ValidateNames = true;

            // prepare status strip
            ResetStatusStrip();
        }
        /// <summary>
        /// Constructs a new parser for extracting detailed information from
        /// Hostile Worlds log files, loading the list of valid squad member
        /// class names and valid ability names.
        /// </summary>
        /// <param name="controller">
        /// the controller to be notified whenever any parse errors occur
        /// </param>
        public HostileWorldsLogParser(Controller controller)
        {
            this.controller = controller;

            AddSquadMemberNames();
            AddAbilityNames();
        }