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. Event/Delegate for progress bar issue

Event/Delegate for progress bar issue

Scheduled Pinned Locked Moved C#
helpvisual-studiowpfcomannouncement
19 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.
  • M MichCl

    Can CR5 inherit from both iCR and iCRComm?

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

    Yes; although I don't see why one wouldn't simply modify the original interface to include the new method. Remember that the factory is there for a good reason.

    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

    M 1 Reply Last reply
    0
    • L Lost User

      Yes; although I don't see why one wouldn't simply modify the original interface to include the new method. Remember that the factory is there for a good reason.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      M Offline
      M Offline
      MichCl
      wrote on last edited by
      #11

      Yes, but I have two factories. One for CR5 interface and one for CRComm interface. It may not be obvious from what I posted, but they have very different uses. Generic needs to use CR5 for writes. CR5Comm is used all over the place and definitely isn't the same/can't be condensed into one with CR5. You're changing the use of everything too much for it to be helpful. Maybe we need to go back to the original VS project definitions of everything? I know it's difficult, but it's like that for a reason. Even where you put the delegate doesn't translate to anywhere in my code.

      L 1 Reply Last reply
      0
      • M MichCl

        Yes, but I have two factories. One for CR5 interface and one for CRComm interface. It may not be obvious from what I posted, but they have very different uses. Generic needs to use CR5 for writes. CR5Comm is used all over the place and definitely isn't the same/can't be condensed into one with CR5. You're changing the use of everything too much for it to be helpful. Maybe we need to go back to the original VS project definitions of everything? I know it's difficult, but it's like that for a reason. Even where you put the delegate doesn't translate to anywhere in my code.

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

        MichCl wrote:

        It may not be obvious from what I posted, but they have very different uses.

        I'd expect anything out that factory to behave similar; otherwise you'd be checking whether you're working on a CR5 or a CR6 everywhere in code, making things even more complicated.

        MichCl wrote:

        Even where you put the delegate doesn't translate to anywhere in my code.

        As far as the compiler is concerned, it's located in "some" namespace. As long as it's referenced, it can be used.

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        M 1 Reply Last reply
        0
        • L Lost User

          MichCl wrote:

          It may not be obvious from what I posted, but they have very different uses.

          I'd expect anything out that factory to behave similar; otherwise you'd be checking whether you're working on a CR5 or a CR6 everywhere in code, making things even more complicated.

          MichCl wrote:

          Even where you put the delegate doesn't translate to anywhere in my code.

          As far as the compiler is concerned, it's located in "some" namespace. As long as it's referenced, it can be used.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          M Offline
          M Offline
          MichCl
          wrote on last edited by
          #13

          Like I said. There are two different factories. One for comm, one for crx. I get two different things from them. The fact that I don't have a check for CR5 or CR6, is because my cr factory returns an instance of iCR that is an instance of either cr5 or cr6. When I make a call from my instance of icr that is returned, it will automatically go to the implementation of cr5 or cr6, whichever I instantiated in the factory. I realize the compiler doesn't care about the delegate location and usage, but I do. The structure/fix that you are suggesting doesn't translate even slightly to my code, which is in separate vs projects. I can't put my delegate where you have it, so it's not a fix for my problem. Thanks for the help!

          L 1 Reply Last reply
          0
          • M MichCl

            Like I said. There are two different factories. One for comm, one for crx. I get two different things from them. The fact that I don't have a check for CR5 or CR6, is because my cr factory returns an instance of iCR that is an instance of either cr5 or cr6. When I make a call from my instance of icr that is returned, it will automatically go to the implementation of cr5 or cr6, whichever I instantiated in the factory. I realize the compiler doesn't care about the delegate location and usage, but I do. The structure/fix that you are suggesting doesn't translate even slightly to my code, which is in separate vs projects. I can't put my delegate where you have it, so it's not a fix for my problem. Thanks for the help!

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

            MichCl wrote:

            The structure/fix that you are suggesting doesn't translate even slightly to my code, which is in separate vs projects.

            Aight, can you add in the project names in the original post? Make 'em fake ones if required :)

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            M 2 Replies Last reply
            0
            • L Lost User

              MichCl wrote:

              The structure/fix that you are suggesting doesn't translate even slightly to my code, which is in separate vs projects.

              Aight, can you add in the project names in the original post? Make 'em fake ones if required :)

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              M Offline
              M Offline
              MichCl
              wrote on last edited by
              #15

              Thanks! I updated the original post with vs project names.

              1 Reply Last reply
              0
              • L Lost User

                MichCl wrote:

                The structure/fix that you are suggesting doesn't translate even slightly to my code, which is in separate vs projects.

                Aight, can you add in the project names in the original post? Make 'em fake ones if required :)

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                M Offline
                M Offline
                MichCl
                wrote on last edited by
                #16

                Did you see the changes I made to the original post?

                L 1 Reply Last reply
                0
                • M MichCl

                  Did you see the changes I made to the original post?

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

                  I did, but I won't be able to work on it until I am home :)

                  M 1 Reply Last reply
                  0
                  • L Lost User

                    I did, but I won't be able to work on it until I am home :)

                    M Offline
                    M Offline
                    MichCl
                    wrote on last edited by
                    #18

                    Guess what???! I cleaned all of my classes, detached and re-attached references, and it's working now. I guess I had the delegates/events and the interfaces set up correctly after all!!!! I was stepping through and noticed an exception was being thrown so I wasn't getting to my event setup (+/-), so that's why it was null and missing updating the progressBar. :) Thanks for the help!!

                    L 1 Reply Last reply
                    0
                    • M MichCl

                      Guess what???! I cleaned all of my classes, detached and re-attached references, and it's working now. I guess I had the delegates/events and the interfaces set up correctly after all!!!! I was stepping through and noticed an exception was being thrown so I wasn't getting to my event setup (+/-), so that's why it was null and missing updating the progressBar. :) Thanks for the help!!

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

                      MichCl wrote:

                      Guess what???! I cleaned all of my classes, detached and re-attached references, and it's working now.

                      Cool!

                      MichCl wrote:

                      Thanks for the help!!

                      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