'Item' property missing in C#
Kevin
✭✭
in RobotStudio
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
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
0
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 Robotics0 -
Thanks Johannes,
All is clear now.
Kevin
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings