I'm making some experiments with Visual Studio's CodeModel. I tried creating a file with two namespaces in there through VS's Code Model:
CodeModel codeModel = projItem.ContainingProject.CodeModel;
codeModel.AddNamespace("Namespaces.FirstNamespace", "namespacestest.cs");
codeModel.AddNamespace("Namespaces.SecondNamespace", "namespacestest.cs");
the output of such code is:
//file namespacestest.cs
namespace Namespaces.FirstNamespace {
}
namespace Namespaces.SecondNamespace {
}
Which is almost what I'm looking for. The only catch here is that I'd like to control the spacing: having at least one line between the first and the second namespace. Does by chance anyone know of a way of achieving this?
This is what I want:
//file namespacestest.cs
namespace Namespaces.FirstNamespace {
}
namespace Namespaces.SecondNamespace {
}
Thanks