当前位置: 首页>>代码示例>>C#>>正文


C# PropertyInfo.Single方法代码示例

本文整理汇总了C#中System.Reflection.PropertyInfo.Single方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyInfo.Single方法的具体用法?C# PropertyInfo.Single怎么用?C# PropertyInfo.Single使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Reflection.PropertyInfo的用法示例。


在下文中一共展示了PropertyInfo.Single方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CopyFromModel

 public void CopyFromModel(PropertyInfo vm, object model, PropertyInfo[] modelProps)
 {
     var ckf = vm.GetAttribute<FieldInfoAttribute>().CheckboxField;
     var ckpi = modelProps.Single(ss => ss.Name == ckf);
     var ck = ckpi.GetValue(model, null) as bool?;
     var m = modelProps.FirstOrDefault(mm => mm.Name == vm.Name);
     Number = ((string)m.GetValue(model, null)).FmtFone();
     ReceiveText = ck ?? false;
 }
开发者ID:stevesloka,项目名称:bvcms,代码行数:9,代码来源:BasicPersonInfo.cs

示例2: GetValue

        protected virtual object GetValue(PropertyInfo[] propertiesOnEvent, IEvent @event, EventMetaData metaData)
        {
            var property = propertiesOnEvent.Single(pi => pi.Name.Equals(_name, StringComparison.InvariantCultureIgnoreCase));
            var value = property.GetValue(@event, null);

            if (value is Guid)
                return ((Guid)value).ToByteArray();

            if (value is EventSourceVersion)
                return ((EventSourceVersion)value).Combine();

            return value;
        }
开发者ID:JoB70,项目名称:Bifrost,代码行数:13,代码来源:EventParameter.cs

示例3: CopyToModel

 public List<ChangeDetail> CopyToModel(PropertyInfo vm, object model, PropertyInfo[] modelProps, bool track)
 {
     var changes = new List<ChangeDetail>();
     var ckf = vm.GetAttribute<FieldInfoAttribute>().CheckboxField;
     var ckpi = modelProps.Single(mm => mm.Name == ckf);
     if (track)
     {
         model.UpdateValue(changes, vm.Name, Number.GetDigits());
         model.UpdateValue(changes, ckf, ReceiveText);
         return changes;
     }
     var ci = modelProps.FirstOrDefault(ss => ss.Name == vm.Name);
     Debug.Assert(ci != null, "ci != null");
     ci.SetValue(model, Number.GetDigits(), null);
     ckpi.SetValue(model, ReceiveText, null);
     return changes;
 }
开发者ID:stevesloka,项目名称:bvcms,代码行数:17,代码来源:BasicPersonInfo.cs

示例4: CopyToModel

 public string CopyToModel(PropertyInfo vm, object model, PropertyInfo[] modelProps, bool track)
 {
     var ckf = vm.GetAttribute<FieldInfoAttribute>().CheckboxField;
     var ckpi = modelProps.Single(mm => mm.Name == ckf);
     if (track)
     {
         var changes = new StringBuilder();
         model.UpdateValue(changes, vm.Name, Address);
         model.UpdateValue(changes, ckf, Send);
         return changes.ToString();
     }
     var ci = modelProps.FirstOrDefault(ss => ss.Name == vm.Name);
     Debug.Assert(ci != null, "ci != null");
     ci.SetValue(model, Address, null);
     ckpi.SetValue(model, Send, null);
     return string.Empty;
 }
开发者ID:hkouns,项目名称:bvcms,代码行数:17,代码来源:BasicPersonInfo.cs


注:本文中的System.Reflection.PropertyInfo.Single方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。