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. Other Discussions
  3. The Weird and The Wonderful
  4. I don't know how to label this pattern.

I don't know how to label this pattern.

Scheduled Pinned Locked Moved The Weird and The Wonderful
comregextutorialquestion
4 Posts 3 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.
  • A Offline
    A Offline
    Andy Brummer
    wrote on last edited by
    #1

    I can't for the life of me figure out why someone would do this. It's not awful or subtly wrong, just kind of deranged. :doh:

            DocumentInformation ldocInfo = new DocumentInformation();
            ldocInfo.DocumentID = Convert.ToInt32(agmTemplateId);
            if (ldocInfo.DocumentID != 0)
            {
                section.Items.Add(PageHelpers.CreateSidebarItem("AGM plan", "/GetFile.aspx?DocumentId=" + ldocInfo.DocumentID, true, "cmdAGMTemplate", false));
            }
    
            ldocInfo.DocumentID = Convert.ToInt32(proposalTemplateId);
            if (ldocInfo.DocumentID != 0)
            {
                section.Items.Add(PageHelpers.CreateSidebarItem("Proposal", "/GetFile.aspx?DocumentId=" + ldocInfo.DocumentID, true, "cmdProposal", false));
            }
    

    Curvature of the Mind now with 3D

    B F 2 Replies Last reply
    0
    • A Andy Brummer

      I can't for the life of me figure out why someone would do this. It's not awful or subtly wrong, just kind of deranged. :doh:

              DocumentInformation ldocInfo = new DocumentInformation();
              ldocInfo.DocumentID = Convert.ToInt32(agmTemplateId);
              if (ldocInfo.DocumentID != 0)
              {
                  section.Items.Add(PageHelpers.CreateSidebarItem("AGM plan", "/GetFile.aspx?DocumentId=" + ldocInfo.DocumentID, true, "cmdAGMTemplate", false));
              }
      
              ldocInfo.DocumentID = Convert.ToInt32(proposalTemplateId);
              if (ldocInfo.DocumentID != 0)
              {
                  section.Items.Add(PageHelpers.CreateSidebarItem("Proposal", "/GetFile.aspx?DocumentId=" + ldocInfo.DocumentID, true, "cmdProposal", false));
              }
      

      Curvature of the Mind now with 3D

      B Offline
      B Offline
      Brisingr Aerowing
      wrote on last edited by
      #2

      What does the DocumentInformation class/struct look like?

      Keep Clam And Proofread -- √(-1) 23 ∑ π... And it was delicious.

      A 1 Reply Last reply
      0
      • B Brisingr Aerowing

        What does the DocumentInformation class/struct look like?

        Keep Clam And Proofread -- √(-1) 23 ∑ π... And it was delicious.

        A Offline
        A Offline
        Andy Brummer
        wrote on last edited by
        #3

        It's just a data object with about 10 other properties. None of the getters or setters have any hidden side effects. My guess is that they thought they were going to have to use the object to do some kind of data lookup, but didn't switch it to an integer when they didn't have to.

        Curvature of the Mind now with 3D

        1 Reply Last reply
        0
        • A Andy Brummer

          I can't for the life of me figure out why someone would do this. It's not awful or subtly wrong, just kind of deranged. :doh:

                  DocumentInformation ldocInfo = new DocumentInformation();
                  ldocInfo.DocumentID = Convert.ToInt32(agmTemplateId);
                  if (ldocInfo.DocumentID != 0)
                  {
                      section.Items.Add(PageHelpers.CreateSidebarItem("AGM plan", "/GetFile.aspx?DocumentId=" + ldocInfo.DocumentID, true, "cmdAGMTemplate", false));
                  }
          
                  ldocInfo.DocumentID = Convert.ToInt32(proposalTemplateId);
                  if (ldocInfo.DocumentID != 0)
                  {
                      section.Items.Add(PageHelpers.CreateSidebarItem("Proposal", "/GetFile.aspx?DocumentId=" + ldocInfo.DocumentID, true, "cmdProposal", false));
                  }
          

          Curvature of the Mind now with 3D

          F Offline
          F Offline
          Freak30
          wrote on last edited by
          #4

          I guess the author thought, that for some reason the variable name (DocumentID) must be the same as in the command string he assigns it to. Why someone would think that is beyond me.

          The good thing about pessimism is, that you are always either right or pleasently surprised.

          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