コード例 #1
0
        /// <summary>
        /// Displays a dialog box that prompts the user for settings for this connection.
        ///
        /// The connection settings from io_connectionSettings are presented as key-value string
        /// pairs. The input connection settings map is the initial state of the dialog box.  The
        /// input connection settings map will be modified to reflect the user's input to the
        /// dialog box.
        ///
        /// The return value for this method indicates if the user completed the process by
        /// clicking OK on the dialog box (return true), or if the user aborts the process by
        /// clicking CANCEL on the dialog box (return false).
        ///
        /// This dialog is only used for an ODBC driver built with .NET.
        /// </summary>
        ///
        /// <param name="connResponseMap">
        /// The connection settings map updated to reflect the user's input.
        /// </param>
        /// <param name="connectionSettings">
        /// The connection settings map updated with settings that are still needed and were not
        /// supplied.
        /// </param>
        /// <param name="parentWindow">
        /// Handle to the parent window to which this dialog belongs
        /// </param>
        /// <param name="promptType">
        /// Indicates what type of connection settings to request - either both required and
        /// optional settings or just required settings.
        /// </param>
        /// <returns>True if the user clicks OK on the dialog box; false if the user clicks CANCEL.
        /// </returns>
        public override bool PromptDialog(
            Dictionary <string, ConnectionSetting> connResponseMap,
            Dictionary <string, object> connectionSettings,
            System.Windows.Forms.IWin32Window parentWindow,
            PromptType promptType)
        {
            LogUtilities.LogFunctionEntrance(
                Log,
                connResponseMap,
                connectionSettings,
                parentWindow);

            BConnectionDlg dialog = new BConnectionDlg(
                connectionSettings,
                promptType == PromptType.PROMPT_REQUIRED);

            System.Windows.Forms.DialogResult result = dialog.ShowDialog(parentWindow);
            return(result == System.Windows.Forms.DialogResult.OK);
        }
コード例 #2
0
ファイル: BConnection.cs プロジェクト: yonglehou/Bermuda
        /// <summary>
        /// Displays a dialog box that prompts the user for settings for this connection. 
        ///
        /// The connection settings from io_connectionSettings are presented as key-value string 
        /// pairs. The input connection settings map is the initial state of the dialog box.  The 
        /// input connection settings map will be modified to reflect the user's input to the 
        /// dialog box.
        ///
        /// The return value for this method indicates if the user completed the process by 
        /// clicking OK on the dialog box (return true), or if the user aborts the process by 
        /// clicking CANCEL on the dialog box (return false).
        /// 
        /// This dialog is only used for an ODBC driver built with .NET.
        /// </summary>
        /// 
        /// <param name="connResponseMap">
        /// The connection settings map updated to reflect the user's input.
        /// </param>
        /// <param name="connectionSettings">
        /// The connection settings map updated with settings that are still needed and were not 
        /// supplied.
        /// </param>
        /// <param name="parentWindow">
        /// Handle to the parent window to which this dialog belongs
        /// </param>
        /// <param name="promptType">
        /// Indicates what type of connection settings to request - either both required and 
        /// optional settings or just required settings.
        /// </param>
        /// <returns>True if the user clicks OK on the dialog box; false if the user clicks CANCEL.
        /// </returns>
        public override bool PromptDialog(
            Dictionary<string, ConnectionSetting> connResponseMap,
            Dictionary<string, object> connectionSettings,
            System.Windows.Forms.IWin32Window parentWindow,
            PromptType promptType)
        {
            LogUtilities.LogFunctionEntrance(
                Log,
                connResponseMap,
                connectionSettings,
                parentWindow);

            BConnectionDlg dialog = new BConnectionDlg(
                connectionSettings,
                promptType == PromptType.PROMPT_REQUIRED);
            System.Windows.Forms.DialogResult result = dialog.ShowDialog(parentWindow);
            return (result == System.Windows.Forms.DialogResult.OK);
        }