/// <summary> /// Updates the specified webhook instance. /// </summary> /// <param name="db">The <see cref="WebhookDestination"/> to update</param> /// <remarks> /// This is called when a user is editing an existing webhook and clicks the 'Save' button. /// </remarks> public override void Update(DestinationBase db) { WebhookDestination whd = db as WebhookDestination; whd.Description = this.textBoxName.Text; whd.Url = this.textBoxUrl.Text; }
/// <summary> /// Initializes the configuration UI when a webhook is being added or edited. /// </summary> /// <param name="isSubscription">will always be <c>false</c> for <see cref="ForwardDestination"/>s</param> /// <param name="dli">The <see cref="DestinationListItem"/> that the user selected</param> /// <param name="db">The <see cref="DestinationBase"/> of the item if it is being edited;<c>null</c> otherwise</param> /// <remarks> /// When an instance is being edited (<paramref name="dli"/> != null), make sure to repopulate any /// inputs with the current values. /// /// By default, the 'Save' button is disabled and you must call <see cref="DestinationSettingsPanel.OnValidChanged"/> /// in order to enable it when appropriate. /// </remarks> public override void Initialize(bool isSubscription, DestinationListItem dli, DestinationBase db) { // set text box values this.textBoxName.Text = String.Empty; this.textBoxName.Enabled = true; this.textBoxUrl.Text = String.Empty; this.textBoxUrl.Enabled = true; WebhookDestination whd = db as WebhookDestination; if (whd != null) { this.textBoxName.Text = whd.Description; this.textBoxUrl.Text = whd.Url; } ValidateInputs(); this.textBoxName.Focus(); }