public async Task GetBatchInfo(string propertyName) { var result = BatchEditing.GetPropertyType(propertyName); if (string.IsNullOrWhiteSpace(result)) { await ReplyAsync($"Unable to find info for {propertyName}.").ConfigureAwait(false); } else { await ReplyAsync($"{propertyName}: {result}").ConfigureAwait(false); } }
private void CB_Property_SelectedIndexChanged(object sender, EventArgs e) { L_PropType.Text = BatchEditing.GetPropertyType(CB_Property.Text, CB_Format.SelectedIndex); if (BatchEditing.TryGetHasProperty(pkm, CB_Property.Text, out var pi)) { L_PropValue.Text = pi.GetValue(pkm)?.ToString(); L_PropType.ForeColor = L_PropValue.ForeColor; // reset color } else // no property, flag { L_PropValue.Text = string.Empty; L_PropType.ForeColor = Color.Red; } }
private static bool IsValidInstructionSet(List <string> split, out List <StringInstruction> invalid) { invalid = new List <StringInstruction>(); var set = new StringInstructionSet(split); foreach (var s in set.Filters.Concat(set.Instructions)) { var type = BatchEditing.GetPropertyType(s.PropertyName); if (type == null) { invalid.Add(s); } } return(invalid.Count == 0); }