| | 1 | | using Microsoft.Xrm.Sdk; |
| | 2 | | using System; |
| | 3 | | using System.Runtime.Serialization; |
| | 4 | |
|
| | 5 | | namespace FakeXrmEasy |
| | 6 | | { |
| | 7 | | /// <summary> |
| | 8 | | /// Holds custom properties of a IPluginExecutionContext |
| | 9 | | /// Extracted from https://msdn.microsoft.com/es-es/library/microsoft.xrm.sdk.ipluginexecutioncontext_properties.asp |
| | 10 | | /// </summary> |
| | 11 | | [DataContract(Name = "PluginExecutionContext", Namespace = "")] |
| | 12 | | public class XrmFakedPluginExecutionContext : IPluginExecutionContext |
| | 13 | | { |
| | 14 | | [DataMember(Order = 1)] |
| 253 | 15 | | public Guid BusinessUnitId { get; set; } |
| | 16 | |
|
| | 17 | | [DataMember(Order = 2)] |
| 24 | 18 | | public Guid CorrelationId { get; set; } |
| | 19 | |
|
| | 20 | | [DataMember(Order = 3)] |
| 512 | 21 | | public int Depth { get; set; } |
| | 22 | |
|
| | 23 | | [DataMember(Order = 4)] |
| 307 | 24 | | public Guid InitiatingUserId { get; set; } |
| | 25 | |
|
| | 26 | | [DataMember(Order = 5)] |
| 1553 | 27 | | public ParameterCollection InputParameters { get; set; } |
| | 28 | |
|
| | 29 | | [DataMember(Order = 6)] |
| 500 | 30 | | public bool IsExecutingOffline { get; set; } |
| | 31 | |
|
| | 32 | | [DataMember(Order = 7)] |
| | 33 | | public bool IsInTransaction |
| | 34 | | { |
| | 35 | | get |
| 0 | 36 | | { |
| 0 | 37 | | return Stage == (int)ProcessingStepStage.Preoperation || Stage == (int)ProcessingStepStage.Postoperation |
| 0 | 38 | | } |
| 48 | 39 | | set { /* This property is writable only to correctly support serialization/deserialization */ } |
| | 40 | | } |
| | 41 | |
|
| | 42 | | [DataMember(Order = 8)] |
| 24 | 43 | | public bool IsOfflinePlayback { get; set; } |
| | 44 | |
|
| | 45 | | [DataMember(Order = 9)] |
| 500 | 46 | | public int IsolationMode { get; set; } |
| | 47 | |
|
| | 48 | | [DataMember(Order = 10)] |
| 758 | 49 | | public string MessageName { get; set; } |
| | 50 | |
|
| | 51 | | [DataMember(Order = 11)] |
| 150 | 52 | | public int Mode { get; set; } |
| | 53 | |
|
| | 54 | | [DataMember(Order = 12)] |
| 24 | 55 | | public DateTime OperationCreatedOn { get; set; } |
| | 56 | |
|
| | 57 | | [DataMember(Order = 13)] |
| 24 | 58 | | public Guid OperationId { get; set; } |
| | 59 | |
|
| | 60 | | [DataMember(Order = 14)] |
| 24 | 61 | | public Guid OrganizationId { get; set; } |
| | 62 | |
|
| | 63 | | [DataMember(Order = 15)] |
| 36 | 64 | | public string OrganizationName { get; set; } |
| | 65 | |
|
| | 66 | | [DataMember(Order = 16)] |
| 393 | 67 | | public ParameterCollection OutputParameters { get; set; } |
| | 68 | |
|
| | 69 | | [DataMember(Order = 17)] |
| 24 | 70 | | public EntityReference OwningExtension { get; set; } |
| | 71 | |
|
| | 72 | | [DataMember(Order = 18)] |
| 367 | 73 | | public EntityImageCollection PostEntityImages { get; set; } |
| | 74 | |
|
| | 75 | | [DataMember(Order = 19)] |
| 367 | 76 | | public EntityImageCollection PreEntityImages { get; set; } |
| | 77 | |
|
| | 78 | | [DataMember(Order = 20)] |
| 24 | 79 | | public Guid PrimaryEntityId { get; set; } |
| | 80 | |
|
| | 81 | | [DataMember(Order = 21)] |
| 36 | 82 | | public string PrimaryEntityName { get; set; } |
| | 83 | |
|
| | 84 | | [DataMember(Order = 22)] |
| 24 | 85 | | public Guid? RequestId { get; set; } |
| | 86 | |
|
| | 87 | | [DataMember(Order = 23)] |
| 24 | 88 | | public string SecondaryEntityName { get; set; } |
| | 89 | |
|
| | 90 | | [DataMember(Order = 24)] |
| 265 | 91 | | public ParameterCollection SharedVariables { get; set; } |
| | 92 | |
|
| | 93 | | [DataMember(Order = 25)] |
| 429 | 94 | | public Guid UserId { get; set; } |
| | 95 | |
|
| | 96 | | [DataMember(Order = 26)] |
| 24 | 97 | | public IPluginExecutionContext ParentContext { get; set; } |
| | 98 | |
|
| | 99 | | [DataMember(Order = 27)] |
| 240 | 100 | | public int Stage { get; set; } |
| | 101 | |
|
| | 102 | | /// <summary> |
| | 103 | | /// Default constructor |
| | 104 | | /// </summary> |
| 247 | 105 | | public XrmFakedPluginExecutionContext() |
| 247 | 106 | | { |
| 247 | 107 | | Depth = 1; |
| 247 | 108 | | IsExecutingOffline = false; |
| 247 | 109 | | MessageName = "Create"; //Default value, |
| 247 | 110 | | IsolationMode = 1; |
| 247 | 111 | | } |
| | 112 | | } |
| | 113 | | } |