Action keyword question
-
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 .
Please don't cross post. You have already asked that question here: http://www.codeproject.com/Questions/136500/Action-keyword-question.aspx.
-
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 .
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.”
-
Please don't cross post. You have already asked that question here: http://www.codeproject.com/Questions/136500/Action-keyword-question.aspx.
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.”
-
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 .
-
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.”
Snap as in crackle and pop, :confused:
-
Great! After I went through all the trouble editing your question you decide to delete it. Isn't life a bummer!
-
Snap as in crackle and pop, :confused:
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.”
-
Please don't cross post. You have already asked that question here: http://www.codeproject.com/Questions/136500/Action-keyword-question.aspx.
-
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.”
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". :)
-
Great! After I went through all the trouble editing your question you decide to delete it. Isn't life a bummer!
-
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 .
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