diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-10-10 16:55:44 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-10-10 16:55:44 +0300 |
| commit | 79eb19cbd10785a7dbc972bc0b26817932237419 (patch) | |
| tree | e36176fc94ce6f26efc89b006d7e6faf7e4398cb /Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputComponentBase.cs | |
| parent | df9197240ba5a643ce1599f36b7e3dd34aad6a60 (diff) | |
| download | Tango-79eb19cbd10785a7dbc972bc0b26817932237419.tar.gz Tango-79eb19cbd10785a7dbc972bc0b26817932237419.zip | |
Sign-out works !
Fixed issue where color conversion was busy while not in research module but research module in job view.
Added new RealTimeGraphX !
Diffstat (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputComponentBase.cs')
| -rw-r--r-- | Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputComponentBase.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputComponentBase.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputComponentBase.cs new file mode 100644 index 000000000..4f1c52f12 --- /dev/null +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputComponentBase.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RealTimeGraphX.EventArguments; + +namespace RealTimeGraphX +{ + /// <summary> + /// Represents an <see cref="IGraphInputComponent{TIn}"/> base class. + /// </summary> + /// <typeparam name="TIn">The type of the in.</typeparam> + /// <seealso cref="RealTimeGraphX.IGraphInputComponent{TIn}" /> + public abstract class GraphInputComponentBase<TIn> : GraphObject, IGraphInputComponent<TIn> where TIn : IGraphComponent + { + /// <summary> + /// Occurs when the <see cref="P:RealTimeGraphX.IGraphInputComponent`1.Input" /> property has changed. + /// </summary> + public event EventHandler<InputChangedEventArgs<TIn>> InputChanged; + + private TIn _input; + /// <summary> + /// Gets the connected input <see cref="T:RealTimeGraphX.IGraphComponent" />. + /// </summary> + public TIn Input + { + get { return _input; } + private set + { + _input = value; + RaisePropertyChangedAuto(); + OnInputChanged(_input); + } + } + + /// <summary> + /// Raises the <see cref="InputChanged"/> event. + /// </summary> + /// <param name="input">The input.</param> + protected virtual void OnInputChanged(TIn input) + { + InputChanged?.Invoke(this, new InputChangedEventArgs<TIn>(input)); + } + + /// <summary> + /// Connects the specified component output to this component input. + /// </summary> + /// <param name="component">The component.</param> + /// <param name="fromInput">Specifies whether this call was made from a <see cref="TIn" /> component.</param> + public abstract void ConnectInput(TIn component, bool fromInput = false); + + /// <summary> + /// Disconnects this component input from the current connected <see cref="P:RealTimeGraphX.IGraphInputComponent`1.Input" /><see cref="T:RealTimeGraphX.IGraphComponent" />. + /// </summary> + /// <param name="fromInput">Specifies whether this call was made from a <see cref="TIn" /> component.</param> + public abstract void DisconnectInput(bool fromInput = false); + } +} |
