예제 #1
0
        private async void buttonSearchForWorldDb_Click(object sender, EventArgs e)
        {
            buttonSearchForWorldDb.Enabled = false;

            WorldDatabase worldDatabase = new WorldDatabase(textBoxHost.Text, CustomConverter.ToUInt32(textBoxPort.Text), textBoxUsername.Text, textBoxPassword.Text, "");
            List <string> databaseNames = await SAI_Editor_Manager.Instance.GetDatabasesInConnection(textBoxHost.Text, textBoxUsername.Text, CustomConverter.ToUInt32(textBoxPort.Text), textBoxPassword.Text, worldDatabase);

            if (databaseNames != null && databaseNames.Count > 0)
            {
                using (var selectDatabaseForm = new SelectDatabaseForm(databaseNames, textBoxWorldDatabase))
                    selectDatabaseForm.ShowDialog(this);
            }

            buttonSearchForWorldDb.Enabled = true;
        }
예제 #2
0
        static void Main()
        {
            RememberTextBoxController.BindSettings(Settings.Default, Settings.Default);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var sb = SelectDatabaseForm.ShowPrompt(null);

            if (sb != null)
            {
                Application.Run(new DBStatusForm(sb));
                Settings.Default.Save();
            }
        }
예제 #3
0
        public void Database_Connect()
        {
            if (DiscardChangesCheck())
            {
                return;
            }

            if (ConnectForm.Show() == DialogResult.Cancel)
            {
                return;
            }

            switch (ConnectForm.LocalInstanceType)
            {
            case EmbeddedInstanceType.None:
                if (SelectDatabaseForm.Show(ConnectForm.Server) == DialogResult.Cancel)
                {
                    return;
                }
                break;

            case EmbeddedInstanceType.PowerBI:
                if (Preferences.Current.AllowUnsupportedPBIFeatures)
                {
                    MessageBox.Show("Experimental Power BI features is enabled. You can edit any object and property of this Power BI Desktop model, but be aware that many types of changes ARE NOT CURRENTLY SUPPORTED by Microsoft.\n\nKeep a backup of your .pbix file and proceed at your own risk.", "Power BI Desktop Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                break;

            case EmbeddedInstanceType.Devenv:
                MessageBox.Show("You are connecting to an integrated workspace in Visual Studio.\n\nChanges made through Tabular Editor may not be properly persisted to the Tabular Project in Visual Studio and may corrupt your model file.\n\nMake sure to keep a backup of the Model.bim file and proceed at your own risk.", "Connecting to embedded model", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                break;
            }

            UI.StatusLabel.Text = "Opening Model from Database...";
            ClearUI();
            UpdateUIText();

            Database_Open(ConnectForm.ConnectionString,
                          string.IsNullOrEmpty(ConnectForm.LocalInstanceName) ? SelectDatabaseForm.DatabaseName : null);
        }
        public void Database_Connect()
        {
            if (DiscardChangesCheck())
            {
                return;
            }

            if (ConnectForm.Show() == DialogResult.Cancel)
            {
                return;
            }

            switch (ConnectForm.LocalInstanceType)
            {
            case EmbeddedInstanceType.None:
                if (SelectDatabaseForm.Show(ConnectForm.Server) == DialogResult.Cancel)
                {
                    return;
                }
                break;

            case EmbeddedInstanceType.PowerBI:
                MessageBox.Show("You are connecting to a Tabular model in Power BI Desktop.\n\nTabular Editor uses the TOM to make changes to the model, which is UNSUPPORTED and could corrupt your .pbix file.\n\nPower BI Desktop will not synchronize the user interface with the changes you apply to the model until you manually refresh the model in Power BI Desktop.\n\nMake sure to keep a backup of the .pbix file, and proceed at your own risk.", "Connecting to embedded model", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                break;

            case EmbeddedInstanceType.Devenv:
                MessageBox.Show("You are connecting to an integrated workspace in Visual Studio.\n\nChanges made through Tabular Editor may not be properly persisted to the Tabular Project in Visual Studio and may corrupt your model file.\n\nMake sure to keep a backup of the Model.bim file and proceed at your own risk.", "Connecting to embedded model", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                break;
            }

            UI.StatusLabel.Text = "Opening Model from Database...";
            ClearUI();
            UpdateUIText();

            Database_Open(ConnectForm.ConnectionString,
                          string.IsNullOrEmpty(ConnectForm.LocalInstanceName) ? SelectDatabaseForm.DatabaseID : null);
        }
예제 #5
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     SelectDatabaseForm form = new SelectDatabaseForm();
     form.ShowDialog();
 }