DiagramElement

StockSharp.Diagram

The diagram element.

Inherits: BaseLogReceiver

Implements: INotifyPropertyChanging, INotifyPropertyChanged, ICustomTypeDescriptor, INotifyPropertiesChanged, IPersistable

Constructors

DiagramElement
protected DiagramElement()
diagramElement = DiagramElement()

Initializes a new instance of the DiagramElement.

Properties

CanAutoName
public bool CanAutoName { get; set; }
value = diagramElement.CanAutoName
diagramElement.CanAutoName = value

Use auto naming.

Category
public virtual string Category { get; private set; }
value = diagramElement.Category
diagramElement.Category = value

The name of the group which includes a diagram element.

Connector
protected IConnector Connector { get; }
value = diagramElement.Connector

Connector.

DebuggerSyncObject
public DebuggerSyncObject DebuggerSyncObject { get; set; }
value = diagramElement.DebuggerSyncObject
diagramElement.DebuggerSyncObject = value

The synchronization object for the debugger.

Description
public virtual string Description { get; private set; }
value = diagramElement.Description
diagramElement.Description = value

The diagram element description.

Dispatcher
protected virtual IDispatcher Dispatcher { get; }
value = diagramElement.Dispatcher

IDispatcher.

DocUrl
public virtual string DocUrl { get; set; }
value = diagramElement.DocUrl
diagramElement.DocUrl = value

Help url.

FlushPriority
public int FlushPriority { get; protected set; }
value = diagramElement.FlushPriority
diagramElement.FlushPriority = value

Is need flush state (FlushDisabled means No).

HasUndoManager
public virtual bool HasUndoManager { get; }
value = diagramElement.HasUndoManager

Check if undo manager is defined

IconName
public abstract string IconName { get; }
value = diagramElement.IconName

Icon resource name.

InputSockets
public IReadOnlyCollection<DiagramSocket> InputSockets { get; }
value = diagramElement.InputSockets

Incoming connections.

IsExternalCode
public virtual bool IsExternalCode { get; }
value = diagramElement.IsExternalCode

Is the element contains external code.

IsUndoRedoing
public virtual bool IsUndoRedoing { get; }
value = diagramElement.IsUndoRedoing

Whether undo/redo operation is in progress.

LogLevel
public override LogLevels LogLevel { get; set; }
value = diagramElement.LogLevel
diagramElement.LogLevel = value

The level to perform this rule logging.

Name
public override string Name { get; set; }
value = diagramElement.Name
diagramElement.Name = value

Name.

OutputSockets
public IReadOnlyCollection<DiagramSocket> OutputSockets { get; }
value = diagramElement.OutputSockets

Outgoing connections.

Parameters
public virtual IEnumerable<IDiagramElementParam> Parameters { get; }
value = diagramElement.Parameters

Diagram element settings.

ParentComposition
public CompositionDiagramElement ParentComposition { get; private set; }
value = diagramElement.ParentComposition
diagramElement.ParentComposition = value

Parent composition this element belongs to.

ProcessingLevel
protected int ProcessingLevel { get; private set; }
value = diagramElement.ProcessingLevel
diagramElement.ProcessingLevel = value

Element processing level. How many times DiagramSocketValue) is reentered.

ProcessNullValues
public bool ProcessNullValues { get; set; }
value = diagramElement.ProcessNullValues
diagramElement.ProcessNullValues = value

Process null values.

ShowParameters
public bool ShowParameters { get; set; }
value = diagramElement.ShowParameters
diagramElement.ShowParameters = value

Show element parameters in higher order elements.

ShowSockets
public bool ShowSockets { get; set; }
value = diagramElement.ShowSockets
diagramElement.ShowSockets = value

Show element sockets in higher order elements.

Strategy
public virtual DiagramStrategy Strategy { get; set; }
value = diagramElement.Strategy
diagramElement.Strategy = value

The strategy to which the element is attached.

TypeId
public abstract Guid TypeId { get; }
value = diagramElement.TypeId

The unique identifier of the diagram element type.

WaitAllInput
protected virtual bool WaitAllInput { get; }
value = diagramElement.WaitAllInput

Wait all parameters before invoke method.

Methods

AddInput
protected DiagramSocket AddInput(StaticSocketIds id, string name, DiagramSocketType type, Action<DiagramSocketValue> process, int linkableMax, int index, bool? isDynamic)
result = diagramElement.AddInput(id, name, type, process, linkableMax, index, isDynamic)

To add or get existing incoming connection. isDynamic is false by default.

id
The connection identifier.
name
The connection name.
type
Connection type.
linkableMax
The maximum number of connections.
process
The action is called at the processing of the new incoming value for socket.
index
Index in sockets list.
isDynamic
Socket will be saved with the element. Default is true for sockets with explicit id.

Returns: Connection.

AddInput
protected DiagramSocket AddInput(string id, string name, DiagramSocketType type, Action<DiagramSocketValue> process, int linkableMax, int index, bool? isDynamic)
result = diagramElement.AddInput(id, name, type, process, linkableMax, index, isDynamic)

To add or get existing incoming connection. isDynamic is true by default.

id
The connection identifier.
name
The connection name.
type
Connection type.
linkableMax
The maximum number of connections.
process
The action is called at the processing of the new incoming value for socket.
index
Index in sockets list.
isDynamic
Socket will be saved with the element. Default is true for sockets with explicit id.

Returns: Connection.

AddOutput
protected DiagramSocket AddOutput(StaticSocketIds id, string name, DiagramSocketType type, int linkableMax, int index, bool isDynamic)
result = diagramElement.AddOutput(id, name, type, linkableMax, index, isDynamic)

To add or get an outgoing connection.

id
The connection identifier.
name
The connection name.
type
Connection type.
linkableMax
The maximum number of connections.
index
Index in sockets list.
isDynamic
Dynamic sockets are removed during Load().

Returns: Connection.

AddOutput
protected DiagramSocket AddOutput(string id, string name, DiagramSocketType type, int linkableMax, int index, bool isDynamic)
result = diagramElement.AddOutput(id, name, type, linkableMax, index, isDynamic)

To add or get an outgoing connection.

id
The connection identifier.
name
The connection name.
type
Connection type.
linkableMax
The maximum number of connections.
index
Index in sockets list.
isDynamic
Dynamic sockets are removed during Load().

Returns: Connection.

AddParam
protected void AddParam(IDiagramElementParam param)
diagramElement.AddParam(param)

To add a parameter.

param
Parameter.
AddParam``1
protected DiagramElementParam<T> AddParam<T>(string name, T value)
result = diagramElement.AddParam(name, value)

To add a parameter.

name
Name.
value
Value.

Returns: Parameter.

ClearSocketValues
public virtual void ClearSocketValues()
diagramElement.ClearSocketValues()

Clear socket values.

Clone
public virtual DiagramElement Clone(bool cloneSockets)
result = diagramElement.Clone(cloneSockets)

Create a copy of DiagramElement.

cloneSockets
To create copies of connections.

Returns: Copy.

CreateCopy
protected virtual DiagramElement CreateCopy()
result = diagramElement.CreateCopy()

Create a copy of DiagramElement.

Returns: DiagramElement copy.

CreateSocketInstance
protected virtual DiagramSocket CreateSocketInstance(DiagramSocketDirection dir, string socketId)
result = diagramElement.CreateSocketInstance(dir, socketId)

Create new socket instance.

DisposeManaged
protected override void DisposeManaged()
diagramElement.DisposeManaged()

Release resources.

Flush
public virtual void Flush(DateTime time)
diagramElement.Flush(time)

Flush non trigger (root) elements.

GenerateSocketId
public static string GenerateSocketId(string suffix)
result = DiagramElement.GenerateSocketId(suffix)

Generate socket identifier.

suffix
Suffix.

Returns: Identifier.

GetCategory
public virtual string GetCategory()
result = diagramElement.GetCategory()

Get category.

Returns: Category.

GetConnectedSourceSockets
public DiagramSocket[] GetConnectedSourceSockets(DiagramSocket targetInputSocket)
result = diagramElement.GetConnectedSourceSockets(targetInputSocket)

Get connected source sockets.

targetInputSocket
GetDescription
public virtual string GetDescription()
result = diagramElement.GetDescription()

Get description.

Returns: Description.

GetDisplayName
public virtual string GetDisplayName()
result = diagramElement.GetDisplayName()

Get display name.

Returns: Name.

GetNumConnections
public int GetNumConnections(DiagramSocket socket)
result = diagramElement.GetNumConnections(socket)

Get connection count.

socket
Socket.

Returns: Count.

GetOrAddSocket
protected ValueTuple<DiagramSocket, bool> GetOrAddSocket(string socketId, DiagramSocketDirection dir, string name, DiagramSocketType type, Action<DiagramSocketValue> process, int linkableMax, int index, bool isDynamic, bool allowGet)
result = diagramElement.GetOrAddSocket(socketId, dir, name, type, process, linkableMax, index, isDynamic, allowGet)

To add or get an outgoing connection.

socketId
The connection identifier.
dir
DiagramSocketDirection
name
The connection name.
type
Connection type.
process
The action is called at the processing of the new incoming value for socket.
linkableMax
The maximum number of connections.
index
Index in sockets list.
isDynamic
Dynamic sockets are removed during SettingsStorage).
allowGet
Return existing socket if it's already exist.

Returns: Connection.

Init
public void Init(ILogSource parent)
diagramElement.Init(parent)

To initialize the element.

parent
Parent composition or strategy.
InitializeCopy
public virtual void InitializeCopy(DiagramElement copiedFrom)
diagramElement.InitializeCopy(copiedFrom)
Load
public override void Load(SettingsStorage storage)
diagramElement.Load(storage)

Load settings.

storage
Settings storage.
OnInit
protected virtual void OnInit()
diagramElement.OnInit()

The method is called at initialization of the diagram element.

OnPrepare
protected virtual void OnPrepare()
diagramElement.OnPrepare()

To prepare for starting the diagram element algorithm.

OnProcess
protected virtual void OnProcess(DateTime time, IDictionary<DiagramSocket, DiagramSocketValue> values, DiagramSocketValue source)
diagramElement.OnProcess(time, values, source)

The method is called at the processing of the new incoming values.

time
Time.
values
Values.
source
Source value.
OnReseted
protected virtual void OnReseted()
diagramElement.OnReseted()

The method is called at re-initialisation of the diagram element state.

OnSocketConnected
protected virtual void OnSocketConnected(DiagramSocket socket, DiagramSocket source)
diagramElement.OnSocketConnected(socket, source)

The method is called at subscription to the processing of diagram element output values.

socket
The diagram element socket.
source
The source diagram element socket.
OnSocketDisconnected
protected virtual void OnSocketDisconnected(DiagramSocket socket, DiagramSocket source)
diagramElement.OnSocketDisconnected(socket, source)

The method is called at unsubscription from the processing of diagram element output values.

socket
The diagram element socket.
source
The source diagram element socket.
OnStart
protected virtual void OnStart(DateTime time)
diagramElement.OnStart(time)

The method is called at the start of the diagram element algorithm.

OnStop
protected virtual void OnStop()
diagramElement.OnStop()

The method is called at the stop of the diagram element algorithm.

OnUnInit
protected virtual void OnUnInit()
diagramElement.OnUnInit()

The method is called at deinitialization of the diagram element.

Prepare
public void Prepare()
diagramElement.Prepare()

To prepare for starting the diagram element algorithm.

Process
public void Process(DiagramSocketValue value)
diagramElement.Process(value)

To handle the incoming value.

value
Value.
RaiseParameterValueChanged
protected virtual void RaiseParameterValueChanged(string parameterName)
diagramElement.RaiseParameterValueChanged(parameterName)

To call the ParameterValueChanged event.

parameterName
Parameter name.
RaiseProcessOutput
protected void RaiseProcessOutput(DiagramSocket socket, DateTime time, object value, DiagramSocketValue source, Subscription subscription)
diagramElement.RaiseProcessOutput(socket, time, value, source, subscription)

To call the event ProcessOutput.

socket
Output socket.
time
Time.
value
Value.
source
Source value.
subscription
Subscription.
RaisePropertiesChanged
protected virtual void RaisePropertiesChanged()
diagramElement.RaisePropertiesChanged()

To call the PropertiesChanged event.

RaisePropertyChanged
protected virtual void RaisePropertyChanged(string propertyName)
diagramElement.RaisePropertyChanged(propertyName)

To call the PropertyChanged event.

propertyName
Property name.
RaisePropertyChanged
protected virtual void RaisePropertyChanged(object sender, PropertyChangedEventArgs args)
diagramElement.RaisePropertyChanged(sender, args)

To call the PropertyChanged event.

sender
Sender.
args
Arguments.
RaisePropertyChanging
protected virtual void RaisePropertyChanging(string propertyName)
diagramElement.RaisePropertyChanging(propertyName)

To call the PropertyChanging event.

propertyName
Property name.
RaisePropertyChanging
protected virtual void RaisePropertyChanging(object sender, PropertyChangingEventArgs args)
diagramElement.RaisePropertyChanging(sender, args)

To call the PropertyChanging event.

sender
Sender.
args
Arguments.
RaiseSocketChanged
protected void RaiseSocketChanged(DiagramSocket socket)
diagramElement.RaiseSocketChanged(socket)

To call the event SocketChanged.

socket
Socket.
RemoveParam
protected void RemoveParam(IDiagramElementParam param)
diagramElement.RemoveParam(param)

To remove a parameter.

param
Parameter.
RemoveSocket
protected void RemoveSocket(DiagramSocket socket)
diagramElement.RemoveSocket(socket)

To remove a connection.

socket
Connection.
RemoveSockets
protected void RemoveSockets(Func<DiagramSocket, bool> predicate, bool raiseSocketRemoved)
diagramElement.RemoveSockets(predicate, raiseSocketRemoved)

To remove multiple sockets.

predicate
raiseSocketRemoved
Raise SocketRemoved event.
RemoveSockets
protected virtual void RemoveSockets(bool raiseSocketRemoved)
diagramElement.RemoveSockets(raiseSocketRemoved)

To remove all incoming and outgoing connections.

raiseSocketRemoved
Raise SocketRemoved event.
Reset
public void Reset()
diagramElement.Reset()

To reinitialize the diagram element state.

ResetFlushPriority
protected void ResetFlushPriority()
diagramElement.ResetFlushPriority()

Reset FlushPriority.

Save
public override void Save(SettingsStorage storage)
diagramElement.Save(storage)

Save settings.

storage
Settings storage.
SaveUndoState
protected IDisposable SaveUndoState(object debugState)
result = diagramElement.SaveUndoState(debugState)

Save state to enable undo.

SetElementName
protected void SetElementName(string name)
diagramElement.SetElementName(name)

Set element name.

name
Name.
Start
public void Start(DateTime time)
diagramElement.Start(time)

To start for start the diagram element algorithm.

Stop
public void Stop()
diagramElement.Stop()

To stop the diagram element algorithm.

UnInit
public void UnInit()
diagramElement.UnInit()

The deinitialization of the element.

Events

CommittedUndoableOperation
public event Action<DiagramElement, IUndoableEdit> CommittedUndoableOperation
diagramElement.CommittedUndoableOperation += handler

Committed undoable operation.

ParameterValueChanged
public event Action<string> ParameterValueChanged
diagramElement.ParameterValueChanged += handler

The diagram element parameter value change event.

ProcessOutput
public event Action<DiagramSocketValue> ProcessOutput
diagramElement.ProcessOutput += handler

New data occurring event.

PropertiesChanged
public event Action PropertiesChanged
diagramElement.PropertiesChanged += handler

The available properties change event.

PropertyChanged
public event PropertyChangedEventHandler PropertyChanged
diagramElement.PropertyChanged += handler

The diagram element properties value change event.

PropertyChanging
public event PropertyChangingEventHandler PropertyChanging
diagramElement.PropertyChanging += handler

The diagram element properties value changing event.

SocketAdded
public event Action<DiagramSocket> SocketAdded
diagramElement.SocketAdded += handler

The diagram element connection added event.

SocketChanged
public event Action<DiagramSocket> SocketChanged
diagramElement.SocketChanged += handler

The diagram element connection changed event.

SocketRemoved
public event Action<DiagramSocket> SocketRemoved
diagramElement.SocketRemoved += handler

The diagram element connection removed event.

StartedUndoableOperation
public event Action StartedUndoableOperation
diagramElement.StartedUndoableOperation += handler

Started undoable operation.

Fields

FlushDisabled
protected const int FlushDisabled
value = DiagramElement.FlushDisabled

Disabled value for FlushPriority.

FlushNormal
protected const int FlushNormal
value = DiagramElement.FlushNormal

Normal value for FlushPriority.