Пример #1
0
        public SqlMetalForm(SqlConnection selectedConnection)
        {
            InitializeComponent();

            _applicationManager =
                QuickSharp.Core.ApplicationManager.GetInstance();

            _persistenceManager = _applicationManager.
                                  GetPersistenceManager(Constants.PLUGIN_NAME);

            _sqlConnectionManager =
                SqlConnectionManager.GetInstance();

            _provider         = selectedConnection.Provider;
            _connectionString = selectedConnection.ConnectionString;

            _useCompactEdition = _sqlConnectionManager.
                                 ConnectionIsSqlServerCe(selectedConnection);

            _output = _applicationManager.GetDockedForm(
                QuickSharp.Output.Constants.DOCKED_FORM_KEY)
                      as OutputForm;

            /*
             * Get the tool path.
             */

            _sqlMetalPath = _persistenceManager.ReadString(
                Constants.KEY_SQL_METAL_PATH,
                Constants.SQL_METAL_DEFAULT_PATH);

            /*
             * Populate the filename with the database name.
             */

            _filenameTextBox.Text = GetOutputFilename();

            /*
             * Update the UI
             */

            Text = Resources.SqlMetalFormTitle;
            _filenameLabel.Text     = Resources.SqlMetalFormFilename;
            _includeGroupBox.Text   = Resources.SqlMetalFormIncludeGroup;
            _viewsCheckBox.Text     = Resources.SqlMetalFormViews;
            _functionsCheckBox.Text = Resources.SqlMetalFormFunctions;
            _sprocsCheckBox.Text    = Resources.SqlMetalFormSprocs;
            _okButton.Text          = Resources.SqlMetalFormOk;
            _cancelButton.Text      = Resources.SqlMetalFormCancel;

            CheckToolAvailable();

            /*
             * Allow client applications to modify form.
             */

            SqlMetalFormProxy.GetInstance().
            UpdateFormControls(Controls);
        }
Пример #2
0
        public static SqlMetalFormProxy GetInstance()
        {
            if (_singleton == null)
            {
                _singleton = new SqlMetalFormProxy();
            }

            return(_singleton);
        }