Resolving an ambiguous reference
I'm trying to create a manager class to use with my charting tool, the problem is the tool I use, uses the same names for both a 3d and 2d charts which is resulting in ambiguous reference when I try to add the 2d library.. any ideas how best to resolve this?
For example,
using tool.2dChartLib;
using tool.3dChartLib;
BorderStyle is a member of both of these
I've tried casting the areas where I use BorderStyle. I suppose it could work if i just reference tool
but then that would mean I'd have hundreds of tool.class
lines instead of class
If the types with the same name exist in both namespaces, you have a couple of options:
1) If the number of types is small, create an alias for that type:
using BorderStyle3d = tool.3dChartLib.BorderStyle;
2) If the number of types is large, you can create an alias for the namespace:
using t3d = tool.3dChartLib;
Then in your code...
t3d.BorderStyle
You can use full type names, or create aliases:
using 2dBorderStyle = tool.2dChartLib.BorderStyle;