Skip to content

Commit

Permalink
Use local functions in InstanceMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefizso committed Aug 23, 2020
1 parent 87f3155 commit 211a4c8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Source/NetOffice/Contribution/Controls/InstanceMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ private void ShowOverlayError(Exception exception)

private void Core_ProxyAdded(Core sender, IEnumerable<ICOMObject> ownerPath, ICOMObject comObject)
{
Action method = delegate
void ProxyAddedAction()
{
try
{
Expand Down Expand Up @@ -381,13 +381,14 @@ private void Core_ProxyAdded(Core sender, IEnumerable<ICOMObject> ownerPath, ICO
{
ShowOverlayError(exception);
}
};
TryBeginInvoke(method);
}

TryBeginInvoke(ProxyAddedAction);
}

private void Core_ProxyRemoved(Core sender, IEnumerable<ICOMObject> ownerPath, ICOMObject comObject)
{
Action method = delegate
void ProxyRemoveAction()
{
try
{
Expand Down Expand Up @@ -438,13 +439,14 @@ private void Core_ProxyRemoved(Core sender, IEnumerable<ICOMObject> ownerPath, I
{
ShowOverlayError(exception);
}
};
TryBeginInvoke(method);
}

TryBeginInvoke(ProxyRemoveAction);
}

private void Core_ProxyCleared(Core sender)
{
Action method = delegate
void ClearNodes()
{
try
{
Expand All @@ -455,8 +457,9 @@ private void Core_ProxyCleared(Core sender)
{
ShowOverlayError(exception);
}
};
TryBeginInvoke(method);
}

TryBeginInvoke(ClearNodes);
}

private void HighlightTimer_Tick(object sender, EventArgs e)
Expand Down

0 comments on commit 211a4c8

Please sign in to comment.