The WFObjectValueProvider class allows to provide values from one model to update another. This makes it easy to make a shallow "copy" where property names and types are exactly the same for the object which is providing the values.
  • WFObjectValueProvider(object model, string prefix)
Initializes a new instance of the WFObjectValueProvider class and uses the "model" to provide values. If "prefix" is specified (not null/empty), only properties with this "prefix" will be supplied from the "source" and the "prefix" will be stripped when searching for the property to update on the target.
Interface Implementations
  • IWFValueProvider.ContainsKey(string keyName)
Returns a boolean representing if any PropertyInfo on the source matches "keyname".
  • IWFValueProvider.KeyValue(string keyName, object defaultValue)
Checks if the type provided has any PropertyInfo matching the name "keyName". If the PropertyInfo is found, the value will be returned if it is not null. Otherwise, "defaultValue" will be returned.
  • IWFValueProvider.KeyValue(string keyName)
Returns the value of the PropertyInfo.Name that maps to "keyName". An exception will be thrown if no property is found with .Name matching "keyName".
  • IWFValueProvider.GetPropertyEnumerator()
Returns the collection Property .Name's as an enumerable of String from the source type.

Last edited May 21, 2012 at 7:22 PM by aikeru, version 1


No comments yet.