bucz

Iwanted to develope a clas sin three different files, one for methods, one for variables and one for properties. How to do this in environment

I have declared my class as "partial", but I dont know how to add those extra files to solution that IDE would know how to handle them.




Re: Visual C# Language "partial" - adding my own files with code

the_grove_man

Since the classes you add will be in the same namespace, just add classes, name them whatever you want. Then change the name, like this.

first class:

namespace ConsoleApplication1

{

partial class Program

{

static void Main(string[] args)

{

}

{

}

Then I added another class, called Class1. Here is how it originally looks.

namespace ConsoleApplication1

{

class Class1

{

}

}

Change the above to:

namespace ConsoleApplication1

{

partial class Program

{

}

The physical name of the file, for example Program.cs, and Class1.cs can be different. But, when you change the internal names like I shown above, that should satisify your needs. Name one class file Properties.cs, one Methods.cs, but each class inside should have public partial WhatEverTheNameIs






Re: Visual C# Language "partial" - adding my own files with code

bucz

Thanks,

and how to force IDE that this my new file is included into a proper node example:

I have something like this

MyControl.cs
+---MyControl/Designer.cs

MyControl.Properties.cs <- my file

and I want to have

MyControl.cs
+---MyControl/Designer.cs
+---MyControl.Properties.cs



I like to have an order in a project : )