Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
GeneralRe: Measuring reaction time of the user. Pin
Jakob Olsen8-Dec-08 10:20
Jakob Olsen8-Dec-08 10:20 
QuestionAdd image to spreadsheetml document Pin
GibbleCH8-Dec-08 9:48
GibbleCH8-Dec-08 9:48 
QuestionAcquiring a thread. Pin
Member 23244838-Dec-08 9:22
Member 23244838-Dec-08 9:22 
AnswerRe: Acquiring a thread. Pin
Christian Graus8-Dec-08 9:45
protectorChristian Graus8-Dec-08 9:45 
GeneralRe: Acquiring a thread. Pin
Member 23244838-Dec-08 10:20
Member 23244838-Dec-08 10:20 
GeneralRe: Acquiring a thread. Pin
N a v a n e e t h8-Dec-08 16:33
N a v a n e e t h8-Dec-08 16:33 
QuestionComunication between form an appl. and a service. Pin
daavena8-Dec-08 9:07
daavena8-Dec-08 9:07 
AnswerRe: Comunication between form an appl. and a service. Pin
Giorgi Dalakishvili8-Dec-08 9:16
mentorGiorgi Dalakishvili8-Dec-08 9:16 
GeneralRe: Comunication between form an appl. and a service. Pin
daavena8-Dec-08 9:28
daavena8-Dec-08 9:28 
GeneralRe: Comunication between form an appl. and a service. Pin
Giorgi Dalakishvili8-Dec-08 19:19
mentorGiorgi Dalakishvili8-Dec-08 19:19 
AnswerRe: Comunication between form an appl. and a service. Pin
PIEBALDconsult8-Dec-08 12:45
mvePIEBALDconsult8-Dec-08 12:45 
QuestionEmbedding Excel in Windows Forms Pin
San248-Dec-08 8:11
San248-Dec-08 8:11 
AnswerRe: Embedding Excel in Windows Forms Pin
Giorgi Dalakishvili8-Dec-08 8:27
mentorGiorgi Dalakishvili8-Dec-08 8:27 
GeneralRe: Embedding Excel in Windows Forms Pin
San248-Dec-08 9:10
San248-Dec-08 9:10 
GeneralRe: Embedding Excel in Windows Forms Pin
Giorgi Dalakishvili8-Dec-08 9:15
mentorGiorgi Dalakishvili8-Dec-08 9:15 
GeneralRe: Embedding Excel in Windows Forms Pin
San2410-Dec-08 5:21
San2410-Dec-08 5:21 
GeneralRe: Embedding Excel in Windows Forms Pin
Giorgi Dalakishvili10-Dec-08 6:23
mentorGiorgi Dalakishvili10-Dec-08 6:23 
QuestionThe "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
hdv2128-Dec-08 7:35
hdv2128-Dec-08 7:35 
AnswerRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
Colin Angus Mackay8-Dec-08 8:03
Colin Angus Mackay8-Dec-08 8:03 
AnswerRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
Mark Salsbery8-Dec-08 8:52
Mark Salsbery8-Dec-08 8:52 
AnswerRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
Nissim Salomon8-Dec-08 9:00
Nissim Salomon8-Dec-08 9:00 
GeneralRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
hdv2128-Dec-08 9:08
hdv2128-Dec-08 9:08 
Questionmethod inheretance Pin
Deresen8-Dec-08 6:29
Deresen8-Dec-08 6:29 
AnswerRe: method inheretance Pin
Alan Balkany8-Dec-08 8:11
Alan Balkany8-Dec-08 8:11 
GeneralRe: method inheretance Pin
Deresen8-Dec-08 8:25
Deresen8-Dec-08 8:25 
Thank you.

But the problem I have is that if I want to add a function to my Interface class and it is as simple as calling the base function with as parameter itself, shouldn't it be possible to do that in some kind of global class. Something like this:

class Main
{
   public Main()
   {
      X x = new X();
      x.function1("myText"); -> false
      X2 x2 = new X2();
      x2.function1("myText"); -> true
   }
}

interface InterfaceX
{
    int number { get; };
    bool function1(String txt);
}

class X :  Z, InterfaceX
{
    public int number
    {
       get { return 5;}
    }
   public X(){}
}
class X2 : Z, InterfaceX
{
    public int number
    {
       get { return 2;}
    }
    public X2() {}
}

class Z : Y, 
{
   public bool function1(String txt)
   {
      return base.function2(this.getParent(), txt);
   }
}

class Y
{
   public bool function2(InterfaceX x, String txt)
   {
      if(x.number < 3)
         return true;
      else
         return false;
   }
}


It's all about the this.getParent(), this doesn't work, but how can I get this working?

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.