コード例 #1
0
 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();
 }
コード例 #2
0
 public CodeNameContractResolver(ReportParameterWcf parameter)
 {
     this.parameter = parameter;
 }