Why are used directives inside namespace in Silverlight 4 / VS 2010?

Why using statements inside a namespace in auto generated Silverlight 4 / VS 2010 code?

The new agreement looks like

namespace myNamespace
{
    using System.Windows.Controls;
    using System.Windows.Navigation;
    . . .

    public myClass() {}
}

      

not the standard:

using System.Windows.Controls;
using System.Windows.Navigation;

namespace myNamespace
{

    . . .

    public myClass() {}
}

      

Is there some reason for this or an advantage of this, or is this exactly how they did it?

+2


a source to share


1 answer


Mostly stylistic preferences. There is a very small advantage that if you use multiple root namespaces in the same file, then they are namespace bound.

t.



namespace Foo { using Blah; }
namespace Bar { /* No Blah context here */ }

      

+1


a source







All Articles