From 79eb19cbd10785a7dbc972bc0b26817932237419 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 10 Oct 2018 16:55:44 +0300 Subject: Sign-out works ! Fixed issue where color conversion was busy while not in research module but research module in job view. Added new RealTimeGraphX ! --- .../GraphInputOutputComponentBase.cs | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputOutputComponentBase.cs (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputOutputComponentBase.cs') diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputOutputComponentBase.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputOutputComponentBase.cs new file mode 100644 index 000000000..fb58c0e0a --- /dev/null +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX/GraphInputOutputComponentBase.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RealTimeGraphX.EventArguments; + +namespace RealTimeGraphX +{ + /// + /// Represents a and base class. + /// + /// The type of the in. + /// The type of the out. + /// + /// + /// + public abstract class GraphInputOutputComponentBase : GraphObject, IGraphInputComponent, IGraphOutputComponent where TIn : IGraphComponent where TOut : IGraphComponent + { + /// + /// Occurs when the property has changed. + /// + public event EventHandler> InputChanged; + + /// + /// Occurs when the property has changed. + /// + public event EventHandler> OutputChanged; + + private TIn _input; + /// + /// Gets the connected input . + /// + public TIn Input + { + get { return _input; } + protected set + { + _input = value; + RaisePropertyChangedAuto(); + OnInputChanged(_input); + } + } + + private TOut _output; + /// + /// Gets the connected output . + /// + public TOut Output + { + get { return _output; } + protected set + { + _output = value; + RaisePropertyChangedAuto(); + OnOutputChanged(_output); + } + } + + /// + /// Raises the event. + /// + /// The input. + protected virtual void OnInputChanged(TIn input) + { + InputChanged?.Invoke(this, new InputChangedEventArgs(input)); + } + + /// + /// Raises the event. + /// + /// The output. + protected virtual void OnOutputChanged(TOut output) + { + OutputChanged?.Invoke(this, new OutputChangedEventArgs(output)); + } + + /// + /// Connects the specified component output to this component input. + /// + /// The component. + /// Specifies whether this call was made from a component. + public abstract void ConnectInput(TIn component, bool fromInput = false); + + /// + /// Disconnects this component input from the current connected . + /// + /// Specifies whether this call was made from a component. + public abstract void DisconnectInput(bool fromInput = false); + + /// + /// Connects this component to another . + /// + /// The output component. + /// Specifies whether this call was made from a component. + public abstract void ConnectOutput(TOut output, bool fromOutput = false); + + /// + /// Disconnects this component from the connected . + /// + /// Specifies whether this call was made from a component. + public abstract void DisconnectOutput(bool fromOutput = false); + } +} -- cgit v1.3.1