-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fixed: #35, Pipeline control revised and WaitControl modified (Br…
…eak-change) to have a Value Context for general use and ResultWaitProcess class created to return value of context and states of tasks
- Loading branch information
Fernando Cerqueira
committed
Jul 25, 2023
1 parent
3eea558
commit b903904
Showing
20 changed files
with
873 additions
and
137 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
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,43 @@ | ||
// *************************************************************************************** | ||
// MIT LICENCE | ||
// The maintenance and evolution is maintained by the PromptPlus project under MIT license | ||
// *************************************************************************************** | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace PPlus.Controls | ||
{ | ||
/// <summary> | ||
/// Represents The Result to WaitProcess Controls | ||
/// </summary> | ||
/// <typeparam name="T">Typeof return</typeparam> | ||
public readonly struct ResultWaitProcess<T> | ||
{ | ||
/// <summary> | ||
/// Create a ResultPipeline | ||
/// </summary> | ||
/// <remarks> | ||
/// Do not use this constructor! | ||
/// </remarks> | ||
public ResultWaitProcess() | ||
{ | ||
throw new PromptPlusException("ResultWaitProcess CTOR NotImplemented"); | ||
} | ||
|
||
internal ResultWaitProcess(T conext, StateProcess[] stateprocess) | ||
{ | ||
Context = conext; | ||
States = stateprocess; | ||
} | ||
|
||
/// <summary> | ||
/// Get conext value | ||
/// </summary> | ||
public T Context { get; } | ||
|
||
/// <summary> | ||
/// Get State of process | ||
/// </summary> | ||
public StateProcess[] States { get; } | ||
} | ||
} |
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,76 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.Linq.Expressions; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace PPlus.Controls | ||
{ | ||
/// <summary> | ||
/// Represents the event to task process with with conex value | ||
/// </summary> | ||
/// <typeparam name="T">Typeof Input</typeparam> | ||
public class EventWaitProcess<T> | ||
{ | ||
private object _lock = new object(); | ||
private T _value = default; | ||
private bool _cancelnext; | ||
|
||
private EventWaitProcess() | ||
{ | ||
throw new PromptPlusException("EventWaitProcess CTOR NotImplemented"); | ||
} | ||
|
||
internal EventWaitProcess(ref T value, bool cancelnextalltasks) | ||
{ | ||
_value = value; | ||
_cancelnext = cancelnextalltasks; | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Get/set Context value | ||
/// </summary> | ||
public T Context | ||
{ | ||
get | ||
{ | ||
lock (_lock) | ||
{ | ||
return _value; | ||
} | ||
} | ||
set | ||
{ | ||
lock (_lock) | ||
{ | ||
_value = value; | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Get/Set Cancel all next tasks. | ||
/// </summary> | ||
public bool CancelAllNextTasks | ||
{ | ||
get | ||
{ | ||
lock (_lock) | ||
{ | ||
return _cancelnext; | ||
} | ||
} | ||
set | ||
{ | ||
lock (_lock) | ||
{ | ||
_cancelnext = value; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
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.