From 0440c722a221b8068bbf388c1c0c51f0faff0451 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 14:17:46 -0300 Subject: some dlls --- .../Gestor.Common.Helpers/FindVisualChildren.cs | 195 +++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs (limited to 'Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs') diff --git a/Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs b/Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs new file mode 100644 index 0000000..5b88c0d --- /dev/null +++ b/Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs @@ -0,0 +1,195 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Windows; +using System.Windows.Media; + +namespace Gestor.Common.Helpers; + +public class FindVisualChildren +{ + [CompilerGenerated] + private sealed class _003CFind_003Ed__0 : IEnumerable, IEnumerable, IEnumerator, IDisposable, IEnumerator where T : DependencyObject + { + private int _003C_003E1__state; + + private T _003C_003E2__current; + + private int _003C_003El__initialThreadId; + + private DependencyObject depObj; + + public DependencyObject _003C_003E3__depObj; + + private int _003Ci_003E5__2; + + private DependencyObject _003Cchild_003E5__3; + + private IEnumerator _003C_003E7__wrap3; + + T IEnumerator.Current + { + [DebuggerHidden] + get + { + return _003C_003E2__current; + } + } + + object IEnumerator.Current + { + [DebuggerHidden] + get + { + return _003C_003E2__current; + } + } + + [DebuggerHidden] + public _003CFind_003Ed__0(int _003C_003E1__state) + { + this._003C_003E1__state = _003C_003E1__state; + _003C_003El__initialThreadId = Environment.CurrentManagedThreadId; + } + + [DebuggerHidden] + void IDisposable.Dispose() + { + int num = _003C_003E1__state; + if (num == -3 || num == 2) + { + try + { + } + finally + { + _003C_003Em__Finally1(); + } + } + _003Cchild_003E5__3 = null; + _003C_003E7__wrap3 = null; + _003C_003E1__state = -2; + } + + private bool MoveNext() + { + try + { + switch (_003C_003E1__state) + { + default: + return false; + case 0: + _003C_003E1__state = -1; + if (depObj == null) + { + break; + } + _003Ci_003E5__2 = 0; + goto IL_0107; + case 1: + _003C_003E1__state = -1; + goto IL_0090; + case 2: + { + _003C_003E1__state = -3; + goto IL_00d6; + } + IL_0107: + if (_003Ci_003E5__2 >= VisualTreeHelper.GetChildrenCount(depObj)) + { + break; + } + _003Cchild_003E5__3 = VisualTreeHelper.GetChild(depObj, _003Ci_003E5__2); + if (_003Cchild_003E5__3 != null && _003Cchild_003E5__3 is T) + { + _003C_003E2__current = (T)(object)_003Cchild_003E5__3; + _003C_003E1__state = 1; + return true; + } + goto IL_0090; + IL_0090: + _003C_003E7__wrap3 = Find(_003Cchild_003E5__3).GetEnumerator(); + _003C_003E1__state = -3; + goto IL_00d6; + IL_00d6: + if (_003C_003E7__wrap3.MoveNext()) + { + T current = _003C_003E7__wrap3.Current; + _003C_003E2__current = current; + _003C_003E1__state = 2; + return true; + } + _003C_003Em__Finally1(); + _003C_003E7__wrap3 = null; + _003Cchild_003E5__3 = null; + _003Ci_003E5__2++; + goto IL_0107; + } + return false; + } + catch + { + //try-fault + ((IDisposable)this).Dispose(); + throw; + } + } + + bool IEnumerator.MoveNext() + { + //ILSpy generated this explicit interface implementation from .override directive in MoveNext + return this.MoveNext(); + } + + private void _003C_003Em__Finally1() + { + _003C_003E1__state = -1; + if (_003C_003E7__wrap3 != null) + { + _003C_003E7__wrap3.Dispose(); + } + } + + [DebuggerHidden] + void IEnumerator.Reset() + { + throw new NotSupportedException(); + } + + [DebuggerHidden] + IEnumerator IEnumerable.GetEnumerator() + { + _003CFind_003Ed__0 _003CFind_003Ed__; + if (_003C_003E1__state == -2 && _003C_003El__initialThreadId == Environment.CurrentManagedThreadId) + { + _003C_003E1__state = 0; + _003CFind_003Ed__ = this; + } + else + { + _003CFind_003Ed__ = new _003CFind_003Ed__0(0); + } + _003CFind_003Ed__.depObj = _003C_003E3__depObj; + return _003CFind_003Ed__; + } + + [DebuggerHidden] + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable)this).GetEnumerator(); + } + } + + [IteratorStateMachine(typeof(_003CFind_003Ed__0<>))] + public static IEnumerable Find(DependencyObject depObj) where T : DependencyObject + { + //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() + return new _003CFind_003Ed__0(-2) + { + _003C_003E3__depObj = depObj + }; + } +} -- cgit v1.2.3