日期:2014-05-17  浏览次数:21050 次

请教大牛们,两个类库中的类名重复怎么办?急~~~~~~~~
本菜鸟在做毕业设计。需要用到DotSpatial.Topology类库中的Polygon类。
但是引用后报错:

“Point”是“System.Drawing.Point”和“DotSpatial.Topology.Point”之间的不明确的引用。

然而我又不能不用System.Drawing类库。

请教大牛们,有没有能让两个类库共存的方法,能明确Point类是属于哪个类库的而避免歧义。

十分感谢~

DotSpatial 类名重复

------解决方案--------------------
带namespace不行吗?
System.Drawing.Point p1;
DotSpatial.Topology.Point p2;
------解决方案--------------------
(1)使用别名
(2)写的时候完整写命名空间
原来你写Point
现在如果你用的是DotSpatial.Topology.Point,就写DotSpatial.Topology.Point,否则写System.Drawing.Point