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. Action keyword question

Action keyword question

Scheduled Pinned Locked Moved C#
questiontutoriallearning
12 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.
  • S SciGama

    Can anyone explain this line in plain english (I am learning). var userCallback = e.UserState as Action<bool> I understand how to call a typical invoke method on an action but how is e.UserState convertable to an Action<bool>? From what i have seen in object browser e.UserState is just calling a property. When i right click on the property and select get definition this is the property it is referring to. In this case UserState is from System.ComponentModel.AsyncCompletedEventArgs public object UserState { get; } Thanks for your time .

    H Offline
    H Offline
    Henry Minute
    wrote on last edited by
    #3

    Please do NOT post the same question in more than one forum. Very rude. Please delete this one.

    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

    1 Reply Last reply
    0
    • M Manfred Rudolf Bihy

      Please don't cross post. You have already asked that question here: http://www.codeproject.com/Questions/136500/Action-keyword-question.aspx.

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #4

      Snap!

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      M 1 Reply Last reply
      0
      • S SciGama

        Can anyone explain this line in plain english (I am learning). var userCallback = e.UserState as Action<bool> I understand how to call a typical invoke method on an action but how is e.UserState convertable to an Action<bool>? From what i have seen in object browser e.UserState is just calling a property. When i right click on the property and select get definition this is the property it is referring to. In this case UserState is from System.ComponentModel.AsyncCompletedEventArgs public object UserState { get; } Thanks for your time .

        S Offline
        S Offline
        SciGama
        wrote on last edited by
        #5

        ok i deleted it from ask a question section. so does anyone know the answer?

        M 1 Reply Last reply
        0
        • H Henry Minute

          Snap!

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          M Offline
          M Offline
          Manfred Rudolf Bihy
          wrote on last edited by
          #6

          Snap as in crackle and pop, :confused:

          H 1 Reply Last reply
          0
          • S SciGama

            ok i deleted it from ask a question section. so does anyone know the answer?

            M Offline
            M Offline
            Manfred Rudolf Bihy
            wrote on last edited by
            #7

            Great! After I went through all the trouble editing your question you decide to delete it. Isn't life a bummer!

            S 1 Reply Last reply
            0
            • M Manfred Rudolf Bihy

              Snap as in crackle and pop, :confused:

              H Offline
              H Offline
              Henry Minute
              wrote on last edited by
              #8

              Children's playing card game[^], used for teaching number recognition etc.. Both turn a card over at the same time and if both are the same e.g. a 9 then the first to call out 'Snap' wins all cards laid down so far. Winner is one who gets all cards or most in a given time. So 'Snap' is used when two people do the same thing at the same time.

              Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

              M 1 Reply Last reply
              0
              • M Manfred Rudolf Bihy

                Please don't cross post. You have already asked that question here: http://www.codeproject.com/Questions/136500/Action-keyword-question.aspx.

                S Offline
                S Offline
                SciGama
                wrote on last edited by
                #9

                I am just looking for a simple answer to the question:) thats all

                1 Reply Last reply
                0
                • H Henry Minute

                  Children's playing card game[^], used for teaching number recognition etc.. Both turn a card over at the same time and if both are the same e.g. a 9 then the first to call out 'Snap' wins all cards laid down so far. Winner is one who gets all cards or most in a given time. So 'Snap' is used when two people do the same thing at the same time.

                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                  M Offline
                  M Offline
                  Manfred Rudolf Bihy
                  wrote on last edited by
                  #10

                  Thanks for clearing that up for me. For me the association was more like when some fragile part in ones mind breaks and you "snap". :)

                  1 Reply Last reply
                  0
                  • M Manfred Rudolf Bihy

                    Great! After I went through all the trouble editing your question you decide to delete it. Isn't life a bummer!

                    S Offline
                    S Offline
                    SciGama
                    wrote on last edited by
                    #11

                    so i guess no one knows the answer..oh well

                    1 Reply Last reply
                    0
                    • S SciGama

                      Can anyone explain this line in plain english (I am learning). var userCallback = e.UserState as Action<bool> I understand how to call a typical invoke method on an action but how is e.UserState convertable to an Action<bool>? From what i have seen in object browser e.UserState is just calling a property. When i right click on the property and select get definition this is the property it is referring to. In this case UserState is from System.ComponentModel.AsyncCompletedEventArgs public object UserState { get; } Thanks for your time .

                      R Offline
                      R Offline
                      RaviRanjanKr
                      wrote on last edited by
                      #12

                      SciGama wrote:

                      var userCallback = e.UserState as Action<bool>

                      :confused: Your question is little bit confusing for me. whatever If a class supports multiple asynchronous methods, or multiple invocations of a single method then UserState property is used to determine which task raised the MethodNameCompleted event by checking the value of UserState property

                      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