/// <summary> /// Renews the SubscriptionManagerClient's subscription /// </summary> private void Renew() { Console.WriteLine(System.DateTime.Now + "\tIssue subscription renew"); RenewResponse oRenewResult = SubscriptionManagerClient.Renew(new Renew() { TerminationTime = "PT60S" }); SubTermTime = oRenewResult.TerminationTime; Console.WriteLine(string.Format("Current Time: {0}\tTermination Time: {1}", oRenewResult.CurrentTime.ToString(), oRenewResult.TerminationTime.Value.ToString())); //OnNotification(string.Format("Subscription renewed - Current Time: {0}\tTermination Time: {1}", oRenewResult.CurrentTime.ToString(), oRenewResult.TerminationTime.Value.ToString())); }
/// <summary> /// Renews the SubscriptionManagerClient's subscription /// </summary> public void Renew() { Console.WriteLine(DateTime.Now + "\tIssue subscription renew"); RenewResponse oRenewResult = SubscriptionManagerClient.Renew(new Renew() { TerminationTime = "PT60S" }); SubTermTime = oRenewResult.TerminationTime; Console.WriteLine(string.Format("Current Time: {0}\tTermination Time: {1}", oRenewResult.CurrentTime.ToString(), oRenewResult.TerminationTime.Value.ToString())); listBox1.Items.Add(string.Format("Subscription renewed - Current Time: {0}\tTermination Time: {1}", oRenewResult.CurrentTime.ToString(), oRenewResult.TerminationTime.Value.ToString())); listBox1.SelectedIndex = listBox1.Items.Count - 1; }
private void btnRenew_Click(object sender, EventArgs e) { SafeInvoke(() => { Renew renew = new Renew(); renew.TerminationTime = tbRenewTime.Text; RenewResponse response = _subscriptionManager.Renew(renew); if (response.TerminationTime.HasValue) { _terminationTime = response.TerminationTime.Value; tbTerminationTime.Text = _terminationTime.ToString("hh:mm:ss.fff"); } }); }