none
Using CodeActivityContext.GetProperty<THandle> / Subclassing System.Activities.Handle

    Question

  • A few related questions:

    1. Why does CodeActivityContext.GetProperty only allow you to get properties derived from System.Activities.Handle?
    2. If I want to access a custom execution property inside a CodeActivity, can I do so if it isn't derived from System.Activities.Handle?
    3. What do I need to do to implement a subclass of System.Activities.Handle?
    4. Why isn't there anything useful inside HandleInitializationContext? (I notice, using IL Disassembler, that it does have some useful properties, but they don't seem to be documented, or visible in the Object Browser.)
    Answers to any of these questions would be much appreciated.

    Monday, August 02, 2010 12:34 PM

Answers

All replies

  • Hi Zhen Lin,

    1) because CodeActivity can't be used to Schedule others activity

    2) no you can't because CodeActivity can't be used to Schedule others activity

    ...

    Use a nativeActivity and you'll find yourself answer to your others questions ;)


    Jérémy Jeanson MCP, MCTS http://blogs.codes-sources.com/JeremyJeanson/ (French or English spoken)
    Tuesday, August 03, 2010 7:59 AM
  • I know how to access and add execution properties from a NativeActivity. I don't see why CodeActivity shouldn't be able access execution properties added by a parent activity, and I don't see how NativeActivity has anything to do with creating subclasses of Handle.

    Tuesday, August 03, 2010 8:06 AM
  • Hi,

    Execution properties have to be schedule but CodeActivity can't schedule nothing :(

    that's why


    Jérémy Jeanson MCP, MCTS http://blogs.codes-sources.com/JeremyJeanson/ (French or English spoken)
    Tuesday, August 03, 2010 8:10 AM
  • Why would they need to be scheduled if they were added by something else? The particular execution property I want to access isn't even an IExecutionProperty (confusing names, huh?). I'm just trying to read some information stored inside something added by a parent.
    Tuesday, August 03, 2010 8:12 AM
  • I understand your suprise.

    As i understand, Execution property are attached to activity as Activity (at run time). Not as the type they are.

    If your property is an InArgument<T>, it will be something as an Activity<InArgument<T>>.

    And to use the property, your codeactivity have to execute the property (schedule the activity). But it can't because it's a codeactivity :(

    that was an hard mind to explain, i think this is the easy way to...


    Jérémy Jeanson MCP, MCTS http://blogs.codes-sources.com/JeremyJeanson/ (French or English spoken)
    Tuesday, August 03, 2010 8:28 AM
  • Hi all,

    I was looking for a better explain but i foudn none :(

    And the context in a codeactivity ahven't the colelction Properties. i think we will have no way to pass away.


    Jérémy Jeanson MCP, MCTS http://blogs.codes-sources.com/JeremyJeanson/ (French or English spoken)
    Thursday, August 05, 2010 9:11 AM
  • Hi, Zhen Lin

    There are two articles would answer most part of your question:
    http://blogs.msdn.com/b/flow/archive/2010/01/24/lights-camera-activities-windows-workflow-foundation-s-activity-model.aspx
    http://blogs.msdn.com/b/flow/archive/2010/01/31/workflow-foundation-4-0-activity-model-ii.aspx

    Regards


    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com
    Monday, August 09, 2010 7:50 AM
    Moderator