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. Ignore Warning like in C++

Ignore Warning like in C++

Scheduled Pinned Locked Moved C#
c++phpdatabasecomhelp
6 Posts 4 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.
  • R Offline
    R Offline
    Roland Bar
    wrote on last edited by
    #1

    Hi, is there a wax to tell the compiler to ignore a warning for a region of code, like it is possible in C++ like this: #pragma warning( disable : 4705 ) ... // Some Code #pragma warning( default : 4705 ) Thanks for Help Greets Roland


    Hi! I'm a signature virus. Copy me into your sig file and help me spread!

    Follow your Euro notes in their tracks

    L 1 Reply Last reply
    0
    • R Roland Bar

      Hi, is there a wax to tell the compiler to ignore a warning for a region of code, like it is possible in C++ like this: #pragma warning( disable : 4705 ) ... // Some Code #pragma warning( default : 4705 ) Thanks for Help Greets Roland


      Hi! I'm a signature virus. Copy me into your sig file and help me spread!

      Follow your Euro notes in their tracks

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

      See this article on MSDN #pragma warning disable 4705 and #pragma warning restore 4705 Gruß

      R 1 Reply Last reply
      0
      • L Lost User

        See this article on MSDN #pragma warning disable 4705 and #pragma warning restore 4705 Gruß

        R Offline
        R Offline
        Roland Bar
        wrote on last edited by
        #3

        Thank, but it looks like it is a feature added in .net 2.0. is there a way to do the same in .net 1.1 as i am stuck to it for this project... :( Greets Roland


        Hi! I'm a signature virus. Copy me into your sig file and help me spread!

        Follow your Euro notes in their tracks

        G 1 Reply Last reply
        0
        • R Roland Bar

          Thank, but it looks like it is a feature added in .net 2.0. is there a way to do the same in .net 1.1 as i am stuck to it for this project... :( Greets Roland


          Hi! I'm a signature virus. Copy me into your sig file and help me spread!

          Follow your Euro notes in their tracks

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          What is the warning that you are trying to ignore?

          --- Year happy = new Year(2007);

          R 1 Reply Last reply
          0
          • G Guffa

            What is the warning that you are trying to ignore?

            --- Year happy = new Year(2007);

            R Offline
            R Offline
            Roland Bar
            wrote on last edited by
            #5

            The Warning CS0067: The event 'event' is never used. It is caused by a class dummy created for a test that implements an interface that contains this events. As some events are not relevant for the test they are not used. I can live with it but it would be nicer to have a 'clean' build. Greets Roland


            Hi! I'm a signature virus. Copy me into your sig file and help me spread!

            Follow your Euro notes in their tracks

            S 1 Reply Last reply
            0
            • R Roland Bar

              The Warning CS0067: The event 'event' is never used. It is caused by a class dummy created for a test that implements an interface that contains this events. As some events are not relevant for the test they are not used. I can live with it but it would be nicer to have a 'clean' build. Greets Roland


              Hi! I'm a signature virus. Copy me into your sig file and help me spread!

              Follow your Euro notes in their tracks

              S Offline
              S Offline
              Stefan Troschuetz
              wrote on last edited by
              #6

              You can write a protected or private OnEvent method. Its not that much code and should be done quickly even for some events by copy-and-paste. Furthermore, the methods may be useful, if you later on add more intelligence to the dummy or implement the final class.

              private void OnEvent(EventArgs e)
              {
              if (this.Event!= null)
              this.Event(this, e);
              }


              "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

              www.troschuetz.de

              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