Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# assign ProcessID Pin
Alaric_20-Oct-14 15:34
professionalAlaric_20-Oct-14 15:34 
AnswerRe: C# assign ProcessID Pin
Member 9986689 (PandaLion98)25-Oct-14 21:13
professionalMember 9986689 (PandaLion98)25-Oct-14 21:13 
GeneralRe: C# assign ProcessID Pin
Alaric_28-Oct-14 10:11
professionalAlaric_28-Oct-14 10:11 
QuestionWhat is better way to organise code of big project Pin
Member 1115157120-Oct-14 5:08
Member 1115157120-Oct-14 5:08 
AnswerRe: What is better way to organise code of big project Pin
Simon_Whale20-Oct-14 5:15
Simon_Whale20-Oct-14 5:15 
AnswerRe: What is better way to organise code of big project Pin
PIEBALDconsult20-Oct-14 5:16
mvePIEBALDconsult20-Oct-14 5:16 
AnswerRe: What is better way to organise code of big project Pin
Eddy Vluggen20-Oct-14 5:23
professionalEddy Vluggen20-Oct-14 5:23 
AnswerRe: What is better way to organise code of big project Pin
OriginalGriff20-Oct-14 5:31
mveOriginalGriff20-Oct-14 5:31 
GeneralRe: What is better way to organise code of big project Pin
Member 1115157120-Oct-14 6:35
Member 1115157120-Oct-14 6:35 
GeneralTo Deeksha Shenoy Pin
hevesir20-Oct-14 1:10
hevesir20-Oct-14 1:10 
GeneralRe: To Deeksha Shenoy Pin
OriginalGriff20-Oct-14 2:42
mveOriginalGriff20-Oct-14 2:42 
GeneralRe: To Deeksha Shenoy Pin
hevesir20-Oct-14 3:19
hevesir20-Oct-14 3:19 
GeneralRe: To Deeksha Shenoy Pin
OriginalGriff20-Oct-14 3:27
mveOriginalGriff20-Oct-14 3:27 
GeneralRe: To Deeksha Shenoy Pin
hevesir20-Oct-14 11:11
hevesir20-Oct-14 11:11 
GeneralRe: To Deeksha Shenoy Pin
OriginalGriff20-Oct-14 11:39
mveOriginalGriff20-Oct-14 11:39 
QuestionDrawing player "tokens" in TableLayoutCell Pin
Member 1116046719-Oct-14 21:08
Member 1116046719-Oct-14 21:08 
QuestionThe Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file Pin
lan160719-Oct-14 13:38
lan160719-Oct-14 13:38 
AnswerRe: The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file Pin
Richard MacCutchan19-Oct-14 21:42
mveRichard MacCutchan19-Oct-14 21:42 
QuestionHow to merge image using Emgu CV library after comparison Pin
Tridip Bhattacharjee17-Oct-14 23:40
professionalTridip Bhattacharjee17-Oct-14 23:40 
QuestionCan I use local method in method Pin
Member 1115157117-Oct-14 20:57
Member 1115157117-Oct-14 20:57 
AnswerRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 21:45
mveOriginalGriff17-Oct-14 21:45 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 21:54
Member 1115157117-Oct-14 21:54 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 22:18
mveOriginalGriff17-Oct-14 22:18 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 22:43
Member 1115157117-Oct-14 22:43 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 22:54
mveOriginalGriff17-Oct-14 22:54 
You're welcome.
One way you might not have considered is to create a nested class: all instance methods have access to the class level fields (variables in Pascal), so instead of having your variables local to the pascal function and available to nested functions, you have them private to the class instance, and all methods in the nested class can access them, but the outside world can't:
C#
public class MyClass
    {
    private class InnerClass
        {
        private int i = 0;
        private int j = 1;
        public InnerClass(int x)
            {
            j = x;
            }
        public int MethodOne(int x)
            {
            i = x;
            return MethodTwo(j);
            }
        public int MethodTwo(int x)
            {
            return i * j + x * 2;
            }
        }
    public void UseIt()
        {
        for (int i = 0; i < 10; i++)
            {
            InnerClass ic = new InnerClass(i);
            Console.WriteLine(ic.MethodOne(i * 2));
            }
        }
    }

Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

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.