private void ContextMenu_UsedBy_Click(object sender, RoutedEventArgs e) { var material = dataGrid.SelectedItem as Material; if (material != null) { List <string> assets = container.MaterialUsedBy(material); assets.Sort(); StringBuilder str = new StringBuilder(); foreach (var asset in assets) { str.Append(String.Format("{0}\r", asset)); } LogForm logForm = new LogForm(String.Format("The following {0} assets use this material:", AssetTypeWildcard), str.ToString(), String.Format("{0}: Used By", material.Str_00), this, true); logForm.Show(); } }
private void Done_Click(object sender, RoutedEventArgs e) { var selectedEffects = GetSelectedEffects(); if (selectedEffects.Count > 0) { if (currentMode == Mode.ImportEffect) { bool wasError = false; StringBuilder str = new StringBuilder(); foreach (var effect in selectedEffects) { if (MainContainerFile.IsEffectIdUsed(effect.ImportIdIncrease)) { wasError = true; str.Append(String.Format("Effect ID: {0} > New ID: {1}\r", effect.IndexNum, effect.ImportIdIncrease)); } } if (wasError) { LogForm log = new LogForm("The following effect IDs are conflicting.\nPlease change them to be unique.", str.ToString(), "ID Conflict", this, true); log.Show(); } else { SelectedEffects = selectedEffects; Close(); } } else { SelectedEffects = selectedEffects; Close(); } } }