コード例 #1
0
ファイル: FormMain.cs プロジェクト: mazen17/SparkApiSDK
        /// <summary>
        /// Display live market security form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void securityLiveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Check that user has setup Spark credentials
            ApiCredentials credentials = ApiCredentials.LoadFromFile();

            if ((credentials == null) || (!credentials.Validate()))
            {
                MessageBox.Show(this, "Connection to live market feed via the Spark API requires a valid username and password. " +
                                "Please enter security credentials in the appliction options.",
                                "Authorisation", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                optionsToolStripMenuItem_Click(this, null);
                return;
            }

            //Display live market security form
            FormSecurity securityForm = new FormSecurity();

            securityForm.Show();
        }