// Occurs when the user clicks the "Advanced..." button.
        private void AdvancedButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_state != null)
            {
                string password           = m_sqlServerSetup.Password;
                string connectionString   = m_sqlServerSetup.ConnectionString;
                string dataProviderString = m_sqlServerSetup.DataProviderString;
                bool   encrypt            = Convert.ToBoolean(m_state["encryptSqlServerConnectionStrings"]);
                AdvancedSettingsWindow advancedWindow;

                m_sqlServerSetup.Password = null;

                advancedWindow       = new AdvancedSettingsWindow(connectionString, dataProviderString, encrypt);
                advancedWindow.Owner = App.Current.MainWindow;

                if (advancedWindow.ShowDialog() == true)
                {
                    Dictionary <string, string> settings = advancedWindow.ConnectionString.ParseKeyValuePairs();
                    m_sqlServerSetup.ConnectionString            = settings.JoinKeyValuePairs();
                    m_sqlServerSetup.DataProviderString          = advancedWindow.DataProviderString;
                    m_state["encryptSqlServerConnectionStrings"] = advancedWindow.Encrypt;
                }

                if (string.IsNullOrEmpty(m_sqlServerSetup.Password))
                {
                    m_sqlServerSetup.Password = password;
                }

                m_hostNameTextBox.Text                 = m_sqlServerSetup.HostName;
                m_databaseNameTextBox.Text             = m_sqlServerSetup.DatabaseName;
                m_adminUserNameTextBox.Text            = m_sqlServerSetup.UserName;
                m_adminPasswordTextBox.Password        = m_sqlServerSetup.Password;
                m_checkBoxIntegratedSecurity.IsChecked = ((object)m_sqlServerSetup.IntegratedSecurity != null);
            }
        }
        // Occurs when the user clicks the "Advanced..." button.
        private void AdvancedButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_state != null)
            {
                string password           = m_oracleSetup.SchemaPassword;
                string dataProviderString = m_oracleSetup.DataProviderString;
                bool   encrypt            = m_oracleSetup.EncryptConnectionString;
                string connectionString;
                AdvancedSettingsWindow advancedWindow;

                m_oracleSetup.SchemaPassword = null;
                connectionString             = m_oracleSetup.ConnectionString;

                advancedWindow       = new AdvancedSettingsWindow(connectionString, dataProviderString, encrypt);
                advancedWindow.Owner = App.Current.MainWindow;

                if (advancedWindow.ShowDialog() == true)
                {
                    m_oracleSetup.ConnectionString        = advancedWindow.ConnectionString;
                    m_oracleSetup.DataProviderString      = advancedWindow.DataProviderString;
                    m_oracleSetup.EncryptConnectionString = advancedWindow.Encrypt;
                }

                if (string.IsNullOrEmpty(m_oracleSetup.SchemaPassword))
                {
                    m_oracleSetup.SchemaPassword = password;
                }

                m_tnsNameTextBox.Text                = m_oracleSetup.TnsName;
                m_schemaUserNameTextBox.Text         = m_oracleSetup.SchemaUserName;
                m_schemaUserPasswordTextBox.Password = m_oracleSetup.SchemaPassword;
            }
        }
        // Occurs when the user clicks the "Advanced..." button.
        private void AdvancedButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_state != null)
            {
                string password           = m_mySqlSetup.Password;
                string dataProviderString = m_mySqlSetup.DataProviderString;
                bool   encrypt            = Convert.ToBoolean(m_state["encryptMySqlConnectionStrings"]);
                string connectionString;
                AdvancedSettingsWindow advancedWindow;

                m_mySqlSetup.Password = null;
                connectionString      = m_mySqlSetup.ConnectionString;
                advancedWindow        = new AdvancedSettingsWindow(connectionString, dataProviderString, encrypt);
                advancedWindow.Owner  = Application.Current.MainWindow;

                if (advancedWindow.ShowDialog() == true)
                {
                    m_mySqlSetup.ConnectionString            = advancedWindow.ConnectionString;
                    m_mySqlSetup.DataProviderString          = advancedWindow.DataProviderString;
                    m_state["encryptMySqlConnectionStrings"] = advancedWindow.Encrypt;
                }

                if (string.IsNullOrEmpty(m_mySqlSetup.Password))
                {
                    m_mySqlSetup.Password = password;
                }

                m_hostNameTextBox.Text          = m_mySqlSetup.HostName;
                m_databaseNameTextBox.Text      = m_mySqlSetup.DatabaseName;
                m_adminUserNameTextBox.Text     = m_mySqlSetup.UserName;
                m_adminPasswordTextBox.Password = m_mySqlSetup.Password;
            }
        }
    public static void OpenWindow(ImplosiveExplosiveEditor newOwner)
    {
        owner  = newOwner;
        opened = true;

        _colorWindow = GetWindow <AdvancedSettingsWindow>();

        _colorWindow.minSize = new Vector2(200, 250);
        _colorWindow.maxSize = new Vector2(500, 600);

        StylePresets.CreateStyles();
    }
Example #5
0
        // Occurs when the user clicks the "Advanced..." button.
        private void AdvancedButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_state != null)
            {
                SecureString           password           = m_postgresSetup.RolePassword;
                string                 dataProviderString = PostgresSetup.DataProviderString;
                bool                   encrypt            = m_postgresSetup.EncryptConnectionString;
                string                 connectionString;
                AdvancedSettingsWindow advancedWindow;

                m_postgresSetup.RolePassword = null;
                connectionString             = m_postgresSetup.ConnectionString;

                advancedWindow       = new AdvancedSettingsWindow(connectionString, dataProviderString, encrypt);
                advancedWindow.Owner = Application.Current.MainWindow;
                (advancedWindow.FindName("m_dataProviderStringTextBox") as FrameworkElement)?.SetValue(IsEnabledProperty, false);

                if (advancedWindow.ShowDialog() == true)
                {
                    m_postgresSetup.ConnectionString        = advancedWindow.ConnectionString;
                    m_postgresSetup.EncryptConnectionString = advancedWindow.Encrypt;
                }

                m_hostNameTextBox.Text = m_postgresSetup.HostName;
                m_portTextBox.Text     = m_postgresSetup.Port;
                m_databaseTextBox.Text = m_postgresSetup.DatabaseName;
                m_roleNameTextBox.Text = m_postgresSetup.RoleName;

                if ((object)m_postgresSetup.RolePassword == null || m_postgresSetup.RolePassword.Length == 0)
                {
                    m_postgresSetup.RolePassword = password;
                }
                else
                {
                    m_rolePasswordTextBox.Password = m_postgresSetup.RolePassword.ToUnsecureString();
                }
            }
        }
        // Occurs when the user clicks the "Advanced..." button.
        private void AdvancedButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_state != null)
            {
                string password = m_mySqlSetup.Password;
                string dataProviderString = m_mySqlSetup.DataProviderString;
                bool encrypt = Convert.ToBoolean(m_state["encryptMySqlConnectionStrings"]);
                string connectionString;
                AdvancedSettingsWindow advancedWindow;

                m_mySqlSetup.Password = null;
                connectionString = m_mySqlSetup.ConnectionString;
                advancedWindow = new AdvancedSettingsWindow(connectionString, dataProviderString, encrypt);
                advancedWindow.Owner = Application.Current.MainWindow;

                if (advancedWindow.ShowDialog() == true)
                {
                    m_mySqlSetup.ConnectionString = advancedWindow.ConnectionString;
                    m_mySqlSetup.DataProviderString = advancedWindow.DataProviderString;
                    m_state["encryptMySqlConnectionStrings"] = advancedWindow.Encrypt;
                }

                if (string.IsNullOrEmpty(m_mySqlSetup.Password))
                    m_mySqlSetup.Password = password;

                m_hostNameTextBox.Text = m_mySqlSetup.HostName;
                m_databaseNameTextBox.Text = m_mySqlSetup.DatabaseName;
                m_adminUserNameTextBox.Text = m_mySqlSetup.UserName;
                m_adminPasswordTextBox.Password = m_mySqlSetup.Password;
            }
        }
        // Occurs when the user clicks the "Advanced..." button.
        private void AdvancedButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_state != null)
            {
                SecureString password = m_postgresSetup.RolePassword;
                string dataProviderString = PostgresSetup.DataProviderString;
                bool encrypt = m_postgresSetup.EncryptConnectionString;
                string connectionString;
                AdvancedSettingsWindow advancedWindow;

                m_postgresSetup.RolePassword = null;
                connectionString = m_postgresSetup.ConnectionString;

                advancedWindow = new AdvancedSettingsWindow(connectionString, dataProviderString, encrypt);
                advancedWindow.Owner = Application.Current.MainWindow;
                (advancedWindow.FindName("m_dataProviderStringTextBox") as FrameworkElement)?.SetValue(IsEnabledProperty, false);

                if (advancedWindow.ShowDialog() == true)
                {
                    m_postgresSetup.ConnectionString = advancedWindow.ConnectionString;
                    m_postgresSetup.EncryptConnectionString = advancedWindow.Encrypt;
                }

                m_hostNameTextBox.Text = m_postgresSetup.HostName;
                m_portTextBox.Text = m_postgresSetup.Port;
                m_databaseTextBox.Text = m_postgresSetup.DatabaseName;
                m_roleNameTextBox.Text = m_postgresSetup.RoleName;

                if ((object)m_postgresSetup.RolePassword == null || m_postgresSetup.RolePassword.Length == 0)
                    m_postgresSetup.RolePassword = password;
                else
                    m_rolePasswordTextBox.Password = m_postgresSetup.RolePassword.ToUnsecureString();
            }
        }
        // Occurs when the user clicks the "Advanced..." button.
        private void AdvancedButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_state != null)
            {
                string password = m_oracleSetup.SchemaPassword;
                string dataProviderString = m_oracleSetup.DataProviderString;
                bool encrypt = m_oracleSetup.EncryptConnectionString;
                string connectionString;
                AdvancedSettingsWindow advancedWindow;

                m_oracleSetup.SchemaPassword = null;
                connectionString = m_oracleSetup.ConnectionString;

                advancedWindow = new AdvancedSettingsWindow(connectionString, dataProviderString, encrypt);
                advancedWindow.Owner = App.Current.MainWindow;

                if (advancedWindow.ShowDialog() == true)
                {
                    m_oracleSetup.ConnectionString = advancedWindow.ConnectionString;
                    m_oracleSetup.DataProviderString = advancedWindow.DataProviderString;
                    m_oracleSetup.EncryptConnectionString = advancedWindow.Encrypt;
                }

                if (string.IsNullOrEmpty(m_oracleSetup.SchemaPassword))
                    m_oracleSetup.SchemaPassword = password;

                m_tnsNameTextBox.Text = m_oracleSetup.TnsName;
                m_schemaUserNameTextBox.Text = m_oracleSetup.SchemaUserName;
                m_schemaUserPasswordTextBox.Password = m_oracleSetup.SchemaPassword;
            }
        }
        // Occurs when the user clicks the "Advanced..." button.
        private void AdvancedButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_state != null)
            {
                string password = m_sqlServerSetup.Password;
                string connectionString = m_sqlServerSetup.PooledConnectionString;
                string dataProviderString = m_sqlServerSetup.DataProviderString;
                bool encrypt = Convert.ToBoolean(m_state["encryptSqlServerConnectionStrings"]);
                AdvancedSettingsWindow advancedWindow;

                m_sqlServerSetup.Password = null;

                advancedWindow = new AdvancedSettingsWindow(connectionString, dataProviderString, encrypt);
                advancedWindow.Owner = App.Current.MainWindow;

                if (advancedWindow.ShowDialog() == true)
                {
                    // Force use of non-pooled connection string such that database can later be deleted if needed
                    Dictionary<string, string> settings = advancedWindow.ConnectionString.ParseKeyValuePairs();
                    m_sqlServerSetup.ConnectionString = settings.JoinKeyValuePairs() + "; pooling=false";
                    m_sqlServerSetup.DataProviderString = advancedWindow.DataProviderString;
                    m_state["encryptSqlServerConnectionStrings"] = advancedWindow.Encrypt;
                }

                if (string.IsNullOrEmpty(m_sqlServerSetup.Password))
                    m_sqlServerSetup.Password = password;

                m_hostNameTextBox.Text = m_sqlServerSetup.HostName;
                m_databaseNameTextBox.Text = m_sqlServerSetup.DatabaseName;
                m_adminUserNameTextBox.Text = m_sqlServerSetup.UserName;
                m_adminPasswordTextBox.Password = m_sqlServerSetup.Password;
                m_checkBoxIntegratedSecurity.IsChecked = ((object)m_sqlServerSetup.IntegratedSecurity != null);
            }
        }
Example #10
0
        private void AdvancedRunSettingsHandler(object sender, RoutedEventArgs e)
        {
            var advancedWindow = new AdvancedSettingsWindow();

            advancedWindow.ShowDialog();
        }
Example #11
0
    private void GUIPanel()
    {
        GUI.DrawTexture(mainToolbarArea, (Texture)Resources.Load("Fondo2"));
        GUILayout.BeginArea(mainToolbarArea);
        GUILayout.Button((Texture)Resources.Load("LogoCompleto"), new GUIStyle(), GUILayout.Width(300), GUILayout.Height(50));
        var rec = EditorGUILayout.BeginVertical();

        //GUI.Box(rec, GUIContent.none);
        GUI.color = new Color32(255, 102, 102, 255);

        GUI.color = Color.white;
        GUILayout.BeginHorizontal();
        GUILayout.Label("Speed", StylePresets.SUBTITLE);
        _typeOfSpeed = (TypeOfSpeed)EditorGUILayout.EnumPopup(_typeOfSpeed);
        GUI.color    = scriptTarget.implosiveSpeed >= 0 ? Color.green : Color.red;
        GUILayout.Label(scriptTarget.implosiveSpeed.ToString("F2"), StylePresets.SUBTITLE);
        GUILayout.EndHorizontal();
        switch (_typeOfSpeed)
        {
        case TypeOfSpeed.Implosive:
            if (scriptTarget.implosiveSpeed > 0)
            {
                scriptTarget.implosiveSpeed = -1;
            }
            scriptTarget.implosiveSpeed = GUILayout.HorizontalSlider(scriptTarget.implosiveSpeed, 0, -100);
            break;

        case TypeOfSpeed.Explosive:
            if (scriptTarget.implosiveSpeed < 0)
            {
                scriptTarget.implosiveSpeed = 1;
            }
            scriptTarget.implosiveSpeed = GUILayout.HorizontalSlider(scriptTarget.implosiveSpeed, 0, 100);
            break;

        case TypeOfSpeed.Both:
            scriptTarget.implosiveSpeed = GUILayout.HorizontalSlider(scriptTarget.implosiveSpeed, -100, 100);
            break;
        }

        GUI.color = Color.white;

        GUILayout.Label("Noise Amount", StylePresets.COMMON);
        scriptTarget.randomNoise      = GUILayout.HorizontalSlider(scriptTarget.randomNoise, 0, 30);
        scriptTarget.active           = GUILayout.Toggle(scriptTarget.active, scriptTarget.active ? "Activate" : "Deactivate");
        scriptTarget.distanceGradient = GUILayout.Toggle(scriptTarget.distanceGradient,
                                                         scriptTarget.distanceGradient ? "Activate Distance Gradient" : "Deactivate Distance Gradient");
        GUILayout.FlexibleSpace();
        float buttonSize = 50;

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.BeginVertical();
        GUILayout.Label("Advanced", StylePresets.COMMON);
        if (GUILayout.Button((Texture)Resources.Load("settings"), GUILayout.MaxHeight(buttonSize), GUILayout.MaxWidth(buttonSize)))
        {
            if (_myAdvancedSettingsWIndow == null)
            {
                _myAdvancedSettingsWIndow = new AdvancedSettingsWindow();
            }
            AdvancedSettingsWindow.OpenWindow(this);
        }
        EditorGUILayout.EndVertical();
        EditorGUILayout.BeginVertical();
        GUILayout.Label("Aesthetics", StylePresets.COMMON);
        if (GUILayout.Button((Texture)Resources.Load("Color"), GUILayout.MaxHeight(buttonSize), GUILayout.MaxWidth(buttonSize)))
        {
            if (_myColorWindow == null)
            {
                _myColorWindow = new ColorSelectorWindow();
            }
            ColorSelectorWindow.OpenWindow(this);
        }
        EditorGUILayout.EndVertical();
        EditorGUILayout.BeginVertical();
        GUILayout.Label("Save/Load", StylePresets.COMMON);
        if (GUILayout.Button((Texture)Resources.Load("Search"), GUILayout.MaxHeight(buttonSize), GUILayout.MaxWidth(buttonSize)))
        {
            if (_mySaveLoadWindow == null)
            {
                _mySaveLoadWindow = new SaveLoadSettings();
            }
            SaveLoadSettings.OpenWindow(this);
        }
        EditorGUILayout.EndVertical();
        EditorGUILayout.EndHorizontal();
        GUI.color = Color.white;

        GUILayout.EndArea();
    }