Show / Hide Table of Contents

    Class EventContext

    Inheritance
    System.Object
    EventContext
    PluginEventContext2
    WorkflowEventContext
    Implements
    IEventContext
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Hsl.Xrm.Sdk.Plugin
    Assembly: Hsl.Xrm.Sdk.Plugin.dll
    Syntax
    public abstract class EventContext : IEventContext

    Constructors

    EventContext()

    Declaration
    public EventContext()

    Properties

    ActionTypeName

    Declaration
    public string ActionTypeName { get; protected set; }
    Property Value
    Type Description
    System.String

    ExecutionContext

    Gets the execution context for the event execution instance.

    Declaration
    public IExecutionContext ExecutionContext { get; }
    Property Value
    Type Description
    Microsoft.Xrm.Sdk.IExecutionContext

    InitiatingUserOrgService

    Gets an organization service using the initiating user's context.

    Declaration
    protected IOrganizationService InitiatingUserOrgService { get; }
    Property Value
    Type Description
    Microsoft.Xrm.Sdk.IOrganizationService

    IsExecutingAsynchronously

    Indicates if executing asynchronously.

    Declaration
    public bool IsExecutingAsynchronously { get; }
    Property Value
    Type Description
    System.Boolean

    IsExecutingInSandbox

    Indicates if executing in Sandbox isolation mode.

    Declaration
    public bool IsExecutingInSandbox { get; }
    Property Value
    Type Description
    System.Boolean

    IsExecutingSynchronously

    Indicates if executing synchronously.

    Declaration
    public bool IsExecutingSynchronously { get; }
    Property Value
    Type Description
    System.Boolean

    SystemOrgService

    Gets an organization service using the system user's context.

    Declaration
    protected IOrganizationService SystemOrgService { get; }
    Property Value
    Type Description
    Microsoft.Xrm.Sdk.IOrganizationService

    TracingService

    Gets the Tracing service from the plugin context.

    Declaration
    public ITracingService TracingService { get; }
    Property Value
    Type Description
    Microsoft.Xrm.Sdk.ITracingService

    UserOrgService

    Gets an organization service using the user's context.

    Declaration
    protected IOrganizationService UserOrgService { get; }
    Property Value
    Type Description
    Microsoft.Xrm.Sdk.IOrganizationService

    XrmContext

    Declaration
    public IXrmContext XrmContext { get; protected set; }
    Property Value
    Type Description
    IXrmContext

    Methods

    Assert(Boolean, String, Object[])

    Asserts the specified condition by throwing an InvalidPluginExecutionException if the condition is false.

    Declaration
    public void Assert(bool condition, string message, params object[] args)
    Parameters
    Type Name Description
    System.Boolean condition

    The condition to assert.

    System.String message

    The message for the exception.

    System.Object[] args

    Arguments used for substituion into the placeholders contained in the message.

    BuildInnerException(Exception)

    Declaration
    public Exception BuildInnerException(Exception ex)
    Parameters
    Type Name Description
    System.Exception ex
    Returns
    Type Description
    System.Exception

    CanSendException(Exception)

    Whether the Exception can be sent/deserialized.

    Declaration
    public bool CanSendException(Exception ex)
    Parameters
    Type Name Description
    System.Exception ex
    Returns
    Type Description
    System.Boolean

    GetExecutionContext()

    Declaration
    protected abstract IExecutionContext GetExecutionContext()
    Returns
    Type Description
    Microsoft.Xrm.Sdk.IExecutionContext

    GetOrganizationServiceFactory()

    Declaration
    protected abstract IOrganizationServiceFactory GetOrganizationServiceFactory()
    Returns
    Type Description
    Microsoft.Xrm.Sdk.IOrganizationServiceFactory

    GetOrgService(Nullable<Guid>)

    Gets an organization service using the specified user.

    Declaration
    public IOrganizationService GetOrgService(Guid? userId)
    Parameters
    Type Name Description
    System.Nullable<System.Guid> userId

    Specifies the user context for the OrganizationService that is retrieved. A null value indicates the SYSTEM user. A Guid.Empty value indicates the same user a IExecutionContext.UserId Any other value indicates a specific user.

    Returns
    Type Description
    Microsoft.Xrm.Sdk.IOrganizationService

    GetParentContext(IExecutionContext)

    Declaration
    protected abstract IExecutionContext GetParentContext(IExecutionContext ctx)
    Parameters
    Type Name Description
    Microsoft.Xrm.Sdk.IExecutionContext ctx
    Returns
    Type Description
    Microsoft.Xrm.Sdk.IExecutionContext

    GetTracingService()

    Declaration
    protected abstract ITracingService GetTracingService()
    Returns
    Type Description
    Microsoft.Xrm.Sdk.ITracingService

    Throw(String, Exception, Object[])

    Throws an InvalidPluginExecutionException with the specified message and inner exception.

    Declaration
    public void Throw(string message, Exception inner, params object[] args)
    Parameters
    Type Name Description
    System.String message

    The message for the exception.

    System.Exception inner

    The inner exception.

    System.Object[] args

    Arguments used for substitution into the placeholders contains in the message.

    Trace(String, Object[])

    Traces data to the tracing service if it is available.

    Declaration
    public virtual void Trace(string message, params object[] args)
    Parameters
    Type Name Description
    System.String message
    System.Object[] args

    TraceException(String, Exception, Object[])

    Traces an Exception with the specified message.

    Declaration
    public void TraceException(string message, Exception ex, params object[] args)
    Parameters
    Type Name Description
    System.String message

    The message for the exception.

    System.Exception ex

    The exception.

    System.Object[] args

    Arguments used for substitution into the placeholders contains in the message.

    Implements

    IEventContext
    Back to top Hsl.Xrm.Sdk