Click or drag to resize
RsDataDeclarationCollection Class
A collection of RsDataDeclaration objects.
Inheritance Hierarchy
SystemObject
  ABB.Robotics.RobotStudio.StationsRsDataDeclarationCollection

Namespace:  ABB.Robotics.RobotStudio.Stations
Assembly:  ABB.Robotics.RobotStudio.Stations (in ABB.Robotics.RobotStudio.Stations.dll) Version: 7.0.8747.636
Syntax
C#
public class RsDataDeclarationCollection : ICollection, 
	IEnumerable, IEnumerable<RsDataDeclaration>

The RsDataDeclarationCollection type exposes the following members.

Properties
Methods
  NameDescription
Public methodCode exampleAdd
Adds a RsDataDeclaration to the collection.
Public methodCode exampleContains(String) Obsolete.
Checks if the the collecction contains a RsDataDeclaration.
Public methodContains(RsDataDeclaration)
Public methodCopyTo(Array, Int32)
Public methodCopyTo(RsDataDeclaration, Int32)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetEnumerator
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodCode exampleRemove
Removes a RsDataDeclaration from the collection.
Public methodToArray
Public methodToString (Inherited from Object.)
Public methodTryGetDataDeclaration Obsolete.
Gets the data declaration with the specified name.
Top
Examples
RsDataDeclarationCollection Collection.
RsDataDeclarationCollection Example
Project.UndoContext.BeginUndoStep("RsDataDeclarationCollection");
try
{
    Station station = Station.ActiveStation;

    // Get the RsDataDeclarationCollection for the ActiveTask.
    RsDataDeclarationCollection ddCol = station.ActiveTask.DataDeclarations;
    RsRobTarget rbt = new RsRobTarget();
    rbt.Name = station.ActiveTask.GetValidRapidName("MyRobTarget", "_", 1);
    String robTargetName = rbt.Name;
    ddCol.Add(rbt);

    // Output some info of the DataDeclaration in the logger.
    Logger.AddMessage(new LogMessage("The RsDataDeclarationCollection on the active task contains:"));
    foreach (RsDataDeclaration dd in ddCol)
    {
        Logger.AddMessage(new LogMessage("DataDeclaration: " + dd.Name + " with type: " + dd.TypeDisplayName));
    }

    // Check that RsDataDeclarationCollection contains the RobTarget that was added.
    if (station.ActiveTask.FindDataDeclarationFromModuleScope(robTargetName, rbt.ModuleName) != null)
    {
        Logger.AddMessage(new LogMessage("The RsDataDeclarationCollection contains " + robTargetName));
    }
    RsDataDeclaration rbt2;
    try
    {
        rbt2 = station.ActiveTask.FindDataDeclarationFromModuleScope("MyRobTarget_2", rbt.ModuleName);
        if (rbt2 != null)
        {
            Logger.AddMessage(new LogMessage("Found MyRobTarget_2"));
        }
        else
        {
            Logger.AddMessage(new LogMessage("Did not find MyRobTarget_2"));
        }
    }

    catch (ArgumentException e)
    {
        Logger.AddMessage(new LogMessage("The error: '" + e.Message + "' occured when trying to get 'MyRobTarget_2'"));
    }

    // Remove MyRobTarget_1 from the collection.
    ddCol.Remove(rbt);
}
catch
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw;
}
finally
{
    Project.UndoContext.EndUndoStep();
}
Version Information

Supported in: 1.0.0.0
See Also