ATT.Customizer/ATT.Customizer/AttestationRun.cs
Decompiler Source FileATT.Customizer.AttestationRunDecompiled Source
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- ExtendedMethod registration: Cancel at line 262
- CallMethod: Abort at line 208
Typed Edges
- No typed edges extracted for this source.
References
- No direct source references extracted.
Referenced By
- No direct source references extracted.
C# source-derived context
Generated by pattern extraction from the decompiled C# source and decompile index. This is factual source evidence, not inferred behavior.
reads entity values references DB/Dialog objects
Summary: classes AttestationRun, _003C_003Ec__DisplayClass2_0; methods _003CCancel_OnSaving_003Eb__0, MoveNext, SetStateMachine, Cancel, Cancel_OnSaving; references AttestationCase, AttestationRun, Method_Attestation; markers reads entity values, references DB/Dialog objects
Classes
AttestationRun _003C_003Ec__DisplayClass2_0DB/Dialog object references
OIM key/entity markers
UID_AttestationRunAPI/entity calls
GetValueAsync GetValue From SourceRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.Runtime.CompilerServices;6using System.Runtime.InteropServices;7using System.Threading;8using System.Threading.Tasks;9using VI.DB;10using VI.DB.Entities;11using VI.DB.Sync;1213namespace ATT.Customizer;1415public class AttestationRun : StateBasedEntityLogic16{17 [CompilerGenerated]18 private sealed class _003C_003Ec__DisplayClass2_019 {20 public string uidAttestationRun;2122 internal ExpressionClause _003CCancel_OnSaving_003Eb__0(IExpressionContext c)23 {24 return c.Column("UID_AttestationRun") == uidAttestationRun;25 }26 }2728 [StructLayout((LayoutKind)3)]29 [CompilerGenerated]30 private struct _003CCancel_OnSaving_003Ed__2 : IAsyncStateMachine31 {32 public int _003C_003E1__state;3334 public AsyncTaskMethodBuilder _003C_003Et__builder;3536 public IEntity entity;3738 public CancellationToken ct;3940 private _003C_003Ec__DisplayClass2_0 _003C_003E8__1;4142 public LogicReadWriteParameters p;4344 public AttestationRun _003C_003E4__this;4546 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;4748 private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__2;4950 private System.IDisposable _003C_003E7__wrap1;5152 private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap2;5354 private IEntity _003CeCase_003E5__4;5556 private ConfiguredValueTaskAwaiter<bool> _003C_003Eu__3;5758 private ConfiguredTaskAwaiter _003C_003Eu__4;5960 private void MoveNext()61 {62 //IL_0092: Unknown result type (might be due to invalid IL or missing references)63 //IL_0097: Unknown result type (might be due to invalid IL or missing references)64 //IL_009f: Unknown result type (might be due to invalid IL or missing references)65 //IL_0146: Unknown result type (might be due to invalid IL or missing references)66 //IL_014b: Unknown result type (might be due to invalid IL or missing references)67 //IL_0153: Unknown result type (might be due to invalid IL or missing references)68 //IL_0045: Unknown result type (might be due to invalid IL or missing references)69 //IL_0054: Unknown result type (might be due to invalid IL or missing references)70 //IL_0059: Unknown result type (might be due to invalid IL or missing references)71 //IL_005d: Unknown result type (might be due to invalid IL or missing references)72 //IL_0062: Unknown result type (might be due to invalid IL or missing references)73 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)74 //IL_0108: Unknown result type (might be due to invalid IL or missing references)75 //IL_010d: Unknown result type (might be due to invalid IL or missing references)76 //IL_0111: Unknown result type (might be due to invalid IL or missing references)77 //IL_0116: Unknown result type (might be due to invalid IL or missing references)78 //IL_0077: Unknown result type (might be due to invalid IL or missing references)79 //IL_0079: Unknown result type (might be due to invalid IL or missing references)80 //IL_012b: Unknown result type (might be due to invalid IL or missing references)81 //IL_012d: Unknown result type (might be due to invalid IL or missing references)82 //IL_020e: Unknown result type (might be due to invalid IL or missing references)83 //IL_0213: Unknown result type (might be due to invalid IL or missing references)84 //IL_021b: Unknown result type (might be due to invalid IL or missing references)85 //IL_02d2: Unknown result type (might be due to invalid IL or missing references)86 //IL_02d7: Unknown result type (might be due to invalid IL or missing references)87 //IL_02df: Unknown result type (might be due to invalid IL or missing references)88 //IL_0289: Unknown result type (might be due to invalid IL or missing references)89 //IL_0294: Unknown result type (might be due to invalid IL or missing references)90 //IL_0299: Unknown result type (might be due to invalid IL or missing references)91 //IL_029d: Unknown result type (might be due to invalid IL or missing references)92 //IL_02a2: Unknown result type (might be due to invalid IL or missing references)93 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)94 //IL_01d0: Unknown result type (might be due to invalid IL or missing references)95 //IL_01d5: Unknown result type (might be due to invalid IL or missing references)96 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)97 //IL_01de: Unknown result type (might be due to invalid IL or missing references)98 //IL_02b7: Unknown result type (might be due to invalid IL or missing references)99 //IL_02b9: Unknown result type (might be due to invalid IL or missing references)100 //IL_01f3: Unknown result type (might be due to invalid IL or missing references)101 //IL_01f5: Unknown result type (might be due to invalid IL or missing references)102 int num = _003C_003E1__state;103 AttestationRun attestationRun = _003C_003E4__this;104 try105 {106 ConfiguredValueTaskAwaiter<string> val2;107 ConfiguredTaskAwaiter<IEntityCollection> val;108 IEntityCollection result = default(IEntityCollection);109 string result2;110 Query query;111 switch (num)112 {113 default:114 _003C_003E8__1 = new _003C_003Ec__DisplayClass2_0();115 val2 = entity.Columns["UID_AttestationRun"].GetValueAsync<string>(ct).ConfigureAwait(false).GetAwaiter();116 if (!val2.IsCompleted)117 {118 num = (_003C_003E1__state = 0);119 _003C_003Eu__1 = val2;120 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003CCancel_OnSaving_003Ed__2>(ref val2, ref this);121 return;122 }123 goto IL_00ae;124 case 0:125 val2 = _003C_003Eu__1;126 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);127 num = (_003C_003E1__state = -1);128 goto IL_00ae;129 case 1:130 val = _003C_003Eu__2;131 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntityCollection>);132 num = (_003C_003E1__state = -1);133 goto IL_0162;134 case 2:135 case 3:136 break;137 IL_0162:138 result = val.GetResult();139 _003C_003E7__wrap1 = attestationRun.StartInternalProcess();140 break;141 IL_00ae:142 result2 = val2.GetResult();143 _003C_003E8__1.uidAttestationRun = result2;144 query = (from c in Query.From("AttestationCase")145 where c.Column("UID_AttestationRun") == _003C_003E8__1.uidAttestationRun146 select c).SelectAll();147 val = p.Session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Bulk, ct).ConfigureAwait(false)148 .GetAwaiter();149 if (!val.IsCompleted)150 {151 num = (_003C_003E1__state = 1);152 _003C_003Eu__2 = val;153 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CCancel_OnSaving_003Ed__2>(ref val, ref this);154 return;155 }156 goto IL_0162;157 }158 try159 {160 if ((uint)(num - 2) > 1u)161 {162 _003C_003E7__wrap2 = ((System.Collections.Generic.IEnumerable<IEntity>)result).GetEnumerator();163 }164 try165 {166 ConfiguredTaskAwaiter val3;167 if (num != 2)168 {169 if (num != 3)170 {171 goto IL_02fc;172 }173 val3 = _003C_003Eu__4;174 _003C_003Eu__4 = default(ConfiguredTaskAwaiter);175 num = (_003C_003E1__state = -1);176 goto IL_02ee;177 }178 ConfiguredValueTaskAwaiter<bool> val4 = _003C_003Eu__3;179 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<bool>);180 num = (_003C_003E1__state = -1);181 goto IL_022a;182 IL_02ee:183 ((ConfiguredTaskAwaiter)(ref val3)).GetResult();184 _003CeCase_003E5__4 = null;185 goto IL_02fc;186 IL_02fc:187 if (((System.Collections.IEnumerator)_003C_003E7__wrap2).MoveNext())188 {189 _003CeCase_003E5__4 = _003C_003E7__wrap2.Current;190 val4 = _003CeCase_003E5__4.Columns["IsUnderConstruction"].GetValueAsync<bool>(ct).ConfigureAwait(false).GetAwaiter();191 if (!val4.IsCompleted)192 {193 num = (_003C_003E1__state = 2);194 _003C_003Eu__3 = val4;195 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<bool>, _003CCancel_OnSaving_003Ed__2>(ref val4, ref this);196 return;197 }198 goto IL_022a;199 }200 goto end_IL_018a;201 IL_022a:202 if (val4.GetResult())203 {204 _003CeCase_003E5__4.MarkForDeletion();205 }206 else if (!_003CeCase_003E5__4.Columns["IsClosed"].GetValue<bool>())207 {208 _003CeCase_003E5__4.CallMethod("Abort", "#LDS#Automatic system approval: The attestation run was canceled.", "ATT-Run-Canceled");209 }210 ConfiguredTaskAwaitable val5 = p.UnitOfWork.PutAsync(_003CeCase_003E5__4, null, ct).ConfigureAwait(false);211 val3 = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();212 if (!((ConfiguredTaskAwaiter)(ref val3)).IsCompleted)213 {214 num = (_003C_003E1__state = 3);215 _003C_003Eu__4 = val3;216 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CCancel_OnSaving_003Ed__2>(ref val3, ref this);217 return;218 }219 goto IL_02ee;220 end_IL_018a:;221 }222 finally223 {224 if (num < 0 && _003C_003E7__wrap2 != null)225 {226 ((System.IDisposable)_003C_003E7__wrap2).Dispose();227 }228 }229 _003C_003E7__wrap2 = null;230 }231 finally232 {233 if (num < 0 && _003C_003E7__wrap1 != null)234 {235 _003C_003E7__wrap1.Dispose();236 }237 }238 _003C_003E7__wrap1 = null;239 entity.Columns["CountChunksUnderConstruction"].SetValue(-1);240 }241 catch (System.Exception exception)242 {243 _003C_003E1__state = -2;244 _003C_003E8__1 = null;245 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);246 return;247 }248 _003C_003E1__state = -2;249 _003C_003E8__1 = null;250 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();251 }252253 [DebuggerHidden]254 private void SetStateMachine(IAsyncStateMachine stateMachine)255 {256 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);257 }258 }259260 public AttestationRun()261 {262 RegisterExtendedMethod("Cancel").As<bool>((Func<ISession, IEntity, CancellationToken, System.Threading.Tasks.Task<bool>>)Cancel).OnSaving(Cancel_OnSaving).Enabled()263 .From("CountChunksUnderConstruction")264 .As<int>((Func<int, bool>)((int c) => c > 0))265 .Behavior(MethodBehavior.ChangesExternalState)266 .Description("Method_AttestationRun_Cancel");267 }268269 private System.Threading.Tasks.Task<bool> Cancel(ISession session, IEntity entity, CancellationToken ct)270 {271 return System.Threading.Tasks.Task.FromResult<bool>(true);272 }273274 [AsyncStateMachine(typeof(_003CCancel_OnSaving_003Ed__2))]275 private System.Threading.Tasks.Task Cancel_OnSaving(IEntity entity, LogicReadWriteParameters p, bool o, CancellationToken ct)276 {277 //IL_0002: Unknown result type (might be due to invalid IL or missing references)278 //IL_0007: Unknown result type (might be due to invalid IL or missing references)279 //IL_0026: Unknown result type (might be due to invalid IL or missing references)280 //IL_0028: Unknown result type (might be due to invalid IL or missing references)281 _003CCancel_OnSaving_003Ed__2 _003CCancel_OnSaving_003Ed__ = default(_003CCancel_OnSaving_003Ed__2);282 _003CCancel_OnSaving_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();283 _003CCancel_OnSaving_003Ed__._003C_003E4__this = this;284 _003CCancel_OnSaving_003Ed__.entity = entity;285 _003CCancel_OnSaving_003Ed__.p = p;286 _003CCancel_OnSaving_003Ed__.ct = ct;287 _003CCancel_OnSaving_003Ed__._003C_003E1__state = -1;288 ((AsyncTaskMethodBuilder)(ref _003CCancel_OnSaving_003Ed__._003C_003Et__builder)).Start<_003CCancel_OnSaving_003Ed__2>(ref _003CCancel_OnSaving_003Ed__);289 return ((AsyncTaskMethodBuilder)(ref _003CCancel_OnSaving_003Ed__._003C_003Et__builder)).Task;290 }291}292