This documentation is archived and is not being maintained.

CodeActivity Class

Runs the code-beside method associated with an activity. This class cannot be inherited.

Namespace: System.Workflow.Activities
Assembly: System.Workflow.Activities (in system.workflow.activities.dll)

public sealed class CodeActivity : Activity
public final class CodeActivity extends Activity
public final class CodeActivity extends Activity
Not applicable.

Code-beside methods invoked by CodeActivity are executed in a synchronous manner; CodeActivity does not yield its thread until the thread is finished. Therefore, the execution of the code-beside method is expected to be performed and should not block with a dependency on some external resource. For example, the code-beside method should typically not invoke a Web service.

The typical use of the CodeActivity is to examine workflow instance state, and change local variables and messages.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0