private void BtnRemove_Click(object sender, RoutedEventArgs e) { Action webAction = (Action)lsbWebActions.SelectedItem; if (ConfirmAlert.Show($"Web action '{webAction.Name}' will be removed.").DialogResult.Value) { webActions.Remove(webAction); } }
private void BtnRemove_Click(object sender, RoutedEventArgs e) { Behaviour webbehaviour = (Behaviour)lsbBehaviours.SelectedItem; if (ValidateWebBehaviourRemoval(webbehaviour)) { if (ConfirmAlert.Show($"Web behaviour '{webbehaviour.Name}' will be removed.").DialogResult.Value) { behaviours.Remove((Behaviour)lsbBehaviours.SelectedItem); Studio.GetBehaviourConfiguration().Behaviours.Remove((Behaviour)lsbBehaviours.SelectedItem); } } else { WarningAlert.Show("This web behaviour cannot be removed because it's used in the project."); } }
private void btnCreate_Click(object sender, RoutedEventArgs e) { bool valid = true; if (tbName.Text == string.Empty) { valid = false; lbNameError.Text = "Enter name"; } else { lbNameError.Text = string.Empty; } if (valid == true) { if (!edit) { Page = new Models.Page(); Page.Name = tbName.Text; Page.Type = ((ComboBoxItem)cbbType.SelectedItem).Tag.ToString(); Page.Sections = new ObservableCollection <Models.Section>(); Page.IsLoaded = Page.Type == Models.Page.PAGE_TYPE_TEXT; Close(); } else { Page.Name = tbName.Text; string type = ((ComboBoxItem)cbbType.SelectedItem).Tag.ToString(); if (type != Page.Type) { ConfirmAlert alert = ConfirmAlert.Show("Changing the page type will remove any content on the page."); if (alert.Result == true) { Page.Type = type; Page.Sections = new ObservableCollection <Models.Section>(); Page.Description = string.Empty; } } Close(); } } }
private bool AskUserPermissionForPackage(string path, Extension requestingExtension) { return(ConfirmAlert.Show("Extension " + requestingExtension.GetName() + " wants to load the following package:\n\n" + path + "\n\n" + "Press OK to load the assembly", true).Result); }