private static ExportEntryViewModel GetEntryViewModel(ExportedType export) { ExportEntryViewModel vm = new ExportEntryViewModel(); vm.Name = export.Attribute.Alias; vm.DisplayName = InformationAttribute.GetDisplayName(export.Type); vm.Description = InformationAttribute.GetDescription(export.Type); if (string.IsNullOrWhiteSpace(vm.Description)) { // If there is no useful description, set it to null to make TargetNullValue in binding effective. vm.Description = null; } return(vm); }
private static ExportEntryViewModel GetEntryViewModel(ExportConfiguration.ExportEntry entry, IList <ExportedType> validExports) { Type myType = validExports.Single(e => e.Attribute.Alias == entry.Name).Type; ExportEntryViewModel vm = new ExportEntryViewModel(); vm.IsEnabled = entry.IsEnabled; vm.Name = entry.Name; vm.DisplayName = InformationAttribute.GetDisplayName(myType); vm.Description = InformationAttribute.GetDescription(myType); if (string.IsNullOrWhiteSpace(vm.Description)) { // If there is no useful description, set it to null to make TargetNullValue in binding effective. vm.Description = null; } return(vm); }
private static ExportEntryViewModel GetEntryViewModel(ExportedType export) { ExportEntryViewModel vm = new ExportEntryViewModel(); vm.Name = export.Attribute.Alias; vm.DisplayName = InformationAttribute.GetDisplayName(export.Type); vm.Description = InformationAttribute.GetDescription(export.Type); if (string.IsNullOrWhiteSpace(vm.Description)) { // If there is no useful description, set it to null to make TargetNullValue in binding effective. vm.Description = null; } return vm; }
private static ExportEntryViewModel GetEntryViewModel(ExportConfiguration.ExportEntry entry, IList<ExportedType> validExports) { Type myType = validExports.Single(e => e.Attribute.Alias == entry.Name).Type; ExportEntryViewModel vm = new ExportEntryViewModel(); vm.IsEnabled = entry.IsEnabled; vm.Name = entry.Name; vm.DisplayName = InformationAttribute.GetDisplayName(myType); vm.Description = InformationAttribute.GetDescription(myType); if (string.IsNullOrWhiteSpace(vm.Description)) { // If there is no useful description, set it to null to make TargetNullValue in binding effective. vm.Description = null; } return vm; }