using System; using System.Collections.Generic; using msclr; internal class DataClientProxies { public static SortedDictionary s_Proxies = new SortedDictionary(); public static int s_Index = 0; public static object lockit = new object(); public static BufferProperty m_bufferProperty = new BufferProperty(); public static int AddProxy(DataClientProxy dataClientProxy) { @lock obj = null; int result = -1; if (dataClientProxy != null) { @lock obj2 = new @lock(lockit); try { obj = obj2; s_Proxies.Add(s_Index, dataClientProxy); result = s_Index; s_Index++; } catch { //try-fault ((IDisposable)obj).Dispose(); throw; } ((IDisposable)obj).Dispose(); } return result; } public static void RemoveProxy(int index) { @lock obj = null; @lock obj2 = new @lock(lockit); try { obj = obj2; ((IDisposable)GetProxy(index))?.Dispose(); s_Proxies.Remove(index); } catch { //try-fault ((IDisposable)obj).Dispose(); throw; } ((IDisposable)obj).Dispose(); } public static DataClientProxy GetProxy(int index) { @lock obj = null; @lock obj2 = new @lock(lockit); DataClientProxy result; try { obj = obj2; if (s_Proxies[index] != null) { result = s_Proxies[index]; goto IL_0033; } } catch { //try-fault ((IDisposable)obj).Dispose(); throw; } DataClientProxy result2; try { result2 = null; } catch { //try-fault ((IDisposable)obj).Dispose(); throw; } ((IDisposable)obj).Dispose(); return result2; IL_0033: ((IDisposable)obj).Dispose(); return result; } }