コード例 #1
0
ファイル: MergeUi.xaml.cs プロジェクト: GoEddie/MergeUi
        private void Projects_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ClearProject();

            if (Projects.SelectedValue == null)
            {
                return;
            }

            var projectName = Projects.SelectedValue.ToString();

            if (String.IsNullOrEmpty(projectName))
            {
                return;
            }

            Schemas.ItemsSource = null;
            Tables.ItemsSource  = null;

            _currentProject = _solution.GetProject(projectName);

            if (string.IsNullOrEmpty(_currentProject.GetScript(ScriptType.PostDeploy)))
            {
                MessageBox.Show(
                    "The project needs a post deploy script - add one anywhere in the project and refresh", "MergeUi");
                return;
            }


            Schemas.ItemsSource = _currentProject.GetSchemas();
        }
コード例 #2
0
        private void BuildScriptGateways()
        {
            var path = _project.GetScript(ScriptType.PreDeploy);

            if (!string.IsNullOrEmpty(path))
            {
                _scriptGateways["Pre"] = new ScriptFileGateway(_project, path);
            }


            path = _project.GetScript(ScriptType.PostDeploy);

            if (!string.IsNullOrEmpty(path))
            {
                _scriptGateways["Post"] = new ScriptFileGateway(_project, path);
            }
        }
コード例 #3
0
        private void Projects_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (null == Projects.SelectedValue)
                {
                    return;
                }

                var projectName = Projects.SelectedValue.ToString();

                if (String.IsNullOrEmpty(projectName))
                {
                    return;
                }

                Schemas.ItemsSource = null;
                Tables.ItemsSource  = null;

                _currentProject = _solution.GetProject(projectName);

                if (string.IsNullOrEmpty(_currentProject.GetScript(ScriptType.PreDeploy)) &&
                    string.IsNullOrEmpty(_currentProject.GetScript(ScriptType.PostDeploy)))
                {
                    MessageBox.Show(
                        "The project needs a post deploy script - add one anywhere in the project and refresh", "MergeUi");
                    return;
                }

                LastBuildTime.Text  = string.Format("Last Dacpac Build Time: {0}", _currentProject.GetLastBuildTime());
                Schemas.ItemsSource = _currentProject.GetSchemas();
            }
            catch (Exception ex)
            {
                Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window "; });

                OutputWindowMessage.WriteMessage("Error reading project: {0}", ex.Message);
            }
        }