public ReportParameterHolder(ReportParameterWcf parameter, IValueFormatter formatter) { this.parameter = parameter; this.formatter = formatter; if (parameter.ItemsSource != null && parameter.ItemsSource.Contains("{")) { var items = JsonConvert.DeserializeObject <List <CodeName> >(parameter.ItemsSource, new JsonSerializerSettings { ContractResolver = new CodeNameContractResolver(parameter), Error = CodeNameErrorHandler, MissingMemberHandling = MissingMemberHandling.Error, }); if (parameter.ValueMember == parameter.DisplayMember) { items.Run(i => i.name = i.code); } ItemsView = new CollectionViewSource { Source = items }; parameter.ValueMember = "code"; parameter.DisplayMember = "name"; } if (parameter.MultiValueField) { Value = new ObservableCollection <object>(); } ConvertAndSetDefault(); }
public CodeNameContractResolver(ReportParameterWcf parameter) { this.parameter = parameter; }