public void ExecuteOkCommand() { PageNumber++; switch (PageNumber) { case 3: // Field values were entered. GetFieldValues(); View.ResetFieldValues(_predefinedFields, _customFields); CodeBehindCSharp.ResetFieldValues(_predefinedFields, _customFields); ViewModelCSharp.ResetFieldValues(_predefinedFields, _customFields); CodeBehindVisualBasic.ResetFieldValues(_predefinedFields, _customFields); ViewModelVisualBasic.ResetFieldValues(_predefinedFields, _customFields); break; case 4: break; } }
private void ResetFieldValuesForAllBuffers() { CustomFieldValues = new List <InsertFieldViewModel>(); foreach (var f in (ObservableCollection <FieldDialogViewModel>)Fields.SourceCollection) { object val; string type; // ReSharper disable once PossibleInvalidOperationException switch (f.SelectedFieldType.Value) { case FieldType.TextBox: case FieldType.TextBoxMultiLine: case FieldType.ComboBox: case FieldType.ComboBoxOpen: case FieldType.Class: val = f.DefaultString; type = "System.String"; break; case FieldType.CheckBox: val = f.DefaultBoolean; type = "System.Boolean"; break; default: throw new ArgumentOutOfRangeException(); } CustomFieldValues.Add(InsertFieldViewModel.Create(Container, f.Name, type, f.Description, val)); } View.ResetFieldValues(PredefinedFieldValues, CustomFieldValues); CodeBehindCSharp.ResetFieldValues(PredefinedFieldValues, CustomFieldValues); ViewModelCSharp.ResetFieldValues(PredefinedFieldValues, CustomFieldValues); CodeBehindVisualBasic.ResetFieldValues(PredefinedFieldValues, CustomFieldValues); ViewModelVisualBasic.ResetFieldValues(PredefinedFieldValues, CustomFieldValues); }