nvms
asked on
How to create OOP functionality e.g. x=MajorArea.SubAreas.SpecificMethod(Param1,Param2) etc
I am new to C# and want to create very structured code where I am calling functions and retrieving information via nested processes. I would like each 'item' to be a seperate class file (e.g. class1.cs, class2.cs etc)
I am having difficulty grasping the concepts of C# including the 'using MyThing;' statements after using System.xxx, I know this exposes contents of namespaces but i cannot go any further then firstcall.secondcall
If you can implement the following into a C# code example I would be grateful:
A class called major.cs containing the following:
1) a static parameter I Get and Set e.g. string s=major.strSetting
2) a method which returns a value e.g. int i = major.AddThese(1,2)
Secondary classes called minor1.cs and minor2.cls which contain a method or two
An example of how I can call something like
MyResult = major.minor1.method1(1,2,3 )
I am sure a good example of this will help other new users also.
I am having difficulty grasping the concepts of C# including the 'using MyThing;' statements after using System.xxx, I know this exposes contents of namespaces but i cannot go any further then firstcall.secondcall
If you can implement the following into a C# code example I would be grateful:
A class called major.cs containing the following:
1) a static parameter I Get and Set e.g. string s=major.strSetting
2) a method which returns a value e.g. int i = major.AddThese(1,2)
Secondary classes called minor1.cs and minor2.cls which contain a method or two
An example of how I can call something like
MyResult = major.minor1.method1(1,2,3
I am sure a good example of this will help other new users also.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, good advice
class Major
{
public staitc string strSetting=null;
public int AddThese(int a,int b)
{
return a+b;
}
//This is an InnerClass
public class Minor1
{
public static int method1(int a,int b,int c)
{
return 0;
}
}
}