Show / Hide Table of Contents

    Class UserDefinedConnection

    This describes a user defined connection in this model. Every connection using this user defined connection shares this same data (there is one list, by name, of all UserDefinedConnections in each job).

    Inheritance
    object
    UserDefinedConnection
    Inherited Members
    object.GetType()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: DesignData.SDS2.Model
    Assembly: DesignData.SDS2.Model.dll
    Syntax
    public sealed class UserDefinedConnection

    Constructors

    UserDefinedConnection(string)

    This describes a user defined connection in this model. Every connection using this user defined connection shares this same data (there is one list, by name, of all UserDefinedConnections in each job).

    Declaration
    public UserDefinedConnection(string name)
    Parameters
    Type Name Description
    string name

    Properties

    Condition

    The condition this user defined connection is intended to apply in.

    Declaration
    public UserDefinedConnectionCondition Condition { get; }
    Property Value
    Type Description
    UserDefinedConnectionCondition

    Handle

    The database handle for this object

    Declaration
    public UserDefinedConnectionHandle Handle { get; }
    Property Value
    Type Description
    UserDefinedConnectionHandle

    Name

    Get the name of this UserDefinedConnection object

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string

    Methods

    Add(UserDefinedConnection)

    Add a new user defined connection to the current Transaction.

    Declaration
    public static void Add(UserDefinedConnection userDefinedConnection)
    Parameters
    Type Name Description
    UserDefinedConnection userDefinedConnection
    Exceptions
    Type Condition
    NotAddedException

    If there is no Transaction or the Member has already been added to the database.

    ~UserDefinedConnection()

    This describes a user defined connection in this model. Every connection using this user defined connection shares this same data (there is one list, by name, of all UserDefinedConnections in each job).

    Declaration
    protected ~UserDefinedConnection()

    Find(string)

    Lookup a UserDefinedConnection class by name.

    Declaration
    public static UserDefinedConnection Find(string name)
    Parameters
    Type Name Description
    string name
    Returns
    Type Description
    UserDefinedConnection

    Get(UserDefinedConnectionHandle)

    Get a full UserDefinedConnection object from a UDC handle

    Declaration
    public static UserDefinedConnection Get(UserDefinedConnectionHandle udcHandle)
    Parameters
    Type Name Description
    UserDefinedConnectionHandle udcHandle
    Returns
    Type Description
    UserDefinedConnection
    Exceptions
    Type Condition
    InvalidValueException

    thrown if udcHandle is null

    GetInputSpecification()

    The input specification for this user defined connection, this is applied to the connection on a member end when this user defined connection is used

    Declaration
    public ConnectionSpecification GetInputSpecification()
    Returns
    Type Description
    ConnectionSpecification

    GetLockable(string)

    Get a single lockable by name. Doing this with the map would work just as well, but this can be more efficient if you just need one.

    Declaration
    public Lockable GetLockable(string name)
    Parameters
    Type Name Description
    string name
    Returns
    Type Description
    Lockable
    Remarks

    This will be a copy of the lockable. If you make changes to it, to see them reflected you will need to pass it to SetLockable

    GetLockables()

    The lockable map for this user defined connection, anything locked here will be locked and set on the member end this is applied to

    Declaration
    public LockableDictionary GetLockables()
    Returns
    Type Description
    LockableDictionary

    SetInputSpecification(ConnectionSpecification)

    Overwrite this specification with a new one, this is only valid for new UserDefinedConnections that you haven't added to the job yet.

             We recommend that you set values in Condition before you set this.
    
    Declaration
    public void SetInputSpecification(ConnectionSpecification connSpec)
    Parameters
    Type Name Description
    ConnectionSpecification connSpec
    Exceptions
    Type Condition
    InvalidOperationException

    thrown if this UserDefinedConnection has already been added and committed to the job. The user defined connection list is append only for the API. Also sometimes thrown if the type of this specification does not match the MemberType and MaterialType set in Condition, so set that first.

    SetLockable(string, Lockable)

    Apply a lockable value to this connection. You can only pass in names which would return a non-null lockable from GetLockable (so you can't add new lockable keys this way, you can just replace their value).

    Declaration
    public void SetLockable(string name, Lockable value)
    Parameters
    Type Name Description
    string name
    Lockable value
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this UserDefinedConnection has already been added and comitted to the job. The user defined connection list is append only for the API.

    InvalidValueException

    Thrown if value is null or if this connection does not have a lockable matching name.

    InvalidOperationException

    Thrown when attempting to override a locked lockable within process. Unless you are implementing an extension of SDS2 (such as a custom member) this does not apply.

    NotAddedException

    Thrown if this is called without adding both this Component object and the Member it is on to the Transaction. Or if there simply isn't a Transaction.

    InvalidValueException

    Thrown if the lockable given is not a valid value for this specific lockable. The Message on the InvalidValueException will include the message we'd give to a user if they typed that value on the screen, so it's usable to present directly to a user if your application is interactive.

    Back to top