-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
>> JSON(ParseJSON("{""a"": 1}"), JSONFormat.IgnoreUnsupportedTypes) "{""a"":1}"
- Loading branch information
1 parent
93daa65
commit ee0ca2c
Showing
11 changed files
with
510 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.PowerFx | ||
{ | ||
internal class Canceller | ||
{ | ||
private readonly List<Action> _cancellationAction; | ||
|
||
public Canceller() | ||
{ | ||
_cancellationAction = new List<Action>(); | ||
} | ||
|
||
public Canceller(params Action[] cancellationActions) | ||
: this() | ||
{ | ||
if (cancellationActions != null) | ||
{ | ||
foreach (Action cancellationAction in cancellationActions) | ||
{ | ||
AddAction(cancellationAction); | ||
} | ||
} | ||
} | ||
|
||
public void AddAction(Action cancellationAction) | ||
{ | ||
if (cancellationAction != null) | ||
{ | ||
_cancellationAction.Add(cancellationAction); | ||
} | ||
} | ||
|
||
public void ThrowIfCancellationRequested() | ||
{ | ||
foreach (Action cancellationAction in _cancellationAction) | ||
{ | ||
cancellationAction(); | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.