On 4/23/2013 5:06 AM, bradbury9 wrote:
> El martes, 23 de abril de 2013 10:50:21 UTC+2, Anders Eriksson escribió:
>> I have an ActiveX library that I need to use to control some hardware.
>> This ActiveX has a public interface called System.
>> I know that it's stupid but it's a fact!
>>
>> If I put the using statements before my namespace everything works, but
>> if I put them inside my namespace (like Stylecop wants) The
>> sub-type names of System will not be found since System is assumed to be
>> in the ActiveX namespace.
>> =This doesn't work=
>>
>> namespace DcSelectMark
>> {
>> using System;
>> using System.Collections.Generic;
>> using System.ComponentModel;
>> using System.Data;
>> using System.Drawing;
>> using System.IO;
>> using System.Text;
>> using System.Windows.Forms;
>> using laserengineLib; // this is the Interop for the ActiveX library
>>
>> I get this error message:
>>
>> namespace System.Collections
>>
>> Error:
>>
>> The type name 'Collections' does not exist in the type
>>
>> 'laserengineLib.System'
I agree that:
using global::System;
is a good solution (given an requirement to put using's at
that place).
But I get different associations by the term "namespace alias".
Note that the latest version of the doc:
http://msdn.microsoft.com/en-us/library/c3ay4x3d%28v=vs.110%29.aspx
has changed the term to "Global Namespace Alias" which I think is better.
"namespace alias" is usually associated with:
http://msdn.microsoft.com/en-us/library/dfb3cx8s.aspx
section "Namespace Aliases".
Arne