PC SDK problem / bug in EventLogMessage object
Laro88
✭
System.Text.StringBuilder sbBody = new System.Text.StringBuilder();
sbBody.AppendLine(eventLogMessage.Body);
sbBody.AppendLine(eventLogMessage.CategoryType.ToString()); //Causes an exception
The CategoryType is marked obsolete, however since the obsoletion apparently is not marked as dead using the Attribute spec:
[System.Obsolete("use NewMethod", true)] //True results in compilecrash
Then it becomes a bit annoying when the attribute fires a NotSupportedException
Please fix for next release, and have the courtesy of looking at some of the other obsoletes. I have run into one more somewhere.
Regards
sbBody.AppendLine(eventLogMessage.Body);
sbBody.AppendLine(eventLogMessage.CategoryType.ToString()); //Causes an exception
The CategoryType is marked obsolete, however since the obsoletion apparently is not marked as dead using the Attribute spec:
[System.Obsolete("use NewMethod", true)] //True results in compilecrash
Then it becomes a bit annoying when the attribute fires a NotSupportedException
Please fix for next release, and have the courtesy of looking at some of the other obsoletes. I have run into one more somewhere.
Regards
0
Comments
-
Hi,the property EventLogMessage.CategoryType is marked as Obsolete.The odd thing is that the implementation throws a NotSupportedException.I'll try to find out the reason for this.In many cases its better to return some "good default" value when calling the obsolete property instead of throwing an exception.Its a bit philosophic; Is it better to have an application that seems to work, and is using a value in its code, but the value is not really valid since its just some default returned from an obsolete function.Or is it better to indicate that the application is not reliable because it is trying to use a return value from an obsolete function, by throwing an exception.From your post I can guess what your choice is.0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings