IMcObjectsAttachAutoAddToCategory Method
|
|
Associates an object "Auto Add" with a particular McObject category.
Namespace:
MediaCy.IQL.ObjectManager
Assembly:
MediaCy.IQL.ObjectManager (in MediaCy.IQL.ObjectManager.dll) Version: 10.0.6912.0
SyntaxFunction AttachAutoAddToCategory (
varCategoryNameOrID As Object,
varTypeNameOrEnum As Object,
bstrName As String,
Optional lTagNumber As Integer = 0,
<OptionalAttribute> varParentTypeNameOrEnum As Object,
Optional eControlFlags As mcobjAttachAutoAddToCategoryFlags = mcobjAttachAutoAddToCategoryFlags.mcobjAATC_Default
) As IntPtr
Parameters
- varCategoryNameOrID
- Type: SystemObject
[in] Category to auto create for (see
RegisterCategory). ID can be NULL for the global category. - varTypeNameOrEnum
- Type: SystemObject
[in] The type name or type enum to attach. If
an interface is to be automatically instantiated as the object's data, then
this type must have previously been registered with a call to
RegisterInterfaceClassFactory. - bstrName
- Type: SystemString
[in] Name to be given to the automatically created object.
This name must not conflict any existing name in its namespace. Unless the
name is supplied using the "::" syntax (e.g.,
"MyNamespace::MyAutoObjectName"), the namespace used is the current default
Namespace of this instance of the McObjects ("McOM" unless the Namespace
property has been changed). - lTagNumber (Optional)
- Type: SystemInt32
[in, defaultvalue(0)] An initial TagNumber property to
assign to the object. If this number is positive, it must unique for all
objects with the same (or no) ParentMcObject; objects with these tags
can be found quickly with the LookupByTagNumber method. - varParentTypeNameOrEnum (Optional)
- Type: SystemObject
[in, optional] If given, this is the
Type of the varParentIMcObject (or one of its ancestors, see eControlFlags,
below) expected for the GetCategoryItem call. It can either be a BSTR
typename or a long or short mcobjTypeEnum object type, including types
returned by RegisterInterfaceClassFactory. - eControlFlags (Optional)
- Type: MediaCy.IQL.ObjectManagermcobjAttachAutoAddToCategoryFlags
[in, defaultvalue(mcobjAATC_Default)] These flags govern how
a given varParentTypeNameOrEnum is used to determine the acceptable
GetCategoryItem varParentIMcObject arguments for a successful auto Add.
Also, you can prohibit the creation of global objects with the
mcobjAATC_GlobalIsIllegal flag.
Return Value
Type:
IntPtrAn identifier ("Cookie") for this attach.
RemarksSets up to automatically create and add to the McObjects collection an
McObject with a given name and type when a GetCategoryItem call is made and no
object with the given name (and appropriate parent object) already exists. If
the object type (varTypeNameOrEnum argument) is one from a previous call to
RegisterInterfaceClassFactory, then when the new object is Added to the
collection, its associated class factory will be fired to instantiate an enclosed
interface.
See Also