Last active
October 1, 2015 19:20
-
-
Save oskar-szulc/bcc25beed98c809539ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private PropertyBinding _bindingClass; | |
private void RefreshSourceProperties() | |
{ | |
if (_bindingClass.Source == null) return; | |
var tempSource = from sourceProp in _bindingClass.Source.GetType().GetProperties(BindingFlags.DeclaredOnly | | |
BindingFlags.Public | | |
BindingFlags.Instance) | |
select sourceProp; | |
_sourceProperties = tempSource.ToList(); | |
} | |
private void RefreshTargetProperties() | |
{ | |
if (_bindingClass.Target == null || _bindingClass.Source == null) return; | |
var tempTarget = from targetProp in _bindingClass.Target.GetType().GetProperties(BindingFlags.DeclaredOnly | | |
BindingFlags.Public | | |
BindingFlags.Instance) | |
where targetProp.PropertyType.IsAssignableFrom(_bindingClass.SourceProperty.PropertyType) || | |
targetProp.PropertyType == typeof(string) | |
select targetProp; | |
_targetProperties = tempTarget.ToList(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment