Click here to Skip to main content
16,004,836 members
Home / Discussions / C#
   

C#

 
AnswerRe: DataGrid date sorting Pin
Natza Mitzi26-Nov-09 7:12
Natza Mitzi26-Nov-09 7:12 
GeneralRe: DataGrid date sorting Pin
W1SHM4ST3R26-Nov-09 20:16
W1SHM4ST3R26-Nov-09 20:16 
GeneralRe: DataGrid date sorting Pin
Natza Mitzi28-Nov-09 22:06
Natza Mitzi28-Nov-09 22:06 
GeneralRe: DataGrid date sorting Pin
W1SHM4ST3R29-Nov-09 23:50
W1SHM4ST3R29-Nov-09 23:50 
AnswerRe: DataGrid date sorting Pin
Yuri Vital26-Nov-09 12:02
Yuri Vital26-Nov-09 12:02 
GeneralRe: DataGrid date sorting Pin
W1SHM4ST3R26-Nov-09 20:18
W1SHM4ST3R26-Nov-09 20:18 
GeneralRe: DataGrid date sorting Pin
Yuri Vital26-Nov-09 21:02
Yuri Vital26-Nov-09 21:02 
QuestionNamespaces, aliases and Visual Studio Forms Designer Pin
Agent2526-Nov-09 0:13
Agent2526-Nov-09 0:13 
Hi.

I'm having a problem with conflicting namespaces and code that gets autogenerated by the forms designer in Visual Studio 2008. I have search many forums and different documentation, but have not been able to find any solution to this problem.

I have one assembly called Foo.dll with the following namespace/code:
namespace Foobar.System
{
    public class MySystemClass() { }
}

Then, I have another assembly which contains som commonly used forms:
namespace Foobar.MyCommonForms
{
    public class MyForm : System.Windows.Forms.Form
    {
        public void SomeMethod()
        {
            var systemclass = new Foobar.System.MySystemClass();
        }
    }
}

Here, the compilers display the following error: Type or namespace 'Windows' is not part of namespace 'Foobar.System'. Obviously, the compiler tries to look for the class System.Windows.Forms.Form in namespace Foobar.System.Windows.Forms!

I have been able to solve this by using the alias 'x' instead of 'global' when referencing to the assembly Foo.dll, and declaring extern alias x in my code files, and put 'x::' in front of every reference to types and classes in the namespace Foobar.System. The code compiles.

But it seems that the forms designer don't recognise this, and gives me an error when trying to display the form. This, again, can be solved by manually putting 'global::' in front of every reference to classes in System.Windows.Forms (e.g. global::System.Windows.Forms.Button), but every time chances are made to the form, the code is automaticaly re-generated, and the 'global::' part is removed.

So, the question is: Is there a way to make the forms designer aware of the alias 'x' that is used to reference my assembly Foo.dll, or is there another, better solution to this? Renaming the namespace Foobar.System to something else is just too much work.
AnswerRe: Namespaces, aliases and Visual Studio Forms Designer Pin
freakyit26-Nov-09 1:52
freakyit26-Nov-09 1:52 
AnswerRe: Namespaces, aliases and Visual Studio Forms Designer Pin
Dave Kreskowiak26-Nov-09 4:48
mveDave Kreskowiak26-Nov-09 4:48 
AnswerRe: Namespaces, aliases and Visual Studio Forms Designer Pin
Member 218499726-Nov-09 7:02
Member 218499726-Nov-09 7:02 
QuestionSending XML Pin
rakeshs31225-Nov-09 22:51
rakeshs31225-Nov-09 22:51 
AnswerRe: Sending XML Pin
freakyit26-Nov-09 1:40
freakyit26-Nov-09 1:40 
GeneralRe: Sending XML Pin
rakeshs31226-Nov-09 2:54
rakeshs31226-Nov-09 2:54 
GeneralRe: Sending XML Pin
freakyit26-Nov-09 3:29
freakyit26-Nov-09 3:29 
QuestionPROBLEM AFTER VIEW A REPORT Pin
saldanha2225-Nov-09 22:31
saldanha2225-Nov-09 22:31 
AnswerRe: PROBLEM AFTER VIEW A REPORT Pin
Richard MacCutchan25-Nov-09 22:44
mveRichard MacCutchan25-Nov-09 22:44 
GeneralRe: PROBLEM AFTER VIEW A REPORT Pin
saldanha2225-Nov-09 22:56
saldanha2225-Nov-09 22:56 
GeneralRe: PROBLEM AFTER VIEW A REPORT Pin
Richard MacCutchan25-Nov-09 23:53
mveRichard MacCutchan25-Nov-09 23:53 
GeneralRe: PROBLEM AFTER VIEW A REPORT Pin
saldanha2226-Nov-09 0:24
saldanha2226-Nov-09 0:24 
GeneralRe: PROBLEM AFTER VIEW A REPORT Pin
Richard MacCutchan26-Nov-09 2:41
mveRichard MacCutchan26-Nov-09 2:41 
Questioncomponent Pin
h.pordel25-Nov-09 20:33
h.pordel25-Nov-09 20:33 
AnswerRe: component Pin
dan!sh 25-Nov-09 20:39
professional dan!sh 25-Nov-09 20:39 
GeneralRe: component Pin
h.pordel25-Nov-09 20:48
h.pordel25-Nov-09 20:48 
GeneralRe: component Pin
Member 218499725-Nov-09 20:55
Member 218499725-Nov-09 20:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.