コード例 #1
0
ファイル: MainForm.cs プロジェクト: j-prox/blueprint41
        private void registerProductToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ConnectorLoader loader = ConnectorLoader.GetConnectorClient();

            if (loader == null)
            {
                MessageBox.Show("Unable to communicate to the server at this time. Please check your internet connection and restart the application. If error persists, contact [email protected]", "Register", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            loader.RegisterLicense();
            SetModuleMenuItemVisibility();
        }
コード例 #2
0
        private async void VerifyLicense()
        {
            ConnectorLoader connectorClientLoader = ConnectorLoader.GetConnectorClient();

            try
            {
                // wrapping it to try/catch will catch any exception from the verifylicense method
                if (connectorClientLoader != null)
                {
                    await connectorClientLoader.VerifyLicense();
                }
            }
            catch (SecurityException ex)
            {
                MessageBox.Show(ex.Message, "License", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            loader.Close();
            ShowMainForm();
        }