Пример #1
0
        public async Task cancel(SezameCancelCallbackType callback)
        {
            var webRequestHandler = new WebRequestHandler();

            webRequestHandler.ClientCertificates.Add(certificate); // X509Certificate
            var invoker = new SezameRegistrationServiceInvoker(webRequestHandler, true);
            await invoker.CancelAsync();

            var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);

            store.Open(OpenFlags.ReadWrite);
            store.Remove(certificate);
            store.Close();

            status       = "new";
            clientcode   = "";
            sharedsecret = "";
            email        = "";
            writeSetting("status", status);
            writeSetting("clientcode", clientcode);
            writeSetting("sharedsecret", sharedsecret);
            writeSetting("email", email);

            callback();
        }
        private void btnCancel_Click(object sender, EventArgs e)
        {
            if (_manager.status != "ready")
            {
                MessageBox.Show("Please register and sign first!");
                return;
            }
            var myCallback = new SezameCancelCallbackType(cancelCallback);

            _manager.cancel(myCallback);
        }