This documentation is archived and is not being maintained.
ContextUtil Class
Visual Studio 2010
Obtains information about the COM+ object context. This class cannot be inherited.
Assembly: System.EnterpriseServices (in System.EnterpriseServices.dll)
The ContextUtil type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | ActivityId | Gets a GUID representing the activity containing the component. |
![]() ![]() | ApplicationId | Gets a GUID for the current application. |
![]() ![]() | ApplicationInstanceId | Gets a GUID for the current application instance. |
![]() ![]() | ContextId | Gets a GUID for the current context. |
![]() ![]() | DeactivateOnReturn | Gets or sets the done bit in the COM+ context. |
![]() ![]() | IsInTransaction | Gets a value that indicates whether the current context is transactional. |
![]() ![]() | IsSecurityEnabled | Gets a value that indicates whether role-based security is active in the current context. |
![]() ![]() | MyTransactionVote | Gets or sets the consistent bit in the COM+ context. |
![]() ![]() | PartitionId | Gets a GUID for the current partition. |
![]() ![]() | SystemTransaction | Gets the current transaction context. |
![]() ![]() | Transaction | Gets an object describing the current COM+ DTC transaction. |
![]() ![]() | TransactionId | Gets the GUID of the current COM+ DTC transaction. |
| Name | Description | |
|---|---|---|
![]() ![]() | DisableCommit | Sets both the consistent bit and the done bit to false in the COM+ context. |
![]() ![]() | EnableCommit | Sets the consistent bit to true and the done bit to false in the COM+ context. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() | GetNamedProperty | Returns a named property from the COM+ context. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | IsCallerInRole | Determines whether the caller is in the specified role. |
![]() ![]() | IsDefaultContext | Determines whether the serviced component is activated in the default context. Serviced components that do not have COM+ catalog information are activated in the default context. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | SetAbort | Sets the consistent bit to false and the done bit to true in the COM+ context. |
![]() ![]() | SetComplete | Sets the consistent bit and the done bit to true in the COM+ context. |
![]() ![]() | SetNamedProperty | Sets the named property for the COM+ context. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The following code example demonstrates how to use ContextUtil to create a transactional ServicedComponent.
[assembly:System::Reflection::AssemblyKeyFile("Transaction.snk")]; [Transaction] public ref class TransactionalComponent: public ServicedComponent { public: void TransactionalMethod( String^ data ) { ContextUtil::DeactivateOnReturn = true; ContextUtil::MyTransactionVote = TransactionVote::Abort; // do work with data ContextUtil::MyTransactionVote = TransactionVote::Commit; } };
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
