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. inherit NativWindow and IDisposable

inherit NativWindow and IDisposable

Scheduled Pinned Locked Moved C#
csharphelpquestion
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.
  • _ Offline
    _ Offline
    __John_
    wrote on last edited by
    #1

    I have a class that inherits NativWindow, I would like the same class to also implement IDisposable. The problem is that C# wont let me inherit NativWindow and IDisposable (multiple inheratence). So, is it posible? Or is there some reason why I should not even be trying to do this? Thanks.

    “If I had asked people what they wanted, they would have said faster horses.” ― Henry Ford

    L 1 Reply Last reply
    0
    • _ __John_

      I have a class that inherits NativWindow, I would like the same class to also implement IDisposable. The problem is that C# wont let me inherit NativWindow and IDisposable (multiple inheratence). So, is it posible? Or is there some reason why I should not even be trying to do this? Thanks.

      “If I had asked people what they wanted, they would have said faster horses.” ― Henry Ford

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      __John_ wrote:

      The problem is that C# wont let me inherit NativWindow and IDisposable (multiple inheratence).

      No, it doesn't. You're allowed to inherit from one base class, and you can implement multiple interfaces. If you wrapped your IDisposable in a class, then you should read up on creating a composition. Good luck.

      Bastard Programmer from Hell :suss:

      _ 1 Reply Last reply
      0
      • L Lost User

        __John_ wrote:

        The problem is that C# wont let me inherit NativWindow and IDisposable (multiple inheratence).

        No, it doesn't. You're allowed to inherit from one base class, and you can implement multiple interfaces. If you wrapped your IDisposable in a class, then you should read up on creating a composition. Good luck.

        Bastard Programmer from Hell :suss:

        _ Offline
        _ Offline
        __John_
        wrote on last edited by
        #3

        Thanks Eddy.

        “If I had asked people what they wanted, they would have said faster horses.” ― Henry Ford

        L 1 Reply Last reply
        0
        • _ __John_

          Thanks Eddy.

          “If I had asked people what they wanted, they would have said faster horses.” ― Henry Ford

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You're welcome :)

          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