Returns a value that indicates whether a user variable is added to the model.
Assembly: Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)
'Declaration Public Overridable Function AddVariable ( _ key As Object, _ <OutAttribute> ByRef vid As Integer _ ) As Boolean
public virtual bool AddVariable( Object key, out int vid )
public: virtual bool AddVariable( Object^ key, [OutAttribute] int% vid )
abstract AddVariable : key:Object * vid:int byref -> bool override AddVariable : key:Object * vid:int byref -> bool
public function AddVariable( key : Object, vid : int ) : boolean
A key for the row.
A variable index.
true if the user variable is added to the model successfully; false if the model already includes a user variable referenced by key or the model already includes a user variable referenced by key.
The following table shows the value of vid depending on the key.
key in the model
Value of vid
Model already includes a user variabile referenced by key.
vid is set to the variable's index.
Model already includes a user variable referenced by key.
vid is set to -1.
A new row associated with the key is added to the model.
vid is set to the new row index.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.