private void btnRemoveVariant_Click(object sender, RoutedEventArgs e) { Variants.Remove(lvVariants.SelectedItem as Variant); lvVariants.ItemsSource = Variants; tbVariantTitle.Clear(); tbVariantlinkname.Clear(); lvVariants.Items.Refresh(); }
public void RemoveVariant(Guid variantId) { if (IsClosed) { throw new InvalidOperationException($"IsClosed was: {IsClosed}"); } Variants.Remove(Variants.SingleOrDefault(o => o.Id == variantId)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Removes the variant for the specified language. /// </summary> /// ------------------------------------------------------------------------------------ public void RemoveVariant(string langId) { TransUnitVariant tuv = GetVariantForLang(langId); if (tuv != null) { Variants.Remove(tuv); } }
public void RemoveVariant(string variantName) { var variant = Variants.Find(x => x.Name == variantName); Variants.Remove(variant); }