TSB.Customizer/TSB.Customizer/AlternatePropertyCaptionsEntityLogic.cs
Decompiler Source FileTSB.Customizer.AlternatePropertyCaptionsEntityLogicDecompiled Source
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- Function registration: GetAlternateCaptions at line 91
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.
None extracted.
Summary: classes AlternatePropertyCaptionsEntityLogic; methods MoveNext, SetStateMachine, OnSavedAsync
Classes
AlternatePropertyCaptionsEntityLogicDB/Dialog object references
None extracted.
OIM key/entity markers
None extracted.API/entity calls
ContainsRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections.Generic;3using System.Diagnostics;4using System.Linq;5using System.Runtime.CompilerServices;6using System.Runtime.InteropServices;7using System.Threading;8using System.Threading.Tasks;9using QBM.Customizer;10using VI.DB;11using VI.DB.Entities;1213namespace TSB.Customizer;1415[Obsolete("Use QBM.Customizer.AlternateCaptionsEntityLogic instead.")]16public class AlternatePropertyCaptionsEntityLogic : StateLessEntityLogic17{18 [StructLayout((LayoutKind)3)]19 [CompilerGenerated]20 private struct _003C_GetAlternateCaptions_003Ed__1 : IAsyncStateMachine21 {22 public int _003C_003E1__state;2324 public AsyncTaskMethodBuilder<Dictionary<string, string>> _003C_003Et__builder;2526 public ISession s;2728 public IEntity e;2930 public CancellationToken ct;3132 private ConfiguredTaskAwaiter<IAlternateCaption?> _003C_003Eu__1;3334 private void MoveNext()35 {36 //IL_0064: Unknown result type (might be due to invalid IL or missing references)37 //IL_0069: Unknown result type (might be due to invalid IL or missing references)38 //IL_0070: Unknown result type (might be due to invalid IL or missing references)39 //IL_001d: Unknown result type (might be due to invalid IL or missing references)40 //IL_0028: Unknown result type (might be due to invalid IL or missing references)41 //IL_002d: Unknown result type (might be due to invalid IL or missing references)42 //IL_0031: Unknown result type (might be due to invalid IL or missing references)43 //IL_0036: Unknown result type (might be due to invalid IL or missing references)44 //IL_004a: Unknown result type (might be due to invalid IL or missing references)45 //IL_004b: Unknown result type (might be due to invalid IL or missing references)46 int num = _003C_003E1__state;47 Dictionary<string, string> result;48 try49 {50 ConfiguredTaskAwaiter<IAlternateCaption> val;51 if (num != 0)52 {53 val = AlternateCaptionsService.GetOrAdd(s).GetAlternateCaptionAsync(e, returnDefaults: false, ct).ConfigureAwait(false)54 .GetAwaiter();55 if (!val.IsCompleted)56 {57 num = (_003C_003E1__state = 0);58 _003C_003Eu__1 = val;59 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IAlternateCaption>, _003C_GetAlternateCaptions_003Ed__1>(ref val, ref this);60 return;61 }62 }63 else64 {65 val = _003C_003Eu__1;66 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IAlternateCaption>);67 num = (_003C_003E1__state = -1);68 }69 IReadOnlyDictionary<string, string> val2 = val.GetResult()?.Columns;70 result = ((val2 != null) ? Enumerable.ToDictionary<KeyValuePair<string, string>, string, string>((System.Collections.Generic.IEnumerable<KeyValuePair<string, string>>)val2, (Func<KeyValuePair<string, string>, string>)((KeyValuePair<string, string> kvp) => kvp.Key), (Func<KeyValuePair<string, string>, string>)((KeyValuePair<string, string> kvp) => kvp.Value), (IEqualityComparer<string>)(object)StringComparer.OrdinalIgnoreCase) : null);71 }72 catch (System.Exception exception)73 {74 _003C_003E1__state = -2;75 _003C_003Et__builder.SetException(exception);76 return;77 }78 _003C_003E1__state = -2;79 _003C_003Et__builder.SetResult(result);80 }8182 [DebuggerHidden]83 private void SetStateMachine(IAsyncStateMachine stateMachine)84 {85 _003C_003Et__builder.SetStateMachine(stateMachine);86 }87 }8889 public AlternatePropertyCaptionsEntityLogic(EntityLogicConstructionParameters ep)90 {91 RegisterFunction("GetAlternateCaptions").As<Dictionary<string, string>>(_GetAlternateCaptions).Behavior(MethodBehavior.ValidForReadOnlyUser);92 }9394 [AsyncStateMachine(typeof(_003C_GetAlternateCaptions_003Ed__1))]95 public async System.Threading.Tasks.Task<Dictionary<string, string>?> _GetAlternateCaptions(ISession s, IEntity e, CancellationToken ct)96 {97 //IL_0002: Unknown result type (might be due to invalid IL or missing references)98 //IL_0007: Unknown result type (might be due to invalid IL or missing references)99 //IL_001e: Unknown result type (might be due to invalid IL or missing references)100 //IL_001f: Unknown result type (might be due to invalid IL or missing references)101 IReadOnlyDictionary<string, string> val = (await AlternateCaptionsService.GetOrAdd(s).GetAlternateCaptionAsync(e, returnDefaults: false, ct).ConfigureAwait(false))?.Columns;102 if (val == null)103 {104 return null;105 }106 return Enumerable.ToDictionary<KeyValuePair<string, string>, string, string>((System.Collections.Generic.IEnumerable<KeyValuePair<string, string>>)val, (Func<KeyValuePair<string, string>, string>)((KeyValuePair<string, string> kvp) => kvp.Key), (Func<KeyValuePair<string, string>, string>)((KeyValuePair<string, string> kvp) => kvp.Value), (IEqualityComparer<string>)(object)StringComparer.OrdinalIgnoreCase);107 }108109 public override System.Threading.Tasks.Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)110 {111 //IL_0041: Unknown result type (might be due to invalid IL or missing references)112 if (entity.Contains("AlternatePropertyCaptions") && entity.Columns["AlternatePropertyCaptions"].IsDifferent && parameters.Session.Services.TryResolve<AlternateCaptionsService>(out var ret))113 {114 ret.Clear();115 }116 return base.OnSavedAsync(entity, parameters, ct);117 }118}119