コード例 #1
0
        private static string GetDatabaseFilePath(WarcraftVersion version, DatabaseName databaseName)
        {
            var path = Path.Combine
                       (
                TestContext.CurrentContext.WorkDirectory,
                "Content",
                version.ToString(),
                "DBFilesClient",
                $"{databaseName}.dbc"
                       );

            return(path);
        }
コード例 #2
0
        /// <summary>
        /// Handles the add path button clicked event.
        /// </summary>
        /// <param name="sender">The sending object.</param>
        /// <param name="eventArgs">The event arguments.</param>
        private void OnAddPathButtonClicked(object sender, EventArgs eventArgs)
        {
            Uri defaultLocation = new Uri(Environment.GetFolderPath(Environment.SpecialFolder.Desktop));

            this.PathChooser.SetCurrentFolderUri(defaultLocation.ToString());

            switch ((ResponseType)this.NewGamePathDialog.Run())
            {
            case ResponseType.Ok:
            {
                string          alias           = this.AliasEntry.Text;
                WarcraftVersion selectedVersion = (WarcraftVersion)this.GameVersionCombo.Active;
                Uri             uriToStore      = new Uri(this.PathChooser.CurrentFolderUri);

                if (Directory.Exists(uriToStore.LocalPath))
                {
                    this.GamePathListStore.AppendValues(alias, uriToStore.LocalPath, (uint)selectedVersion, selectedVersion.ToString());
                    this.DidGameListChange = true;
                }

                this.NewGamePathDialog.Hide();
                break;
            }

            default:
            {
                this.NewGamePathDialog.Hide();
                break;
            }
            }
        }