Wrapped more source triplets.

This commit is contained in:
soukoku
2014-05-20 07:25:57 -04:00
parent 9bf86464c8
commit 5d1b0aa06f
49 changed files with 465 additions and 390 deletions

View File

@@ -187,12 +187,28 @@ namespace NTwain
/// <param name="propertyName">Name of the property.</param>
protected void OnPropertyChanged(string propertyName)
{
try
var syncer = _session.SynchronizationContext;
if (syncer == null)
{
var hand = PropertyChanged;
if (hand != null) { hand(this, new PropertyChangedEventArgs(propertyName)); }
try
{
var hand = PropertyChanged;
if (hand != null) { hand(this, new PropertyChangedEventArgs(propertyName)); }
}
catch { }
}
else
{
syncer.Post(o =>
{
try
{
var hand = PropertyChanged;
if (hand != null) { hand(this, new PropertyChangedEventArgs(propertyName)); }
}
catch { }
}, null);
}
catch { }
}
#endregion