private void PopulateTypeKind() { Contract.Assert(_generateTypeDialogOptions.TypeKindOptions != TypeKindOptions.None); if (TypeKindOptionsHelper.IsClass(_generateTypeDialogOptions.TypeKindOptions)) { PopulateTypeKind(TypeKind.Class, "class", "Class"); } if (TypeKindOptionsHelper.IsEnum(_generateTypeDialogOptions.TypeKindOptions)) { PopulateTypeKind(TypeKind.Enum, "enum", "Enum"); } if (TypeKindOptionsHelper.IsStructure(_generateTypeDialogOptions.TypeKindOptions)) { PopulateTypeKind(TypeKind.Structure, "struct", "Structure"); } if (TypeKindOptionsHelper.IsInterface(_generateTypeDialogOptions.TypeKindOptions)) { PopulateTypeKind(TypeKind.Interface, "interface", "Interface"); } if (TypeKindOptionsHelper.IsDelegate(_generateTypeDialogOptions.TypeKindOptions)) { PopulateTypeKind(TypeKind.Delegate, "delegate", "Delegate"); } if (TypeKindOptionsHelper.IsModule(_generateTypeDialogOptions.TypeKindOptions)) { _shouldChangeTypeKindListSelectedIndex = true; PopulateTypeKind(TypeKind.Module, "Module"); } }
void PopulateTypeKinds() { if (TypeKindOptionsHelper.IsClass(generateTypeDialogOptions.TypeKindOptions)) { comboboxType.Items.Add(TypeKind.Class, "Class"); } if (TypeKindOptionsHelper.IsEnum(generateTypeDialogOptions.TypeKindOptions)) { comboboxType.Items.Add(TypeKind.Enum, "Enum"); } if (TypeKindOptionsHelper.IsStructure(generateTypeDialogOptions.TypeKindOptions)) { comboboxType.Items.Add(TypeKind.Structure, "Structure"); } if (TypeKindOptionsHelper.IsInterface(generateTypeDialogOptions.TypeKindOptions)) { comboboxType.Items.Add(TypeKind.Interface, "Interface"); } if (TypeKindOptionsHelper.IsDelegate(generateTypeDialogOptions.TypeKindOptions)) { comboboxType.Items.Add(TypeKind.Delegate, "Delegate"); } comboboxType.SelectedIndex = 0; }