RobotStudio event

'Item' property missing in C#

RS 5.12.02

The API Help shows that the 'RibbonTabCollection' class has 'Item' properties for C# and VB.
This VB code is OK:
[CODE]Dim tab As RibbonTab = UIEnvironment.RibbonTabs.Item("Add-Ins")
[/CODE] ... but this C# code:
[CODE]RibbonTab tab = UIEnvironment.RibbonTabs.Item["Add-Ins"];[/CODE] ... gives error message: [CODE]'ABB.Robotics.RobotStudio.Environment.RibbonTabCollection' does not contain a definition for
'Item' and no extension method 'Item' accepting a first argument of type
'ABB.Robotics.RobotStudio.Environment.RibbonTabCollection' could be found
(are you missing a using directive or an assembly reference?)[/CODE]
If I view the 'RibbonTabCollection' class in the Microsoft Visual Basic 2008 Express Edition object browser the 'Item(String)' and 'Item(Integer)' properties are present.

If I view the 'RibbonTabCollection' class in the Microsoft Visual C# 2008 Express Edition object browser the 'Item[String]' and
'Item[Integer]' properties are missing.

The referenced 'ABB.Robotics.RobotStudio.Environment.dll' version is 5.12.3423.2040 in both cases.

Is this a bug in the API or in Visual Studio; or am I failing to understand something?

Thanks,

Kevin

Comments

  • Hi Kevin,

    The Item syntax is only used in VB since it doesn't support indexers. In C# it's simply
    [code]RibbonTab tab = UIEnvironment.RibbonTabs["Add-Ins"][/code]
    regards,
    Johannes

    Johannes Weiman
    Software Engineer
    ABB Robotics
  • Thanks Johannes,

    All is clear now.

    Kevin