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. Switch between two properties [modified]

Switch between two properties [modified]

Scheduled Pinned Locked Moved C#
9 Posts 5 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.
  • D Offline
    D Offline
    daniel99
    wrote on last edited by
    #1

    Have anyone an idea how can switch between two properties(Resources.resx, Settings.settings) :confused:

    C M 2 Replies Last reply
    0
    • D daniel99

      Have anyone an idea how can switch between two properties(Resources.resx, Settings.settings) :confused:

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I don't even know what this means ? Do you want to swap their values ? You need a third variable. int a = 1; int b = 2; // swap int c = a; a = b; b = c;

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      D 1 Reply Last reply
      0
      • C Christian Graus

        I don't even know what this means ? Do you want to swap their values ? You need a third variable. int a = 1; int b = 2; // swap int c = a; a = b; b = c;

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        D Offline
        D Offline
        daniel99
        wrote on last edited by
        #3

        I want to build two programs with the same code but different designs.

        P C 2 Replies Last reply
        0
        • D daniel99

          I want to build two programs with the same code but different designs.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Eh? That makes no sense whatsoever. If you have the same code, it's the same program - you can't have a different design.

          the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
          Deja View - the feeling that you've seen this post before.

          1 Reply Last reply
          0
          • D daniel99

            I want to build two programs with the same code but different designs.

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            You want to reuse code ? Put the code you want to reuse in a dll. By the way, nothing you're saying is making sense, I am making guesses. Try to explain what you want in more detail, please.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            D 1 Reply Last reply
            0
            • C Christian Graus

              You want to reuse code ? Put the code you want to reuse in a dll. By the way, nothing you're saying is making sense, I am making guesses. Try to explain what you want in more detail, please.

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              D Offline
              D Offline
              daniel99
              wrote on last edited by
              #6

              For each design I build on code.

              P J 2 Replies Last reply
              0
              • D daniel99

                For each design I build on code.

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                daniel99 wrote:

                For each design I build on code.

                So do we all, but this doesn't tell us anything that you are trying to do. What problem are you trying to solve?

                the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
                Deja View - the feeling that you've seen this post before.

                1 Reply Last reply
                0
                • D daniel99

                  Have anyone an idea how can switch between two properties(Resources.resx, Settings.settings) :confused:

                  M Offline
                  M Offline
                  Martin 0
                  wrote on last edited by
                  #8

                  Hello Daniel, Like the others, I'm not really sure if I understand you write, but I try to explain what you can do with a "#define". (I'm using VisualStudio) You can enable/disable a region during design time. In your case:

                  #define PropertyStyle

                  #if PropertyStyle
                  public bool GetSomething
                  {
                  get
                  {
                  return somestuffreturningbool_1();
                  }
                  }
                  #else
                  public bool GetSomething
                  {
                  get
                  {
                  return somestuffreturningbool_2();
                  }
                  }
                  #endif

                  If you compile it that way, you get the return value from somestuffreturningbool_1. Or: //#define PropertyStyle ... same code If you compile it that way, you get the return value from somestuffreturningbool_2. Hope it helps! All the best, Martin

                  1 Reply Last reply
                  0
                  • D daniel99

                    For each design I build on code.

                    J Offline
                    J Offline
                    Judah Gabriel Himango
                    wrote on last edited by
                    #9

                    daniel99 wrote:

                    For each design I build on code.

                    :cracks a smile:

                    Tech, life, family, faith: Give me a visit. I'm currently blogging about: 4 Exorcism Psalms from the Dead Sea Scrolls The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

                    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