IMcObjectCategory Property
|
|
A property both reflecting and allowing the assignment of the
object's Category membership.
Namespace:
MediaCy.IQL.ObjectManager
Assembly:
MediaCy.IQL.ObjectManager (in MediaCy.IQL.ObjectManager.dll) Version: 10.0.6912.0
SyntaxProperty Category As Object
Get
Set
Property Value
Type:
Object
RemarksThe object may be added to a category by assigning with
either the Category ID or Name. Assign with the category to ID value zero
to remove the object from all categories. An object may be part of many
categories, so this property my be an array of values
The Category property is always exposed as a numeric category ID; this value
will be a scalar value zero if the object is not part of any category. It will
be a scalar, non-zero category ID value if the object is part of one category
only. Or it will be an array of category ID values if the object is part of
multiple categories. Use the McObjects.CategoryNameOrID method to get the
category's name from its ID.
If the category is assigned by name, the category name must be within
the scope of the current Namespace property of the CreatorCollection.
Use the "::" syntax to specfify the category namespace directly.
An IMcObjStandardNotify::CategorySet notify will be fired to all attached
standard notify sinks whenever the category is changed by assigning to this
property. The notify is fired after the new category assignment is made.
There is no notify sent when the object is being removed from a category because
either it is being deleted (see McObjects.Remove) or the category is being
unregistered (see McObjects.UnregisterCategory).
ExamplesCategoryID1 = RegisterCategory("Category1")
CategoryID2 = RegisterCategory("Category2")
Dim oMcO1 As McObject
Set oMcO1 = ThisApplication.McObjects.Add("SHORT", "sMyO1", "", , , 0, "Category1")
oMcO1.Category = CategoryID2
Cats = oMcO1.Category
ResultsText.Text = "Category Is Array= " + Str(IsArray(Cats)) + vbCrlf _
"Cat0= " + ThisApplication.McObjects.CategoryNameOrID( Cats(0)) + vbCrlf _
"Cat1= " + ThisApplication.McObjects.CategoryNameOrID( Cats(1))
oMcO1.Category = 0
If oMcO1.Category!=0 Then MsgBox("Logic Error")
UnregisterCategory CategoryID1
UnregisterCategory CategoryID2
Set oMcO1 = Nothing
See AlsoReference
RegisterCategory