Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
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...

GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 23:42
Member 1115157117-Oct-14 23:42 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 23:52
mveOriginalGriff17-Oct-14 23:52 
GeneralRe: Can I use local method in method Pin
Member 1115157118-Oct-14 0:06
Member 1115157118-Oct-14 0:06 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 0:10
mveOriginalGriff18-Oct-14 0:10 
GeneralRe: Can I use local method in method Pin
Member 1115157118-Oct-14 0:15
Member 1115157118-Oct-14 0:15 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 0:21
mveOriginalGriff18-Oct-14 0:21 
GeneralRe: Can I use local method in method Pin
BillWoodruff18-Oct-14 1:45
professionalBillWoodruff18-Oct-14 1:45 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 1:55
mveOriginalGriff18-Oct-14 1:55 
AnswerRe: Can I use local method in method Pin
BillWoodruff17-Oct-14 22:31
professionalBillWoodruff17-Oct-14 22:31 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 22:43
Member 1115157117-Oct-14 22:43 
QuestionDeepCopy Not Working Pin
Kevin Marois17-Oct-14 8:28
professionalKevin Marois17-Oct-14 8:28 
AnswerRe: DeepCopy Not Working Pin
BillWoodruff17-Oct-14 8:42
professionalBillWoodruff17-Oct-14 8:42 
AnswerRe: DeepCopy Not Working Pin
Rob Philpott19-Oct-14 7:46
Rob Philpott19-Oct-14 7:46 
AnswerRe: DeepCopy Not Working Pin
Bernhard Hiller19-Oct-14 22:26
Bernhard Hiller19-Oct-14 22:26 
QuestionC# Socket Communication Pin
Lillepige17-Oct-14 8:17
Lillepige17-Oct-14 8:17 
AnswerRe: C# Socket Communication Pin
Richard Andrew x6417-Oct-14 9:49
professionalRichard Andrew x6417-Oct-14 9:49 
AnswerRe: C# Socket Communication Pin
Dave Kreskowiak17-Oct-14 9:52
mveDave Kreskowiak17-Oct-14 9:52 

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.