Class IVortexObjectExtensions
Extensions methods for IVortexObject.
Inheritance
Namespace: Vortex.Connector
Assembly: Vortex.Connector.dll
Syntax
public static class IVortexObjectExtensions
  Methods
MakeReadOnly(IVortexObject)
Makes IVortexObject readonly for this application.
Declaration
public static void MakeReadOnly(this IVortexObject structure)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexObject | structure | Object to be rendered readonly  | 
      
Examples
    // Rendres whole structure value tag readonly
    ReadonlyStructure.MakeReadOnly();
    // Renders element [0,0] of the array readonly.
    roArray[0, 0].MakeReadOnly();
  
  
  
  Read(IVortexObject)
Reads all value tags of instance IVortexOnlineObject.
Declaration
public static void Read(this IVortexObject structure)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexObject | structure | 
Examples
// Reads all value tags of the MAIN PRG. The value is stored in property 'Cyclic' and 'LastValue' of the respective value tag.
Connector.MAIN.Read();
  
  
  
  ReadStructure(IVortexOnlineObject)
Reads all value tags of instance IVortexOnlineObject.
Declaration
public static void ReadStructure(this IVortexOnlineObject structure)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexOnlineObject | structure | 
Examples
// Reads all value tags of the MAIN PRG. The value is stored in property 'Cyclic' and 'LastValue' of the respective value tag.
Connector.MAIN.ReadStructure();
  
  
  
  RetrieveValueTags(IVortexObject, List<IValueTag>)
Retrieves all value tags of given object.
Declaration
public static IEnumerable<IValueTag> RetrieveValueTags(this IVortexObject onlineObject, List<IValueTag> valueTags = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexObject | onlineObject | Object from which the value tags are to be retrieved.  | 
      
| System.Collections.Generic.List<IValueTag> | valueTags | Existing value tags.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<IValueTag> | Value tags of given object.  | 
      
Examples
This example demonstrates how to get all value tags of the MAIN PRG object.
    var mainProgramTags = Connector.MAIN.RetrieveValueTags();
  
  
  
  SubscribeEditValueChange(IVortexObject, OnlinerBaseType.ValueChangeDelegate)
Subscribes a delegate to be invoked when any Edit value on given object changes its value.IVortexObject
Declaration
public static void SubscribeEditValueChange(this IVortexObject obj, OnlinerBaseType.ValueChangeDelegate valueChangeDelegate)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexObject | obj | Observed object.  | 
      
| OnlinerBaseType.ValueChangeDelegate | valueChangeDelegate | Delegate to be invoked on Edit value change.  | 
      
Examples
class EditValueChangeObserver
{
    public EditValueChangeObserver()
    {
        Connector.MAIN.SubscribeEditValueChange(DetectEditValueChange);                 
    }
    private void DetectEditValueChange(IValueTag valueTag, dynamic original, dynamic newValue)
    {
        Console.WriteLine($"Value '{valueTag.Symbol}' has changed form {original} to {newValue}.")
    }
}
  
  
  
  SubscribeShadowValueChange(IVortexObject, OnlinerBaseType.ValueChangeDelegate)
Subscribes a delegate to be invoked when any Shadow value on given object changes its value.IVortexObject
Declaration
public static void SubscribeShadowValueChange(this IVortexObject obj, OnlinerBaseType.ValueChangeDelegate valueChangeDelegate)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexObject | obj | Observed object.  | 
      
| OnlinerBaseType.ValueChangeDelegate | valueChangeDelegate | Delegate to be invoked on shadow value change.  | 
      
Examples
class ShadowValueChangeObserver
{
    public ShadowValueChangeObserver()
    {
        Connector.MAIN.SubscribeShadowValueChange(DetectShadowValueChange);                 
    }
    private void DetectShadowValueChange(IValueTag valueTag, dynamic original, dynamic newValue)
    {
        Console.WriteLine($"Value '{valueTag.Symbol}' has changed form {original} to {newValue}.")
    }
}
  
  
  
  UnSubscribeEditValueChange(IVortexObject)
Un-subscribes Edit value change delegate from the value tags of given object.
Declaration
public static void UnSubscribeEditValueChange(this IVortexObject obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexObject | obj | Object from which the Edit value change delegate has to be removed.  | 
      
UnSubscribeShadowValueChange(IVortexObject)
Un-subscribes Shadow value change delegate from the value tags of given object.
Declaration
public static void UnSubscribeShadowValueChange(this IVortexObject obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexObject | obj | Object from which the shadow value change delegate has to be removed.  | 
      
Write(IVortexObject)
Writes all value tags of instance IVortexOnlineObject
Declaration
public static void Write(this IVortexObject structure)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexObject | structure | 
Examples
// Writes all modified values of the MAIN PRG.
Connector.Online.MAIN.GrowingLayoutStructure.Write()
  
  
  
  WriteStructure(IVortexOnlineObject)
Writes all value tags of instance IVortexOnlineObject
Declaration
public static void WriteStructure(this IVortexOnlineObject structure)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IVortexOnlineObject | structure | 
Examples
// Writes all modified values of the MAIN PRG.
Connector.Online.MAIN.GrowingLayoutStructure.WriteStructure()