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. The Lounge
  3. Commenting in XAML is driving me nuts!!

Commenting in XAML is driving me nuts!!

Scheduled Pinned Locked Moved The Lounge
wpfcomxmlquestion
13 Posts 6 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.
  • P Paul Conrad

    Shog9 wrote:

    These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.

    :laugh::laugh::laugh: Where did you find that?

    "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

    S Offline
    S Offline
    Shog9 0
    wrote on last edited by
    #4

    Click the period. ;)

    ----

    You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.

    P P 2 Replies Last reply
    0
    • S Shog9 0

      chaiguy1337 wrote:

      Another reason XML was not the best choice to base a language on.

      It is what it is. Try commenting out the top half of a function in VB, see how well that works. At least XML has multi-line comments... XAML is still ugly as sin, but that's only partially the fault of XML.

      ----

      You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #5

      Shog9 wrote:

      These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.

      :laugh::laugh::laugh: Where did you find that?

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

      S 1 Reply Last reply
      0
      • S Shog9 0

        Click the period. ;)

        ----

        You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #6

        Ah, leave it to Pete to whip up a good one :)

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

        1 Reply Last reply
        0
        • C chaiguy1337

          You can't just comment out any particular line, you need to comment out a whole balanced block of tags. No commenting out just an attribute, nooo. For that you just gotta delete it and hope you remember you did. Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments! Another reason XML was not the best choice to base a language on. :mad:

          “Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’)            Built with home-grown CodeProject components! -”-”-

          A Offline
          A Offline
          Allen Anderson
          wrote on last edited by
          #7

          Yet another reason XAML is complete and utter garbage. I do a lot of programming and I still can't believe MS thinks this is a good idea. My favorite 'feature' of xaml though is how easy it is to do loops.............

          1 Reply Last reply
          0
          • S Shog9 0

            Click the period. ;)

            ----

            You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.

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

            Sweet. I didn't recognise it as one of mine. :-O You're right, and thank you for finally letting me hear this. :-D Ironically, when I saw your sig, I wished I'd been the one to say it.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            1 Reply Last reply
            0
            • C chaiguy1337

              You can't just comment out any particular line, you need to comment out a whole balanced block of tags. No commenting out just an attribute, nooo. For that you just gotta delete it and hope you remember you did. Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments! Another reason XML was not the best choice to base a language on. :mad:

              “Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’)            Built with home-grown CodeProject components! -”-”-

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

              chaiguy1337 wrote:

              Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments!

              You can't do this either in C# (or any other C based language), where the /* */ tags are used.

              chaiguy1337 wrote:

              You can't just comment out any particular line, you need to comment out a whole balanced block of tags.

              Hmmmm. Interesting. I'm following Karls lead and producing a PowerToy which contains features that I wish Cider had - I might just add this to the wishlist (if you don't mind).

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              C 2 Replies Last reply
              0
              • P Pete OHanlon

                chaiguy1337 wrote:

                Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments!

                You can't do this either in C# (or any other C based language), where the /* */ tags are used.

                chaiguy1337 wrote:

                You can't just comment out any particular line, you need to comment out a whole balanced block of tags.

                Hmmmm. Interesting. I'm following Karls lead and producing a PowerToy which contains features that I wish Cider had - I might just add this to the wishlist (if you don't mind).

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                C Offline
                C Offline
                chaiguy1337
                wrote on last edited by
                #10

                Pete O'Hanlon wrote:

                You can't do this either in C# (or any other C based language), where the /* */ tags are used.

                True, but C++/C# has // and VS has Ctrl+E Ctrl+C block commenting, which DOES support (and preserve) inner commented blocks.

                Pete O'Hanlon wrote:

                (if you don't mind)

                Be my guest, if you can figure out how to do it! (Let me know what you come up with.)

                “Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’)            Built with home-grown CodeProject components! -”-”-

                modified on Thursday, September 11, 2008 11:46 AM

                1 Reply Last reply
                0
                • P Pete OHanlon

                  chaiguy1337 wrote:

                  Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments!

                  You can't do this either in C# (or any other C based language), where the /* */ tags are used.

                  chaiguy1337 wrote:

                  You can't just comment out any particular line, you need to comment out a whole balanced block of tags.

                  Hmmmm. Interesting. I'm following Karls lead and producing a PowerToy which contains features that I wish Cider had - I might just add this to the wishlist (if you don't mind).

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  C Offline
                  C Offline
                  chaiguy1337
                  wrote on last edited by
                  #11

                  Hey Pete I came up with a way for your PowerToy to allow embedded comments in XAML, which is definitely something I would use. What you need to do is scan the block of text being commented for existing comments, and turn them into something non-commenty but that the tool can recognize later during an uncomment (and turn it back into a real comment). So the idea is if it's already commented, it won't matter that it's not legitimate xml, and only if the block is uncommented manually (without your tool) will it potentially pose an annoyance. In that case though it's probably better to have an error in the xml than to compile fine, because you don't want to inadvertently reinstate a piece of xaml that should otherwise remain commented-out. A secondary concern is to make it obvious an inner block is commented, perhaps by using visual obvious syntax like [/*[ comment ]*/] (something that's not likely to occur anywhere normally), or hey here's an even better idea: treat comments on a line-by-line basis like C#, then wrap any consecutive series of lines in a regular New Looks much better already don't you think! Now suppose you select the whole block and want to comment out the whole DockPanel. Well previously this would be impossible, but now I'm suggesting it should result in something like this:

                  P 1 Reply Last reply
                  0
                  • C chaiguy1337

                    Hey Pete I came up with a way for your PowerToy to allow embedded comments in XAML, which is definitely something I would use. What you need to do is scan the block of text being commented for existing comments, and turn them into something non-commenty but that the tool can recognize later during an uncomment (and turn it back into a real comment). So the idea is if it's already commented, it won't matter that it's not legitimate xml, and only if the block is uncommented manually (without your tool) will it potentially pose an annoyance. In that case though it's probably better to have an error in the xml than to compile fine, because you don't want to inadvertently reinstate a piece of xaml that should otherwise remain commented-out. A secondary concern is to make it obvious an inner block is commented, perhaps by using visual obvious syntax like [/*[ comment ]*/] (something that's not likely to occur anywhere normally), or hey here's an even better idea: treat comments on a line-by-line basis like C#, then wrap any consecutive series of lines in a regular New Looks much better already don't you think! Now suppose you select the whole block and want to comment out the whole DockPanel. Well previously this would be impossible, but now I'm suggesting it should result in something like this:

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

                    Good idea. It shouldn't be too hard (theoretically), and could be fairly easy to implement. But I certainly would want to implement something like this - it's something missing that should be there. I'll give the commenting out of the attributes some thought - there are a couple of ways that I can think of doing this, but they are hacks; nasty dirty hacks.

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    C 1 Reply Last reply
                    0
                    • P Pete OHanlon

                      Good idea. It shouldn't be too hard (theoretically), and could be fairly easy to implement. But I certainly would want to implement something like this - it's something missing that should be there. I'll give the commenting out of the attributes some thought - there are a couple of ways that I can think of doing this, but they are hacks; nasty dirty hacks.

                      Deja View - the feeling that you've seen this post before.

                      My blog | My articles

                      C Offline
                      C Offline
                      chaiguy1337
                      wrote on last edited by
                      #13

                      Lol yeah, I'm probably thinking some of the same things you are... like attached properties and "fake" attributes. ;) Anything is better than nothing though. Let me know if you come up with anything. Logan

                      “Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’)            Built with home-grown CodeProject components! -”-”-

                      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