mirror of
https://github.com/soukoku/ntwain.git
synced 2026-02-25 13:04:07 +08:00
Wrapped more source triplets.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user