コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: BatchEditor.cs プロジェクト: yanisdreemurr/PKHeX
 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;
     }
 }
コード例 #3
0
        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);
        }