Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. base question

base question

Scheduled Pinned Locked Moved C#
question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mathew Hall
    wrote on last edited by
    #1

    I have a control C that extends control B that extends control A. In control C's OnXYZEvent method, I occassionaly need to call control A's OnXYZEvent rather than control B's (as control B's does something I may not want it to do) - ie: OnXYZ() {   // do some stuff   if (_)   {     //B.OnXYZ()     base.OnXYZ();   }   else   {     //A.OnXYZ()     ???   } } Is this at all possible? "I think I speak on behalf of everyone here when I say huh?" - Buffy

    L 1 Reply Last reply
    0
    • M Mathew Hall

      I have a control C that extends control B that extends control A. In control C's OnXYZEvent method, I occassionaly need to call control A's OnXYZEvent rather than control B's (as control B's does something I may not want it to do) - ie: OnXYZ() {   // do some stuff   if (_)   {     //B.OnXYZ()     base.OnXYZ();   }   else   {     //A.OnXYZ()     ???   } } Is this at all possible? "I think I speak on behalf of everyone here when I say huh?" - Buffy

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      You make another derived class! :) top secret xacc-ide 0.0.1

      M 1 Reply Last reply
      0
      • L leppie

        You make another derived class! :) top secret xacc-ide 0.0.1

        M Offline
        M Offline
        Mathew Hall
        wrote on last edited by
        #3

        Thats what I thought, and its so not what I wanted to do :( "I think I speak on behalf of everyone here when I say huh?" - Buffy

        L 1 Reply Last reply
        0
        • M Mathew Hall

          Thats what I thought, and its so not what I wanted to do :( "I think I speak on behalf of everyone here when I say huh?" - Buffy

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          But in the long run it will prove better, now it mite just be one method, but later it could be several, and then the seperation of logic makes alot more sense, especially if you have to debug the app several months later. top secret xacc-ide 0.0.1

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups