Beispiel #1
0
        private static void NewField(object sender, ExecutedRoutedEventArgs e)
        {
            Main main = (Main)sender;

            Password password = main.SelectedPassword;

            if (password != null)
            {
                FieldType type = (e.Parameter is FieldType) ? (FieldType)e.Parameter : (FieldType)Enum.Parse(typeof(FieldType), e.Parameter as string);
                password.AddField(type, "New Field");
                Field field = password.Fields[password.Fields.Count - 1];
                main.SelectedPasswordField = field;
                main.SelectPasswordFieldName();
            }
        }