Back to OIM Explorer

Common.Customizer/VI.Common.Customizer/QBMFileRevision.cs

Decompiler Source FileCommon.Customizer.QBMFileRevisionDecompiled Source

1 extracted method/event/call references in QBMFileRevision.

Source: F:\Claude\.tmp\oim-decompiled-full\0045_One_Identity_Manager_Common.Customizer.dll\VI.Common.Customizer\QBMFileRevision.cs

Source size: 65.954 characters

Interpretation

  • Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.

Relations

  • Method registration: LoadFromFile at line 1317

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 QBMFileRevision; methods MoveNext, SetStateMachine, OnSavingAsync, _LoadFromFile, OnSavedAsync, _IsUpdateFile; references QBMFileRevision, QBMModuleDef; markers reads entity values, references DB/Dialog objects

Classes

QBMFileRevision

DB/Dialog object references

OIM key/entity markers

UID_QBMFileRevision

API/entity calls

GetValue GetValueAsync GetValue IsDeleted User From PutValueAsync

Registrations / handlers

None extracted.

Complete Source

C#1.548 lines
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.IO;6using System.IO.Compression;7using System.Linq;8using System.Runtime.CompilerServices;9using System.Runtime.InteropServices;10using System.Threading;11using System.Threading.Tasks;12using InstallManager.Core.Helper;13using NLog;14using VI.Base;15using VI.DB;16using VI.DB.Entities;17using VI.Update;1819namespace VI.Common.Customizer;2021public class QBMFileRevision : StateBasedEntityLogic22{23	[StructLayout((LayoutKind)3)]24	[CompilerGenerated]25	private struct _003C_003C_002Dctor_003Eb__1_2_003Ed : IAsyncStateMachine26	{27		public int _003C_003E1__state;2829		public AsyncTaskMethodBuilder _003C_003Et__builder;3031		public QBMFileRevision _003C_003E4__this;3233		public ISession session;3435		public IEntity entity;3637		public string fileName;3839		public CancellationToken ct;4041		private ConfiguredTaskAwaiter _003C_003Eu__1;4243		private void MoveNext()44		{45			//IL_0068: Unknown result type (might be due to invalid IL or missing references)46			//IL_006d: Unknown result type (might be due to invalid IL or missing references)47			//IL_0074: Unknown result type (might be due to invalid IL or missing references)48			//IL_0025: Unknown result type (might be due to invalid IL or missing references)49			//IL_0030: Unknown result type (might be due to invalid IL or missing references)50			//IL_0035: Unknown result type (might be due to invalid IL or missing references)51			//IL_0038: Unknown result type (might be due to invalid IL or missing references)52			//IL_003d: Unknown result type (might be due to invalid IL or missing references)53			//IL_0051: Unknown result type (might be due to invalid IL or missing references)54			//IL_0052: Unknown result type (might be due to invalid IL or missing references)55			int num = _003C_003E1__state;56			QBMFileRevision qBMFileRevision = _003C_003E4__this;57			try58			{59				ConfiguredTaskAwaiter val2;60				if (num != 0)61				{62					ConfiguredTaskAwaitable val = qBMFileRevision._LoadFromFile(session, entity, fileName, ct).ConfigureAwait(false);63					val2 = ((ConfiguredTaskAwaitable)(ref val)).GetAwaiter();64					if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)65					{66						num = (_003C_003E1__state = 0);67						_003C_003Eu__1 = val2;68						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_003C_002Dctor_003Eb__1_2_003Ed>(ref val2, ref this);69						return;70					}71				}72				else73				{74					val2 = _003C_003Eu__1;75					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);76					num = (_003C_003E1__state = -1);77				}78				((ConfiguredTaskAwaiter)(ref val2)).GetResult();79			}80			catch (System.Exception exception)81			{82				_003C_003E1__state = -2;83				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);84				return;85			}86			_003C_003E1__state = -2;87			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();88		}8990		[DebuggerHidden]91		private void SetStateMachine(IAsyncStateMachine stateMachine)92		{93			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);94		}95	}9697	[StructLayout((LayoutKind)3)]98	[CompilerGenerated]99	private struct _003COnSavedAsync_003Ed__5 : IAsyncStateMachine100	{101		public int _003C_003E1__state;102103		public AsyncTaskMethodBuilder _003C_003Et__builder;104105		public IEntity entity;106107		public LogicReadWriteParameters parameters;108109		public CancellationToken cancellationToken;110111		public QBMFileRevision _003C_003E4__this;112113		private ConfiguredTaskAwaiter _003C_003Eu__1;114115		private void MoveNext()116		{117			//IL_0128: Unknown result type (might be due to invalid IL or missing references)118			//IL_012d: Unknown result type (might be due to invalid IL or missing references)119			//IL_0134: Unknown result type (might be due to invalid IL or missing references)120			//IL_019b: Unknown result type (might be due to invalid IL or missing references)121			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)122			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)123			//IL_0158: Unknown result type (might be due to invalid IL or missing references)124			//IL_0163: Unknown result type (might be due to invalid IL or missing references)125			//IL_0168: Unknown result type (might be due to invalid IL or missing references)126			//IL_016b: Unknown result type (might be due to invalid IL or missing references)127			//IL_0170: Unknown result type (might be due to invalid IL or missing references)128			//IL_0184: Unknown result type (might be due to invalid IL or missing references)129			//IL_0185: Unknown result type (might be due to invalid IL or missing references)130			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)131			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)132			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)133			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)134			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)135			//IL_010e: Unknown result type (might be due to invalid IL or missing references)136			//IL_010f: Unknown result type (might be due to invalid IL or missing references)137			int num = _003C_003E1__state;138			QBMFileRevision qBMFileRevision = _003C_003E4__this;139			try140			{141				ConfiguredTaskAwaiter val;142				ConfiguredTaskAwaitable val2;143				if (num != 0)144				{145					if (num == 1)146					{147						val = _003C_003Eu__1;148						_003C_003Eu__1 = default(ConfiguredTaskAwaiter);149						num = (_003C_003E1__state = -1);150						goto IL_01b6;151					}152					if (Uid.IsCustom(entity.GetValue("UID_QBMFileRevision")) && (entity.Columns.ChangedAny("FileName", "IsToBackup", "NeverUpdate") || entity.IsDeleted()))153					{154						parameters.Session.AddPreCommitHook<string>("QBMModuleDef.WriteModuleInfoXml", null, QBMModuleDef.WriteModuleInfoXml);155					}156					if (!_IsUpdateFile(entity.GetValue<string>("FileName")) || !entity.Columns["FileContent"].IsChanged)157					{158						goto IL_014a;159					}160					val2 = _BuildUpdateZipAsync(parameters, cancellationToken).ConfigureAwait(false);161					val = ((ConfiguredTaskAwaitable)(ref val2)).GetAwaiter();162					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)163					{164						num = (_003C_003E1__state = 0);165						_003C_003Eu__1 = val;166						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__5>(ref val, ref this);167						return;168					}169				}170				else171				{172					val = _003C_003Eu__1;173					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);174					num = (_003C_003E1__state = -1);175				}176				((ConfiguredTaskAwaiter)(ref val)).GetResult();177				goto IL_014a;178				IL_01b6:179				((ConfiguredTaskAwaiter)(ref val)).GetResult();180				goto end_IL_000e;181				IL_014a:182				val2 = ((StateBasedEntityLogic)qBMFileRevision).OnSavedAsync(entity, parameters, cancellationToken).ConfigureAwait(false);183				val = ((ConfiguredTaskAwaitable)(ref val2)).GetAwaiter();184				if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)185				{186					num = (_003C_003E1__state = 1);187					_003C_003Eu__1 = val;188					((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__5>(ref val, ref this);189					return;190				}191				goto IL_01b6;192				end_IL_000e:;193			}194			catch (System.Exception exception)195			{196				_003C_003E1__state = -2;197				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);198				return;199			}200			_003C_003E1__state = -2;201			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();202		}203204		[DebuggerHidden]205		private void SetStateMachine(IAsyncStateMachine stateMachine)206		{207			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);208		}209	}210211	[StructLayout((LayoutKind)3)]212	[CompilerGenerated]213	private struct _003COnSavingAsync_003Ed__3 : IAsyncStateMachine214	{215		public int _003C_003E1__state;216217		public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;218219		public LogicReadWriteParameters parameters;220221		public QBMFileRevision _003C_003E4__this;222223		public IEntity entity;224225		public CancellationToken cancellationToken;226227		private ConfiguredTaskAwaiter _003C_003Eu__1;228229		private ConfiguredTaskAwaiter<Diff> _003C_003Eu__2;230231		private void MoveNext()232		{233			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)234			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)235			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)236			//IL_0122: Unknown result type (might be due to invalid IL or missing references)237			//IL_0127: Unknown result type (might be due to invalid IL or missing references)238			//IL_012f: Unknown result type (might be due to invalid IL or missing references)239			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)240			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)241			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)242			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)243			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)244			//IL_010a: Unknown result type (might be due to invalid IL or missing references)245			//IL_010c: Unknown result type (might be due to invalid IL or missing references)246			//IL_0065: Unknown result type (might be due to invalid IL or missing references)247			//IL_0070: Unknown result type (might be due to invalid IL or missing references)248			//IL_0075: Unknown result type (might be due to invalid IL or missing references)249			//IL_0079: Unknown result type (might be due to invalid IL or missing references)250			//IL_007e: Unknown result type (might be due to invalid IL or missing references)251			//IL_0092: Unknown result type (might be due to invalid IL or missing references)252			//IL_0093: Unknown result type (might be due to invalid IL or missing references)253			int num = _003C_003E1__state;254			QBMFileRevision qBMFileRevision = _003C_003E4__this;255			Diff result;256			try257			{258				ConfiguredTaskAwaiter<Diff> val;259				ConfiguredTaskAwaiter val3;260				if (num != 0)261				{262					if (num == 1)263					{264						val = _003C_003Eu__2;265						_003C_003Eu__2 = default(ConfiguredTaskAwaiter<Diff>);266						num = (_003C_003E1__state = -1);267						goto IL_013e;268					}269					if (parameters.Session.User().IsReadOnly || qBMFileRevision._saveLock)270					{271						throw new ViException(882551, ExceptionRelevance.EndUser);272					}273					if (entity.IsDeleted())274					{275						goto IL_00ce;276					}277					ConfiguredTaskAwaitable val2 = _CheckVersionUpdate(parameters.Session, entity, cancellationToken).ConfigureAwait(false);278					val3 = ((ConfiguredTaskAwaitable)(ref val2)).GetAwaiter();279					if (!((ConfiguredTaskAwaiter)(ref val3)).IsCompleted)280					{281						num = (_003C_003E1__state = 0);282						_003C_003Eu__1 = val3;283						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__3>(ref val3, ref this);284						return;285					}286				}287				else288				{289					val3 = _003C_003Eu__1;290					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);291					num = (_003C_003E1__state = -1);292				}293				((ConfiguredTaskAwaiter)(ref val3)).GetResult();294				goto IL_00ce;295				IL_00ce:296				val = ((StateBasedEntityLogic)qBMFileRevision).OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false).GetAwaiter();297				if (!val.IsCompleted)298				{299					num = (_003C_003E1__state = 1);300					_003C_003Eu__2 = val;301					_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__3>(ref val, ref this);302					return;303				}304				goto IL_013e;305				IL_013e:306				result = val.GetResult();307			}308			catch (System.Exception exception)309			{310				_003C_003E1__state = -2;311				_003C_003Et__builder.SetException(exception);312				return;313			}314			_003C_003E1__state = -2;315			_003C_003Et__builder.SetResult(result);316		}317318		[DebuggerHidden]319		private void SetStateMachine(IAsyncStateMachine stateMachine)320		{321			_003C_003Et__builder.SetStateMachine(stateMachine);322		}323	}324325	[StructLayout((LayoutKind)3)]326	[CompilerGenerated]327	private struct _003C_BuildUpdateZipAsync_003Ed__8 : IAsyncStateMachine328	{329		public int _003C_003E1__state;330331		public AsyncTaskMethodBuilder _003C_003Et__builder;332333		public LogicReadWriteParameters parameters;334335		public CancellationToken cancellationToken;336337		private System.IDisposable _003C_003E7__wrap1;338339		private byte[] _003CupdateZip_003E5__3;340341		private IEntity _003CdbFileRevision_003E5__4;342343		private ConfiguredTaskAwaiter<byte[]> _003C_003Eu__1;344345		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__2;346347		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__3;348349		private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__4;350351		private ConfiguredTaskAwaiter _003C_003Eu__5;352353		private void MoveNext()354		{355			//IL_009b: Unknown result type (might be due to invalid IL or missing references)356			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)357			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)358			//IL_0161: Unknown result type (might be due to invalid IL or missing references)359			//IL_0166: Unknown result type (might be due to invalid IL or missing references)360			//IL_016e: Unknown result type (might be due to invalid IL or missing references)361			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)362			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)363			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)364			//IL_0276: Unknown result type (might be due to invalid IL or missing references)365			//IL_027b: Unknown result type (might be due to invalid IL or missing references)366			//IL_0283: Unknown result type (might be due to invalid IL or missing references)367			//IL_0303: Unknown result type (might be due to invalid IL or missing references)368			//IL_0308: Unknown result type (might be due to invalid IL or missing references)369			//IL_0310: Unknown result type (might be due to invalid IL or missing references)370			//IL_0395: Unknown result type (might be due to invalid IL or missing references)371			//IL_039a: Unknown result type (might be due to invalid IL or missing references)372			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)373			//IL_0415: Unknown result type (might be due to invalid IL or missing references)374			//IL_041a: Unknown result type (might be due to invalid IL or missing references)375			//IL_0422: Unknown result type (might be due to invalid IL or missing references)376			//IL_0052: Unknown result type (might be due to invalid IL or missing references)377			//IL_005d: Unknown result type (might be due to invalid IL or missing references)378			//IL_0062: Unknown result type (might be due to invalid IL or missing references)379			//IL_0066: Unknown result type (might be due to invalid IL or missing references)380			//IL_006b: Unknown result type (might be due to invalid IL or missing references)381			//IL_0229: Unknown result type (might be due to invalid IL or missing references)382			//IL_0238: Unknown result type (might be due to invalid IL or missing references)383			//IL_023d: Unknown result type (might be due to invalid IL or missing references)384			//IL_0241: Unknown result type (might be due to invalid IL or missing references)385			//IL_0246: Unknown result type (might be due to invalid IL or missing references)386			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)387			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)388			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)389			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)390			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)391			//IL_03cc: Unknown result type (might be due to invalid IL or missing references)392			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)393			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)394			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)395			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)396			//IL_0080: Unknown result type (might be due to invalid IL or missing references)397			//IL_0082: Unknown result type (might be due to invalid IL or missing references)398			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)399			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)400			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)401			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)402			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)403			//IL_025b: Unknown result type (might be due to invalid IL or missing references)404			//IL_025d: Unknown result type (might be due to invalid IL or missing references)405			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)406			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)407			//IL_0348: Unknown result type (might be due to invalid IL or missing references)408			//IL_0357: Unknown result type (might be due to invalid IL or missing references)409			//IL_035c: Unknown result type (might be due to invalid IL or missing references)410			//IL_0360: Unknown result type (might be due to invalid IL or missing references)411			//IL_0365: Unknown result type (might be due to invalid IL or missing references)412			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)413			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)414			//IL_0118: Unknown result type (might be due to invalid IL or missing references)415			//IL_0123: Unknown result type (might be due to invalid IL or missing references)416			//IL_0128: Unknown result type (might be due to invalid IL or missing references)417			//IL_012c: Unknown result type (might be due to invalid IL or missing references)418			//IL_0131: Unknown result type (might be due to invalid IL or missing references)419			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)420			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)421			//IL_037a: Unknown result type (might be due to invalid IL or missing references)422			//IL_037c: Unknown result type (might be due to invalid IL or missing references)423			//IL_0146: Unknown result type (might be due to invalid IL or missing references)424			//IL_0148: Unknown result type (might be due to invalid IL or missing references)425			int num = _003C_003E1__state;426			try427			{428				if ((uint)num > 6u)429				{430					LogSession logSession = parameters.GetLogSession();431					_003C_003E7__wrap1 = logSession.DebugSection("Creating Update.zip file...");432				}433				try434				{435					ConfiguredTaskAwaiter<byte[]> val5;436					ConfiguredTaskAwaiter<IEntityCollection> val4;437					ConfiguredTaskAwaiter<IEntity> val3;438					ConfiguredValueTaskAwaiter<ApplyResult> val2;439					ConfiguredTaskAwaiter val;440					ConfiguredTaskAwaitable val6;441					byte[] result;442					IEntity result2;443					IEntityCollection result3;444					switch (num)445					{446					default:447						val5 = _CreateUpdateZipContent(parameters, cancellationToken).ConfigureAwait(false).GetAwaiter();448						if (!val5.IsCompleted)449						{450							num = (_003C_003E1__state = 0);451							_003C_003Eu__1 = val5;452							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<byte[]>, _003C_BuildUpdateZipAsync_003Ed__8>(ref val5, ref this);453							return;454						}455						goto IL_00b7;456					case 0:457						val5 = _003C_003Eu__1;458						_003C_003Eu__1 = default(ConfiguredTaskAwaiter<byte[]>);459						num = (_003C_003E1__state = -1);460						goto IL_00b7;461					case 1:462						val4 = _003C_003Eu__2;463						_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntityCollection>);464						num = (_003C_003E1__state = -1);465						goto IL_017d;466					case 2:467						val3 = _003C_003Eu__3;468						_003C_003Eu__3 = default(ConfiguredTaskAwaiter<IEntity>);469						num = (_003C_003E1__state = -1);470						goto IL_0207;471					case 3:472						val2 = _003C_003Eu__4;473						_003C_003Eu__4 = default(ConfiguredValueTaskAwaiter<ApplyResult>);474						num = (_003C_003E1__state = -1);475						goto IL_0292;476					case 4:477						val2 = _003C_003Eu__4;478						_003C_003Eu__4 = default(ConfiguredValueTaskAwaiter<ApplyResult>);479						num = (_003C_003E1__state = -1);480						goto IL_031f;481					case 5:482						val2 = _003C_003Eu__4;483						_003C_003Eu__4 = default(ConfiguredValueTaskAwaiter<ApplyResult>);484						num = (_003C_003E1__state = -1);485						goto IL_03b1;486					case 6:487						{488							val = _003C_003Eu__5;489							_003C_003Eu__5 = default(ConfiguredTaskAwaiter);490							num = (_003C_003E1__state = -1);491							break;492						}493						IL_03b1:494						val2.GetResult();495						val6 = parameters.UnitOfWork.PutAsync(_003CdbFileRevision_003E5__4, null, cancellationToken).ConfigureAwait(false);496						val = ((ConfiguredTaskAwaitable)(ref val6)).GetAwaiter();497						if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)498						{499							num = (_003C_003E1__state = 6);500							_003C_003Eu__5 = val;501							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_BuildUpdateZipAsync_003Ed__8>(ref val, ref this);502							return;503						}504						break;505						IL_00b7:506						result = val5.GetResult();507						_003CupdateZip_003E5__3 = result;508						if (_003CupdateZip_003E5__3.Length != 0)509						{510							Query query = (from t in Query.From("QBMFileRevision")511								where t.Column("Filename") == "Update.zip"512								select t).SelectNonLobs();513							val4 = parameters.EntitySource.GetCollectionAsync(query, EntityCollectionLoadType.Bulk, cancellationToken).ConfigureAwait(false).GetAwaiter();514							if (!val4.IsCompleted)515							{516								num = (_003C_003E1__state = 1);517								_003C_003Eu__2 = val4;518								((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_BuildUpdateZipAsync_003Ed__8>(ref val4, ref this);519								return;520							}521							goto IL_017d;522						}523						goto end_IL_0029;524						IL_031f:525						val2.GetResult();526						goto IL_0336;527						IL_0336:528						val2 = _003CdbFileRevision_003E5__4.PutValueAsync("FileContent", _003CupdateZip_003E5__3, cancellationToken).ConfigureAwait(false).GetAwaiter();529						if (!val2.IsCompleted)530						{531							num = (_003C_003E1__state = 5);532							_003C_003Eu__4 = val2;533							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_BuildUpdateZipAsync_003Ed__8>(ref val2, ref this);534							return;535						}536						goto IL_03b1;537						IL_0207:538						result2 = val3.GetResult();539						_003CdbFileRevision_003E5__4 = result2;540						val2 = _003CdbFileRevision_003E5__4.PutValueAsync("Filename", "Update.zip", cancellationToken).ConfigureAwait(false).GetAwaiter();541						if (!val2.IsCompleted)542						{543							num = (_003C_003E1__state = 3);544							_003C_003Eu__4 = val2;545							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_BuildUpdateZipAsync_003Ed__8>(ref val2, ref this);546							return;547						}548						goto IL_0292;549						IL_0292:550						val2.GetResult();551						val2 = _003CdbFileRevision_003E5__4.PutValueAsync("UID_QBMFileRevision", Uid.CreateFromValue("Update.zip", "CCC"), cancellationToken).ConfigureAwait(false).GetAwaiter();552						if (!val2.IsCompleted)553						{554							num = (_003C_003E1__state = 4);555							_003C_003Eu__4 = val2;556							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_BuildUpdateZipAsync_003Ed__8>(ref val2, ref this);557							return;558						}559						goto IL_031f;560						IL_017d:561						result3 = val4.GetResult();562						if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)result3).Count == 0)563						{564							val3 = parameters.EntitySource.CreateNewAsync("QBMFileRevision", null, cancellationToken).ConfigureAwait(false).GetAwaiter();565							if (!val3.IsCompleted)566							{567								num = (_003C_003E1__state = 2);568								_003C_003Eu__3 = val3;569								((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003C_BuildUpdateZipAsync_003Ed__8>(ref val3, ref this);570								return;571							}572							goto IL_0207;573						}574						_003CdbFileRevision_003E5__4 = ((System.Collections.Generic.IReadOnlyList<IEntity>)result3)[0];575						goto IL_0336;576					}577					((ConfiguredTaskAwaiter)(ref val)).GetResult();578					_003CupdateZip_003E5__3 = null;579					_003CdbFileRevision_003E5__4 = null;580					goto IL_0460;581					end_IL_0029:;582				}583				finally584				{585					if (num < 0 && _003C_003E7__wrap1 != null)586					{587						_003C_003E7__wrap1.Dispose();588					}589				}590				goto end_IL_0007;591				IL_0460:592				_003C_003E7__wrap1 = null;593				end_IL_0007:;594			}595			catch (System.Exception exception)596			{597				_003C_003E1__state = -2;598				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);599				return;600			}601			_003C_003E1__state = -2;602			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();603		}604605		[DebuggerHidden]606		private void SetStateMachine(IAsyncStateMachine stateMachine)607		{608			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);609		}610	}611612	[StructLayout((LayoutKind)3)]613	[CompilerGenerated]614	private struct _003C_CheckVersionUpdate_003Ed__7 : IAsyncStateMachine615	{616		public int _003C_003E1__state;617618		public AsyncTaskMethodBuilder _003C_003Et__builder;619620		public IEntity entity;621622		public CancellationToken ct;623624		public ISession session;625626		private string _003CsNewVersion_003E5__2;627628		private Version _003CvNew_003E5__3;629630		private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;631632		private ConfiguredTaskAwaiter<bool> _003C_003Eu__2;633634		private void MoveNext()635		{636			//IL_007c: Unknown result type (might be due to invalid IL or missing references)637			//IL_0081: Unknown result type (might be due to invalid IL or missing references)638			//IL_0089: Unknown result type (might be due to invalid IL or missing references)639			//IL_0118: Unknown result type (might be due to invalid IL or missing references)640			//IL_011d: Unknown result type (might be due to invalid IL or missing references)641			//IL_0125: Unknown result type (might be due to invalid IL or missing references)642			//IL_01de: Unknown result type (might be due to invalid IL or missing references)643			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)644			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)645			//IL_002f: Unknown result type (might be due to invalid IL or missing references)646			//IL_003e: Unknown result type (might be due to invalid IL or missing references)647			//IL_0043: Unknown result type (might be due to invalid IL or missing references)648			//IL_0047: Unknown result type (might be due to invalid IL or missing references)649			//IL_004c: Unknown result type (might be due to invalid IL or missing references)650			//IL_0061: Unknown result type (might be due to invalid IL or missing references)651			//IL_0063: Unknown result type (might be due to invalid IL or missing references)652			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)653			//IL_00da: Unknown result type (might be due to invalid IL or missing references)654			//IL_00df: Unknown result type (might be due to invalid IL or missing references)655			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)656			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)657			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)658			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)659			//IL_0191: Unknown result type (might be due to invalid IL or missing references)660			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)661			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)662			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)663			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)664			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)665			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)666			int num = _003C_003E1__state;667			try668			{669				ConfiguredTaskAwaiter<bool> val2;670				ConfiguredValueTaskAwaiter<string> val;671				string result;672				switch (num)673				{674				default:675					val = entity.Columns["FileVersion"].GetValueAsync<string>(ct).ConfigureAwait(false).GetAwaiter();676					if (!val.IsCompleted)677					{678						num = (_003C_003E1__state = 0);679						_003C_003Eu__1 = val;680						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckVersionUpdate_003Ed__7>(ref val, ref this);681						return;682					}683					goto IL_0098;684				case 0:685					val = _003C_003Eu__1;686					_003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);687					num = (_003C_003E1__state = -1);688					goto IL_0098;689				case 1:690					val2 = _003C_003Eu__2;691					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<bool>);692					num = (_003C_003E1__state = -1);693					goto IL_0134;694				case 2:695					{696						val = _003C_003Eu__1;697						_003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);698						num = (_003C_003E1__state = -1);699						break;700					}701					IL_0134:702					if (!val2.GetResult() && !DbVal.ConvertTo<bool>(session.Variables["QBMFileRevision.SuppressFileVersionCheck"]) && Version.TryParse(_003CsNewVersion_003E5__2, ref _003CvNew_003E5__3))703					{704						val = entity.Columns["FileVersion"].GetOldValueAsync<string>(ct).ConfigureAwait(false).GetAwaiter();705						if (!val.IsCompleted)706						{707							num = (_003C_003E1__state = 2);708							_003C_003Eu__1 = val;709							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckVersionUpdate_003Ed__7>(ref val, ref this);710							return;711						}712						break;713					}714					goto end_IL_0007;715					IL_0098:716					result = val.GetResult();717					_003CsNewVersion_003E5__2 = result;718					if (!string.IsNullOrEmpty(_003CsNewVersion_003E5__2))719					{720						val2 = session.Principal.Features.IsAllowedAsync("Common_FileRevisionDowngrade", ct).ConfigureAwait(false).GetAwaiter();721						if (!val2.IsCompleted)722						{723							num = (_003C_003E1__state = 1);724							_003C_003Eu__2 = val2;725							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003C_CheckVersionUpdate_003Ed__7>(ref val2, ref this);726							return;727						}728						goto IL_0134;729					}730					goto end_IL_0007;731				}732				string result2 = val.GetResult();733				Version val3 = default(Version);734				if (Version.TryParse(result2, ref val3) && val3 > _003CvNew_003E5__3)735				{736					throw new ViException(882554, ExceptionRelevance.EndUser, entity.Display, result2, _003CsNewVersion_003E5__2);737				}738				end_IL_0007:;739			}740			catch (System.Exception exception)741			{742				_003C_003E1__state = -2;743				_003CsNewVersion_003E5__2 = null;744				_003CvNew_003E5__3 = null;745				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);746				return;747			}748			_003C_003E1__state = -2;749			_003CsNewVersion_003E5__2 = null;750			_003CvNew_003E5__3 = null;751			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();752		}753754		[DebuggerHidden]755		private void SetStateMachine(IAsyncStateMachine stateMachine)756		{757			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);758		}759	}760761	[StructLayout((LayoutKind)3)]762	[CompilerGenerated]763	private struct _003C_CreateUpdateZipContent_003Ed__9 : IAsyncStateMachine764	{765		public int _003C_003E1__state;766767		public AsyncTaskMethodBuilder<byte[]> _003C_003Et__builder;768769		public LogicReadWriteParameters parameters;770771		public CancellationToken ct;772773		private LogSession _003Clog_003E5__2;774775		private MemoryStream _003Cm_003E5__3;776777		private IEntityCollection _003Centries_003E5__4;778779		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;780781		private ConfiguredValueTaskAwaiter<byte[]> _003C_003Eu__2;782783		private ZipArchive _003Carchive_003E5__5;784785		private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap5;786787		private string _003CupdateFileName_003E5__7;788789		private MemoryStream _003CzipStream_003E5__8;790791		private ZipArchive _003Czip_003E5__9;792793		private System.Collections.Generic.IEnumerator<ZipArchiveEntry> _003C_003E7__wrap9;794795		private Stream _003Ci_003E5__11;796797		private Stream _003Co_003E5__12;798799		private ConfiguredTaskAwaiter _003C_003Eu__3;800801		private void MoveNext()802		{803			//IL_00de: Unknown result type (might be due to invalid IL or missing references)804			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)805			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)806			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)807			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)808			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)809			//IL_002f: Unknown result type (might be due to invalid IL or missing references)810			//IL_0039: Expected O, but got Unknown811			//IL_0095: Unknown result type (might be due to invalid IL or missing references)812			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)813			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)814			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)815			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)816			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)817			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)818			//IL_015b: Unknown result type (might be due to invalid IL or missing references)819			//IL_016a: Unknown result type (might be due to invalid IL or missing references)820			//IL_016f: Unknown result type (might be due to invalid IL or missing references)821			//IL_0173: Unknown result type (might be due to invalid IL or missing references)822			//IL_0178: Unknown result type (might be due to invalid IL or missing references)823			//IL_021a: Unknown result type (might be due to invalid IL or missing references)824			//IL_0224: Expected O, but got Unknown825			//IL_018d: Unknown result type (might be due to invalid IL or missing references)826			//IL_018f: Unknown result type (might be due to invalid IL or missing references)827			//IL_02da: Unknown result type (might be due to invalid IL or missing references)828			//IL_02df: Unknown result type (might be due to invalid IL or missing references)829			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)830			//IL_0335: Unknown result type (might be due to invalid IL or missing references)831			//IL_033f: Expected O, but got Unknown832			//IL_034c: Unknown result type (might be due to invalid IL or missing references)833			//IL_0356: Expected O, but got Unknown834			//IL_028d: Unknown result type (might be due to invalid IL or missing references)835			//IL_029c: Unknown result type (might be due to invalid IL or missing references)836			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)837			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)838			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)839			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)840			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)841			//IL_042d: Unknown result type (might be due to invalid IL or missing references)842			//IL_0432: Unknown result type (might be due to invalid IL or missing references)843			//IL_043a: Unknown result type (might be due to invalid IL or missing references)844			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)845			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)846			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)847			//IL_03f8: Unknown result type (might be due to invalid IL or missing references)848			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)849			//IL_0412: Unknown result type (might be due to invalid IL or missing references)850			//IL_0414: Unknown result type (might be due to invalid IL or missing references)851			int num = _003C_003E1__state;852			byte[] result2;853			try854			{855				ConfiguredTaskAwaiter<IEntityCollection> val2;856				IEntityCollection result;857				IEntity entity;858				byte[] result3;859				ConfiguredValueTaskAwaiter<byte[]> val;860				switch (num)861				{862				default:863				{864					_003Clog_003E5__2 = parameters.GetLogSession();865					_003Cm_003E5__3 = new MemoryStream();866					Query query = (from t in Query.From("QBMFileRevision")867						where t.Column("FileName") == "UpdateBase.zip" || t.Column("FileName").EndsWith(".Update.zip")868						select t).Select("Filename", "FileContent");869					val2 = parameters.EntitySource.GetCollectionAsync(query, EntityCollectionLoadType.Slim, ct).ConfigureAwait(false).GetAwaiter();870					if (!val2.IsCompleted)871					{872						num = (_003C_003E1__state = 0);873						_003C_003Eu__1 = val2;874						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_CreateUpdateZipContent_003Ed__9>(ref val2, ref this);875						return;876					}877					goto IL_00fa;878				}879				case 0:880					val2 = _003C_003Eu__1;881					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);882					num = (_003C_003E1__state = -1);883					goto IL_00fa;884				case 1:885					val = _003C_003Eu__2;886					_003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<byte[]>);887					num = (_003C_003E1__state = -1);888					goto IL_01c4;889				case 2:890				case 3:891					break;892					IL_00fa:893					result = val2.GetResult();894					_003Centries_003E5__4 = result;895					entity = Enumerable.FirstOrDefault<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)_003Centries_003E5__4, (Func<IEntity, bool>)((IEntity e) => string.Equals(e.GetValue<string>("FileName"), "UpdateBase.zip", (StringComparison)5)));896					if (entity != null)897					{898						val = entity.GetValueAsync<byte[]>("FileContent", ct).ConfigureAwait(false).GetAwaiter();899						if (!val.IsCompleted)900						{901							num = (_003C_003E1__state = 1);902							_003C_003Eu__2 = val;903							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<byte[]>, _003C_CreateUpdateZipContent_003Ed__9>(ref val, ref this);904							return;905						}906						goto IL_01c4;907					}908					_003Clog_003E5__2.Debug("UpdateBase.zip was not found -> do not create Update.zip");909					result2 = System.Array.Empty<byte>();910					goto end_IL_0007;911					IL_01c4:912					result3 = val.GetResult();913					if (result3 != null && result3.Length != 0)914					{915						((Stream)_003Cm_003E5__3).Write(System.ReadOnlySpan<byte>.op_Implicit(result3));916						((Stream)_003Cm_003E5__3).Seek(0L, (SeekOrigin)0);917						_003Carchive_003E5__5 = new ZipArchive((Stream)(object)_003Cm_003E5__3, (ZipArchiveMode)2);918						break;919					}920					_003Clog_003E5__2.Debug("Update.zip is empty -> do not create Update.zip");921					result2 = System.Array.Empty<byte>();922					goto end_IL_0007;923				}924				try925				{926					if ((uint)(num - 2) > 1u)927					{928						_003C_003E7__wrap5 = ((System.Collections.Generic.IEnumerable<IEntity>)_003Centries_003E5__4).GetEnumerator();929					}930					try931					{932						if (num != 2)933						{934							if (num == 3)935							{936								goto IL_0340;937							}938							goto IL_050c;939						}940						val = _003C_003Eu__2;941						_003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<byte[]>);942						num = (_003C_003E1__state = -1);943						goto IL_02f6;944						IL_02f6:945						byte[] result4 = val.GetResult();946						if (result4 != null && result4.Length != 0)947						{948							_003CzipStream_003E5__8 = new MemoryStream(result4);949							goto IL_0340;950						}951						_003Clog_003E5__2.Debug("{UpdateFile} is empty -> do not create Update.zip", _003CupdateFileName_003E5__7);952						result2 = System.Array.Empty<byte>();953						goto end_IL_0225;954						IL_0340:955						try956						{957							if (num != 3)958							{959								_003Czip_003E5__9 = new ZipArchive((Stream)(object)_003CzipStream_003E5__8, (ZipArchiveMode)0);960							}961							try962							{963								if (num != 3)964								{965									_003C_003E7__wrap9 = _003Czip_003E5__9.Entries.GetEnumerator();966								}967								try968								{969									if (num == 3)970									{971										goto IL_03c1;972									}973									goto IL_0492;974									IL_0492:975									ZipArchiveEntry val3 = default(ZipArchiveEntry);976									while (((System.Collections.IEnumerator)_003C_003E7__wrap9).MoveNext())977									{978										ZipArchiveEntry current = _003C_003E7__wrap9.Current;979										if (_003Carchive_003E5__5.GetEntry(current.Name) != null)980										{981											continue;982										}983										val3 = _003Carchive_003E5__5.CreateEntry(current.Name);984										_003Ci_003E5__11 = current.Open();985										goto IL_03c1;986									}987									goto end_IL_0372;988									IL_03c1:989									try990									{991										if (num != 3)992										{993											_003Co_003E5__12 = val3.Open();994										}995										try996										{997											ConfiguredTaskAwaiter val5;998											if (num != 3)999											{1000												ConfiguredTaskAwaitable val4 = _003Ci_003E5__11.CopyToAsync(_003Co_003E5__12, ct).ConfigureAwait(false);1001												val5 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();1002												if (!((ConfiguredTaskAwaiter)(ref val5)).IsCompleted)1003												{1004													num = (_003C_003E1__state = 3);1005													_003C_003Eu__3 = val5;1006													_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_CreateUpdateZipContent_003Ed__9>(ref val5, ref this);1007													return;1008												}1009											}1010											else1011											{1012												val5 = _003C_003Eu__3;1013												_003C_003Eu__3 = default(ConfiguredTaskAwaiter);1014												num = (_003C_003E1__state = -1);1015											}1016											((ConfiguredTaskAwaiter)(ref val5)).GetResult();1017										}1018										finally1019										{1020											if (num < 0 && _003Co_003E5__12 != null)1021											{1022												((System.IDisposable)_003Co_003E5__12).Dispose();1023											}1024										}1025										_003Co_003E5__12 = null;1026									}1027									finally1028									{1029										if (num < 0 && _003Ci_003E5__11 != null)1030										{1031											((System.IDisposable)_003Ci_003E5__11).Dispose();1032										}1033									}1034									_003Ci_003E5__11 = null;1035									goto IL_0492;1036									end_IL_0372:;1037								}1038								finally1039								{1040									if (num < 0 && _003C_003E7__wrap9 != null)1041									{1042										((System.IDisposable)_003C_003E7__wrap9).Dispose();1043									}1044								}1045								_003C_003E7__wrap9 = null;1046							}1047							finally1048							{1049								if (num < 0 && _003Czip_003E5__9 != null)1050								{1051									((System.IDisposable)_003Czip_003E5__9).Dispose();1052								}1053							}1054							_003Czip_003E5__9 = null;1055						}1056						finally1057						{1058							if (num < 0 && _003CzipStream_003E5__8 != null)1059							{1060								((System.IDisposable)_003CzipStream_003E5__8).Dispose();1061							}1062						}1063						_003CzipStream_003E5__8 = null;1064						_003CupdateFileName_003E5__7 = null;1065						goto IL_050c;1066						IL_050c:1067						while (((System.Collections.IEnumerator)_003C_003E7__wrap5).MoveNext())1068						{1069							IEntity current2 = _003C_003E7__wrap5.Current;1070							_003CupdateFileName_003E5__7 = current2.GetValue<string>("FileName");1071							if (string.Equals(_003CupdateFileName_003E5__7, "UpdateBase.zip", (StringComparison)5))1072							{1073								continue;1074							}1075							val = current2.GetValueAsync<byte[]>("FileContent", ct).ConfigureAwait(false).GetAwaiter();1076							if (!val.IsCompleted)1077							{1078								num = (_003C_003E1__state = 2);1079								_003C_003Eu__2 = val;1080								_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<byte[]>, _003C_CreateUpdateZipContent_003Ed__9>(ref val, ref this);1081								return;1082							}1083							goto IL_02f6;1084						}1085					}1086					finally1087					{1088						if (num < 0 && _003C_003E7__wrap5 != null)1089						{1090							((System.IDisposable)_003C_003E7__wrap5).Dispose();1091						}1092					}1093					_003C_003E7__wrap5 = null;1094					goto IL_0557;1095					end_IL_0225:;1096				}1097				finally1098				{1099					if (num < 0 && _003Carchive_003E5__5 != null)1100					{1101						((System.IDisposable)_003Carchive_003E5__5).Dispose();1102					}1103				}1104				goto end_IL_0007;1105				IL_0557:1106				_003Carchive_003E5__5 = null;1107				result2 = _003Cm_003E5__3.ToArray();1108				end_IL_0007:;1109			}1110			catch (System.Exception exception)1111			{1112				_003C_003E1__state = -2;1113				_003Clog_003E5__2 = null;1114				_003Cm_003E5__3 = null;1115				_003Centries_003E5__4 = null;1116				_003C_003Et__builder.SetException(exception);1117				return;1118			}1119			_003C_003E1__state = -2;1120			_003Clog_003E5__2 = null;1121			_003Cm_003E5__3 = null;1122			_003Centries_003E5__4 = null;1123			_003C_003Et__builder.SetResult(result2);1124		}11251126		[DebuggerHidden]1127		private void SetStateMachine(IAsyncStateMachine stateMachine)1128		{1129			_003C_003Et__builder.SetStateMachine(stateMachine);1130		}1131	}11321133	[StructLayout((LayoutKind)3)]1134	[CompilerGenerated]1135	private struct _003C_LoadFromFile_003Ed__4 : IAsyncStateMachine1136	{1137		public int _003C_003E1__state;11381139		public AsyncTaskMethodBuilder _003C_003Et__builder;11401141		public QBMFileRevision _003C_003E4__this;11421143		public string file;11441145		public IEntity entity;11461147		public CancellationToken ct;11481149		private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__1;11501151		private FileStream _003CsFile_003E5__2;11521153		private byte[] _003CvBuffer_003E5__3;11541155		private ConfiguredTaskAwaiter<int> _003C_003Eu__2;11561157		private void MoveNext()1158		{1159			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)1160			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)1161			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)1162			//IL_018e: Unknown result type (might be due to invalid IL or missing references)1163			//IL_0193: Unknown result type (might be due to invalid IL or missing references)1164			//IL_019b: Unknown result type (might be due to invalid IL or missing references)1165			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)1166			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)1167			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)1168			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)1169			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)1170			//IL_020e: Unknown result type (might be due to invalid IL or missing references)1171			//IL_0213: Unknown result type (might be due to invalid IL or missing references)1172			//IL_021b: Unknown result type (might be due to invalid IL or missing references)1173			//IL_0145: Unknown result type (might be due to invalid IL or missing references)1174			//IL_0150: Unknown result type (might be due to invalid IL or missing references)1175			//IL_0155: Unknown result type (might be due to invalid IL or missing references)1176			//IL_0159: Unknown result type (might be due to invalid IL or missing references)1177			//IL_015e: Unknown result type (might be due to invalid IL or missing references)1178			//IL_007e: Unknown result type (might be due to invalid IL or missing references)1179			//IL_008d: Unknown result type (might be due to invalid IL or missing references)1180			//IL_0092: Unknown result type (might be due to invalid IL or missing references)1181			//IL_0096: Unknown result type (might be due to invalid IL or missing references)1182			//IL_009b: Unknown result type (might be due to invalid IL or missing references)1183			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)1184			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)1185			//IL_0173: Unknown result type (might be due to invalid IL or missing references)1186			//IL_0175: Unknown result type (might be due to invalid IL or missing references)1187			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)1188			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)1189			int num = _003C_003E1__state;1190			QBMFileRevision qBMFileRevision = _003C_003E4__this;1191			try1192			{1193				if (num != 0)1194				{1195					if ((uint)(num - 1) <= 1u)1196					{1197						goto IL_0106;1198					}1199					qBMFileRevision._saveLock = true;1200				}1201				try1202				{1203					ConfiguredValueTaskAwaiter<ApplyResult> val;1204					if (num == 0)1205					{1206						val = _003C_003Eu__1;1207						_003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<ApplyResult>);1208						num = (_003C_003E1__state = -1);1209						goto IL_00e7;1210					}1211					string text = FileVersionInfoPe.GetAssemblyFileVersion(file);1212					if (!string.IsNullOrEmpty(text))1213					{1214						IEntityColumn entityColumn = entity.Columns["FileVersion"];1215						if (text.Length > entityColumn.MaxLen)1216						{1217							text = text.Substring(0, entityColumn.MaxLen);1218						}1219						val = entity.PutValueAsync("FileVersion", text, ct).ConfigureAwait(false).GetAwaiter();1220						if (!val.IsCompleted)1221						{1222							num = (_003C_003E1__state = 0);1223							_003C_003Eu__1 = val;1224							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_LoadFromFile_003Ed__4>(ref val, ref this);1225							return;1226						}1227						goto IL_00e7;1228					}1229					goto end_IL_0022;1230					IL_00e7:1231					val.GetResult();1232					end_IL_0022:;1233				}1234				catch1235				{1236				}1237				_003CsFile_003E5__2 = File.OpenRead(file);1238				goto IL_0106;1239				IL_0106:1240				try1241				{1242					ConfiguredValueTaskAwaiter<ApplyResult> val;1243					ConfiguredTaskAwaiter<int> val2;1244					if (num != 1)1245					{1246						if (num == 2)1247						{1248							val = _003C_003Eu__1;1249							_003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<ApplyResult>);1250							num = (_003C_003E1__state = -1);1251							goto IL_022a;1252						}1253						_003CvBuffer_003E5__3 = new byte[((Stream)_003CsFile_003E5__2).Length];1254						val2 = ((Stream)_003CsFile_003E5__2).ReadAsync(_003CvBuffer_003E5__3, 0, (int)((Stream)_003CsFile_003E5__2).Length, ct).ConfigureAwait(false).GetAwaiter();1255						if (!val2.IsCompleted)1256						{1257							num = (_003C_003E1__state = 1);1258							_003C_003Eu__2 = val2;1259							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<int>, _003C_LoadFromFile_003Ed__4>(ref val2, ref this);1260							return;1261						}1262					}1263					else1264					{1265						val2 = _003C_003Eu__2;1266						_003C_003Eu__2 = default(ConfiguredTaskAwaiter<int>);1267						num = (_003C_003E1__state = -1);1268					}1269					val2.GetResult();1270					val = entity.PutValueAsync("FileContent", _003CvBuffer_003E5__3, ct).ConfigureAwait(false).GetAwaiter();1271					if (!val.IsCompleted)1272					{1273						num = (_003C_003E1__state = 2);1274						_003C_003Eu__1 = val;1275						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_LoadFromFile_003Ed__4>(ref val, ref this);1276						return;1277					}1278					goto IL_022a;1279					IL_022a:1280					val.GetResult();1281					_003CvBuffer_003E5__3 = null;1282				}1283				finally1284				{1285					if (num < 0 && _003CsFile_003E5__2 != null)1286					{1287						((System.IDisposable)_003CsFile_003E5__2).Dispose();1288					}1289				}1290				_003CsFile_003E5__2 = null;1291			}1292			catch (System.Exception exception)1293			{1294				_003C_003E1__state = -2;1295				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1296				return;1297			}1298			_003C_003E1__state = -2;1299			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1300		}13011302		[DebuggerHidden]1303		private void SetStateMachine(IAsyncStateMachine stateMachine)1304		{1305			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1306		}1307	}13081309	private bool _saveLock;13101311	public const string SuppressFileVersionCheck = "QBMFileRevision.SuppressFileVersionCheck";13121313	public QBMFileRevision()1314	{1315		Value("FileSize").From("FileContent").As<byte[], long>((byte[] data) => (data == null) ? 0 : data.LongLength);1316		Value("HashValue").From("FileContent").As<byte[], byte[]>((byte[] data) => (data == null) ? null : UpdateHelper.ComputeHash(data));1317		RegisterMethod("LoadFromFile").As<string>([AsyncStateMachine(typeof(_003C_003C_002Dctor_003Eb__1_2_003Ed))] [CompilerGenerated] (ISession session, IEntity entity, string fileName, CancellationToken ct) =>1318		{1319			//IL_0002: Unknown result type (might be due to invalid IL or missing references)1320			//IL_0007: Unknown result type (might be due to invalid IL or missing references)1321			//IL_002e: Unknown result type (might be due to invalid IL or missing references)1322			//IL_0030: Unknown result type (might be due to invalid IL or missing references)1323			_003C_003C_002Dctor_003Eb__1_2_003Ed _003C_003C_002Dctor_003Eb__1_2_003Ed = default(_003C_003C_002Dctor_003Eb__1_2_003Ed);1324			_003C_003C_002Dctor_003Eb__1_2_003Ed._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1325			_003C_003C_002Dctor_003Eb__1_2_003Ed._003C_003E4__this = this;1326			_003C_003C_002Dctor_003Eb__1_2_003Ed.session = session;1327			_003C_003C_002Dctor_003Eb__1_2_003Ed.entity = entity;1328			_003C_003C_002Dctor_003Eb__1_2_003Ed.fileName = fileName;1329			_003C_003C_002Dctor_003Eb__1_2_003Ed.ct = ct;1330			_003C_003C_002Dctor_003Eb__1_2_003Ed._003C_003E1__state = -1;1331			((AsyncTaskMethodBuilder)(ref _003C_003C_002Dctor_003Eb__1_2_003Ed._003C_003Et__builder)).Start<_003C_003C_002Dctor_003Eb__1_2_003Ed>(ref _003C_003C_002Dctor_003Eb__1_2_003Ed);1332			return ((AsyncTaskMethodBuilder)(ref _003C_003C_002Dctor_003Eb__1_2_003Ed._003C_003Et__builder)).Task;1333		}).Features("Transport_Export", "Common_StartCustomizerMethods").Behavior(MethodBehavior.ValidForReadOnlyUser)1334			.Description("Method_QBMFileRevision_LoadFromFile");1335	}13361337	[AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__3))]1338	public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)1339	{1340		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1341		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1342		//IL_0026: Unknown result type (might be due to invalid IL or missing references)1343		//IL_0027: Unknown result type (might be due to invalid IL or missing references)1344		if (parameters.Session.User().IsReadOnly || _saveLock)1345		{1346			throw new ViException(882551, ExceptionRelevance.EndUser);1347		}1348		if (!entity.IsDeleted())1349		{1350			await _CheckVersionUpdate(parameters.Session, entity, cancellationToken).ConfigureAwait(false);1351		}1352		return await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false);1353	}13541355	[AsyncStateMachine(typeof(_003C_LoadFromFile_003Ed__4))]1356	private System.Threading.Tasks.Task _LoadFromFile(ISession session, IEntity entity, string file, CancellationToken ct)1357	{1358		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1359		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1360		//IL_0026: Unknown result type (might be due to invalid IL or missing references)1361		//IL_0028: Unknown result type (might be due to invalid IL or missing references)1362		_003C_LoadFromFile_003Ed__4 _003C_LoadFromFile_003Ed__ = default(_003C_LoadFromFile_003Ed__4);1363		_003C_LoadFromFile_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1364		_003C_LoadFromFile_003Ed__._003C_003E4__this = this;1365		_003C_LoadFromFile_003Ed__.entity = entity;1366		_003C_LoadFromFile_003Ed__.file = file;1367		_003C_LoadFromFile_003Ed__.ct = ct;1368		_003C_LoadFromFile_003Ed__._003C_003E1__state = -1;1369		((AsyncTaskMethodBuilder)(ref _003C_LoadFromFile_003Ed__._003C_003Et__builder)).Start<_003C_LoadFromFile_003Ed__4>(ref _003C_LoadFromFile_003Ed__);1370		return ((AsyncTaskMethodBuilder)(ref _003C_LoadFromFile_003Ed__._003C_003Et__builder)).Task;1371	}13721373	[AsyncStateMachine(typeof(_003COnSavedAsync_003Ed__5))]1374	public override System.Threading.Tasks.Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)1375	{1376		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1377		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1378		//IL_0026: Unknown result type (might be due to invalid IL or missing references)1379		//IL_0027: Unknown result type (might be due to invalid IL or missing references)1380		_003COnSavedAsync_003Ed__5 _003COnSavedAsync_003Ed__ = default(_003COnSavedAsync_003Ed__5);1381		_003COnSavedAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1382		_003COnSavedAsync_003Ed__._003C_003E4__this = this;1383		_003COnSavedAsync_003Ed__.entity = entity;1384		_003COnSavedAsync_003Ed__.parameters = parameters;1385		_003COnSavedAsync_003Ed__.cancellationToken = cancellationToken;1386		_003COnSavedAsync_003Ed__._003C_003E1__state = -1;1387		((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Start<_003COnSavedAsync_003Ed__5>(ref _003COnSavedAsync_003Ed__);1388		return ((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Task;1389	}13901391	private static bool _IsUpdateFile(string filename)1392	{1393		if (string.IsNullOrEmpty(filename))1394		{1395			return false;1396		}1397		if (!string.Equals(filename, "UpdateBase.zip", (StringComparison)5))1398		{1399			return filename.EndsWith(".Update.zip", (StringComparison)5);1400		}1401		return true;1402	}14031404	[AsyncStateMachine(typeof(_003C_CheckVersionUpdate_003Ed__7))]1405	private static System.Threading.Tasks.Task _CheckVersionUpdate(ISession session, IEntity entity, CancellationToken ct)1406	{1407		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1408		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1409		//IL_001e: Unknown result type (might be due to invalid IL or missing references)1410		//IL_001f: Unknown result type (might be due to invalid IL or missing references)1411		_003C_CheckVersionUpdate_003Ed__7 _003C_CheckVersionUpdate_003Ed__ = default(_003C_CheckVersionUpdate_003Ed__7);1412		_003C_CheckVersionUpdate_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1413		_003C_CheckVersionUpdate_003Ed__.session = session;1414		_003C_CheckVersionUpdate_003Ed__.entity = entity;1415		_003C_CheckVersionUpdate_003Ed__.ct = ct;1416		_003C_CheckVersionUpdate_003Ed__._003C_003E1__state = -1;1417		((AsyncTaskMethodBuilder)(ref _003C_CheckVersionUpdate_003Ed__._003C_003Et__builder)).Start<_003C_CheckVersionUpdate_003Ed__7>(ref _003C_CheckVersionUpdate_003Ed__);1418		return ((AsyncTaskMethodBuilder)(ref _003C_CheckVersionUpdate_003Ed__._003C_003Et__builder)).Task;1419	}14201421	[AsyncStateMachine(typeof(_003C_BuildUpdateZipAsync_003Ed__8))]1422	private static System.Threading.Tasks.Task _BuildUpdateZipAsync(LogicReadWriteParameters parameters, CancellationToken cancellationToken)1423	{1424		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1425		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1426		//IL_0016: Unknown result type (might be due to invalid IL or missing references)1427		//IL_0017: Unknown result type (might be due to invalid IL or missing references)1428		_003C_BuildUpdateZipAsync_003Ed__8 _003C_BuildUpdateZipAsync_003Ed__ = default(_003C_BuildUpdateZipAsync_003Ed__8);1429		_003C_BuildUpdateZipAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1430		_003C_BuildUpdateZipAsync_003Ed__.parameters = parameters;1431		_003C_BuildUpdateZipAsync_003Ed__.cancellationToken = cancellationToken;1432		_003C_BuildUpdateZipAsync_003Ed__._003C_003E1__state = -1;1433		((AsyncTaskMethodBuilder)(ref _003C_BuildUpdateZipAsync_003Ed__._003C_003Et__builder)).Start<_003C_BuildUpdateZipAsync_003Ed__8>(ref _003C_BuildUpdateZipAsync_003Ed__);1434		return ((AsyncTaskMethodBuilder)(ref _003C_BuildUpdateZipAsync_003Ed__._003C_003Et__builder)).Task;1435	}14361437	[AsyncStateMachine(typeof(_003C_CreateUpdateZipContent_003Ed__9))]1438	private static async System.Threading.Tasks.Task<byte[]> _CreateUpdateZipContent(LogicReadWriteParameters parameters, CancellationToken ct)1439	{1440		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1441		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1442		//IL_0016: Unknown result type (might be due to invalid IL or missing references)1443		//IL_0017: Unknown result type (might be due to invalid IL or missing references)1444		LogSession log = parameters.GetLogSession();1445		MemoryStream m = new MemoryStream();1446		Query query = (from t in Query.From("QBMFileRevision")1447			where t.Column("FileName") == "UpdateBase.zip" || t.Column("FileName").EndsWith(".Update.zip")1448			select t).Select("Filename", "FileContent");1449		IEntityCollection entries = await parameters.EntitySource.GetCollectionAsync(query, EntityCollectionLoadType.Slim, ct).ConfigureAwait(false);1450		IEntity entity = Enumerable.FirstOrDefault<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)entries, (Func<IEntity, bool>)((IEntity e) => string.Equals(e.GetValue<string>("FileName"), "UpdateBase.zip", (StringComparison)5)));1451		if (entity == null)1452		{1453			log.Debug("UpdateBase.zip was not found -> do not create Update.zip");1454			return System.Array.Empty<byte>();1455		}1456		byte[] array = await entity.GetValueAsync<byte[]>("FileContent", ct).ConfigureAwait(false);1457		if (array == null || array.Length == 0)1458		{1459			log.Debug("Update.zip is empty -> do not create Update.zip");1460			return System.Array.Empty<byte>();1461		}1462		((Stream)m).Write(System.ReadOnlySpan<byte>.op_Implicit(array));1463		((Stream)m).Seek(0L, (SeekOrigin)0);1464		ZipArchive archive = new ZipArchive((Stream)(object)m, (ZipArchiveMode)2);1465		try1466		{1467			System.Collections.Generic.IEnumerator<IEntity> enumerator = ((System.Collections.Generic.IEnumerable<IEntity>)entries).GetEnumerator();1468			try1469			{1470				while (((System.Collections.IEnumerator)enumerator).MoveNext())1471				{1472					IEntity current = enumerator.Current;1473					string updateFileName = current.GetValue<string>("FileName");1474					if (string.Equals(updateFileName, "UpdateBase.zip", (StringComparison)5))1475					{1476						continue;1477					}1478					byte[] array2 = await current.GetValueAsync<byte[]>("FileContent", ct).ConfigureAwait(false);1479					if (array2 == null || array2.Length == 0)1480					{1481						log.Debug("{UpdateFile} is empty -> do not create Update.zip", updateFileName);1482						return System.Array.Empty<byte>();1483					}1484					MemoryStream zipStream = new MemoryStream(array2);1485					try1486					{1487						ZipArchive zip = new ZipArchive((Stream)(object)zipStream, (ZipArchiveMode)0);1488						try1489						{1490							System.Collections.Generic.IEnumerator<ZipArchiveEntry> enumerator2 = zip.Entries.GetEnumerator();1491							try1492							{1493								while (((System.Collections.IEnumerator)enumerator2).MoveNext())1494								{1495									ZipArchiveEntry current2 = enumerator2.Current;1496									if (archive.GetEntry(current2.Name) != null)1497									{1498										continue;1499									}1500									ZipArchiveEntry val = archive.CreateEntry(current2.Name);1501									Stream i = current2.Open();1502									try1503									{1504										Stream o = val.Open();1505										try1506										{1507											await i.CopyToAsync(o, ct).ConfigureAwait(false);1508										}1509										finally1510										{1511											((System.IDisposable)o)?.Dispose();1512										}1513									}1514									finally1515									{1516										((System.IDisposable)i)?.Dispose();1517									}1518								}1519							}1520							finally1521							{1522								((System.IDisposable)enumerator2)?.Dispose();1523							}1524						}1525						finally1526						{1527							((System.IDisposable)zip)?.Dispose();1528						}1529					}1530					finally1531					{1532						((System.IDisposable)zipStream)?.Dispose();1533					}1534				}1535			}1536			finally1537			{1538				((System.IDisposable)enumerator)?.Dispose();1539			}1540		}1541		finally1542		{1543			((System.IDisposable)archive)?.Dispose();1544		}1545		return m.ToArray();1546	}1547}1548