using MuchInfo.Chart.Data; using System; using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; using System.Threading; namespace MuchInfo.Chart.WPF.Helpers { public class SharedDrawingManager { public delegate void DrawingsChangedForSymEventHandler(string symbol); public delegate void AnyDrawingChangedEventHandler(); public delegate void DrawingChangedEventHandler(DrawingToolInfo info); public delegate void AllDrawingsChangedEventHandler(); public delegate void SymbolsWithDrawingsChangedEventHandler(); public class SharedDrawingManager_274 { public enum SharedDrawingManager_274_276 { SharedDrawingManager_274_276_1483, SharedDrawingManager_274_276_1484, SharedDrawingManager_274_276_1485 } public SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276 SharedDrawingManager_274_1476; public DrawingToolInfo SharedDrawingManager_274_1477; public int SharedDrawingManager_274_1478; public DateTime SharedDrawingManager_274_1479; public SharedDrawingManager_274(SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276 aMode, DrawingToolInfo aItem) { this.SharedDrawingManager_274_1478 = 0; this.SharedDrawingManager_274_1479 = DateTime.Now; this.SharedDrawingManager_274_1476 = aMode; this.SharedDrawingManager_274_1477 = aItem; } } public class SharedDrawingManager_275 { public bool SharedDrawingManager_275_1480; public bool SharedDrawingManager_275_1481; public SharedDrawingManager_275() { this.SharedDrawingManager_275_1480 = false; this.SharedDrawingManager_275_1481 = false; } public bool SharedDrawingManager_275_2921() { return this.SharedDrawingManager_275_1480 && this.SharedDrawingManager_275_1481; } } private static List SharedDrawingManager_1455; private static Dictionary> SharedDrawingManager_1456; private static List SharedDrawingManager_1457; private static Dictionary SharedDrawingManager_1458; private static Dictionary SharedDrawingManager_1459; private static SharedDrawingManager.DrawingsChangedForSymEventHandler SharedDrawingManager_1460; private static SharedDrawingManager.AnyDrawingChangedEventHandler SharedDrawingManager_1461; private static SharedDrawingManager.DrawingChangedEventHandler SharedDrawingManager_1462; private static SharedDrawingManager.AllDrawingsChangedEventHandler SharedDrawingManager_1463; private static SharedDrawingManager.SymbolsWithDrawingsChangedEventHandler SharedDrawingManager_1464; //private static ChartsWithDrawingWatchList SharedDrawingManager_1465; private static object SharedDrawingManager_1466; private static List SharedDrawingManager_1467; //private static SharedDrawingDataRequest SharedDrawingManager_1468; private static object SharedDrawingManager_1470; public static event SharedDrawingManager.DrawingsChangedForSymEventHandler DrawingsChangedForSym { add { SharedDrawingManager.SharedDrawingManager_1460 = (SharedDrawingManager.DrawingsChangedForSymEventHandler)Delegate.Combine(SharedDrawingManager.SharedDrawingManager_1460, value); } remove { SharedDrawingManager.SharedDrawingManager_1460 = (SharedDrawingManager.DrawingsChangedForSymEventHandler)Delegate.Remove(SharedDrawingManager.SharedDrawingManager_1460, value); } } public static event SharedDrawingManager.AnyDrawingChangedEventHandler AnyDrawingChanged { [MethodImpl(32)] add { SharedDrawingManager.SharedDrawingManager_1461 = (SharedDrawingManager.AnyDrawingChangedEventHandler)Delegate.Combine(SharedDrawingManager.SharedDrawingManager_1461, value); } [MethodImpl(32)] remove { SharedDrawingManager.SharedDrawingManager_1461 = (SharedDrawingManager.AnyDrawingChangedEventHandler)Delegate.Remove(SharedDrawingManager.SharedDrawingManager_1461, value); } } public static event SharedDrawingManager.DrawingChangedEventHandler DrawingChanged { [MethodImpl(32)] add { SharedDrawingManager.SharedDrawingManager_1462 = (SharedDrawingManager.DrawingChangedEventHandler)Delegate.Combine(SharedDrawingManager.SharedDrawingManager_1462, value); } [MethodImpl(32)] remove { SharedDrawingManager.SharedDrawingManager_1462 = (SharedDrawingManager.DrawingChangedEventHandler)Delegate.Remove(SharedDrawingManager.SharedDrawingManager_1462, value); } } public static event SharedDrawingManager.AllDrawingsChangedEventHandler AllDrawingsChanged { [MethodImpl(32)] add { SharedDrawingManager.SharedDrawingManager_1463 = (SharedDrawingManager.AllDrawingsChangedEventHandler)Delegate.Combine(SharedDrawingManager.SharedDrawingManager_1463, value); } [MethodImpl(32)] remove { SharedDrawingManager.SharedDrawingManager_1463 = (SharedDrawingManager.AllDrawingsChangedEventHandler)Delegate.Remove(SharedDrawingManager.SharedDrawingManager_1463, value); } } public static event SharedDrawingManager.SymbolsWithDrawingsChangedEventHandler SymbolsWithDrawingsChanged { [MethodImpl(32)] add { SharedDrawingManager.SharedDrawingManager_1464 = (SharedDrawingManager.SymbolsWithDrawingsChangedEventHandler)Delegate.Combine(SharedDrawingManager.SharedDrawingManager_1464, value); } [MethodImpl(32)] remove { SharedDrawingManager.SharedDrawingManager_1464 = (SharedDrawingManager.SymbolsWithDrawingsChangedEventHandler)Delegate.Remove(SharedDrawingManager.SharedDrawingManager_1464, value); } } public SharedDrawingManager() { SharedDrawingManager.SharedDrawingManager_2857(this); } private static void SharedDrawingManager_2857(object value) { List sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1455; Monitor.Enter(sharedDrawingManager_); checked { try { bool flag = SharedDrawingManager.SharedDrawingManager_1455.Count == SharedDrawingManager.SharedDrawingManager_1455.Capacity; if (flag) { int num = 0; int arg_51_0 = 0; int num2 = SharedDrawingManager.SharedDrawingManager_1455.Count - 1; int num3 = arg_51_0; while (true) { int arg_A2_0 = num3; int num4 = num2; if (arg_A2_0 > num4) { break; } WeakReference weakReference = SharedDrawingManager.SharedDrawingManager_1455[num3]; flag = weakReference.IsAlive; if (flag) { bool flag2 = num3 != num; if (flag2) { SharedDrawingManager.SharedDrawingManager_1455[num] = (SharedDrawingManager.SharedDrawingManager_1455[num3]); } num++; } num3++; } SharedDrawingManager.SharedDrawingManager_1455.RemoveRange(num, SharedDrawingManager.SharedDrawingManager_1455.Count - num); SharedDrawingManager.SharedDrawingManager_1455.Capacity = (SharedDrawingManager.SharedDrawingManager_1455.Count); } SharedDrawingManager.SharedDrawingManager_1455.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value))); } finally { Monitor.Exit(sharedDrawingManager_); } } } static SharedDrawingManager() { SharedDrawingManager.SharedDrawingManager_1455 = new List(); SharedDrawingManager.SharedDrawingManager_1456 = new Dictionary>(); SharedDrawingManager.SharedDrawingManager_1457 = new List(); SharedDrawingManager.SharedDrawingManager_1458 = new Dictionary(); SharedDrawingManager.SharedDrawingManager_1459 = new Dictionary(); //SharedDrawingManager.SharedDrawingManager_1465 = new ChartsWithDrawingWatchList(); SharedDrawingManager.SharedDrawingManager_1466 = RuntimeHelpers.GetObjectValue(new object()); SharedDrawingManager.SharedDrawingManager_1467 = new List(); SharedDrawingManager.SharedDrawingManager_1470 = RuntimeHelpers.GetObjectValue(new object()); // SharedDrawingManager.SharedDrawingManager_2892(); //bool flag = true; UserDataManager.LoggedIn() && UserDataManager.KuberID.HasValue; //if (flag) //{ // SharedDrawingManager.SharedDrawingManager_2881(); // SharedDrawingManager.SharedDrawingManager_2883(); //} //Thread thread = new Thread(new ThreadStart(SharedDrawingManager.SharedDrawingManager_2889)); //thread.IsBackground = (true); //thread.Name = ("Shared Drawing Updater"); //thread.Start(); } private static void SharedDrawingManager_2871() { object sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1470; //ObjectFlowControl.CheckForSyncLockOnValueType(sharedDrawingManager_); Monitor.Enter(sharedDrawingManager_); try { bool flag = true;// UserDataManager.LoggedIn() && UserDataManager.KuberID.HasValue; if (flag) { bool flag2 = SharedDrawingManager.SharedDrawingManager_1467.Count > 0; if (flag2) { //SharedDrawingManager.SharedDrawingManager_1472 = true; } } } finally { Monitor.Exit(sharedDrawingManager_); } SharedDrawingManager.SharedDrawingManager_2872(); } private static void SharedDrawingManager_2872() { object sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1466; //ObjectFlowControl.CheckForSyncLockOnValueType(sharedDrawingManager_); Monitor.Enter(sharedDrawingManager_); bool flag; try { SharedDrawingManager.SharedDrawingManager_1456.Clear(); SharedDrawingManager.SharedDrawingManager_1457.Clear(); SharedDrawingManager.SharedDrawingManager_1458.Clear(); SharedDrawingManager.SharedDrawingManager_1459.Clear(); SharedDrawingManager.AllDrawingsChangedEventHandler sharedDrawingManager_2 = SharedDrawingManager.SharedDrawingManager_1463; flag = (sharedDrawingManager_2 != null); if (flag) { sharedDrawingManager_2(); } SharedDrawingManager.SymbolsWithDrawingsChangedEventHandler sharedDrawingManager_3 = SharedDrawingManager.SharedDrawingManager_1464; flag = (sharedDrawingManager_3 != null); if (flag) { sharedDrawingManager_3(); } SharedDrawingManager.AnyDrawingChangedEventHandler sharedDrawingManager_4 = SharedDrawingManager.SharedDrawingManager_1461; flag = (sharedDrawingManager_4 != null); if (flag) { sharedDrawingManager_4(); } } finally { Monitor.Exit(sharedDrawingManager_); } //flag = true;// (UserDataManager.LoggedIn() && UserDataManager.KuberID.HasValue); //if (flag) //{ // SharedDrawingManager.SharedDrawingManager_2881(); // SharedDrawingManager.SharedDrawingManager_2883(); //} } public static List GetDrawingsForSymbol(string symbolName) { object sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1466; //ObjectFlowControl.CheckForSyncLockOnValueType(sharedDrawingManager_); Monitor.Enter(sharedDrawingManager_); List result; try { bool flag = SharedDrawingManager.SharedDrawingManager_1456.ContainsKey(symbolName); if (flag) { result = SharedDrawingManager.SharedDrawingManager_1456[symbolName]; } else { flag = SharedDrawingManager.SharedDrawingManager_1459.ContainsKey(symbolName); if (flag) { //bool flag2 = true; //UserDataManager.LoggedIn() && UserDataManager.KuberID.HasValue; //if (flag2) //{ // SharedDrawingManager.SharedDrawingManager_273 sharedDrawingManager_2 = new SharedDrawingManager.SharedDrawingManager_273(aSymbolID); //} } result = new List(); } } finally { Monitor.Exit(sharedDrawingManager_); } return result; } public static List GetDrawingsOnAllSymbols() { return SharedDrawingManager.SharedDrawingManager_1457; } public static void AddDrawing(DrawingToolInfo info) { SharedDrawingManager.SharedDrawingManager_2879(info, true); SharedDrawingManager.DrawingsChangedForSymEventHandler sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1460; bool flag = sharedDrawingManager_ != null; if (flag) { sharedDrawingManager_(info.Symbol); } SharedDrawingManager.AnyDrawingChangedEventHandler sharedDrawingManager_2 = SharedDrawingManager.SharedDrawingManager_1461; flag = (sharedDrawingManager_2 != null); if (flag) { sharedDrawingManager_2(); } sharedDrawingManager_2 = SharedDrawingManager.SharedDrawingManager_1461; flag = (sharedDrawingManager_2 != null); if (flag) { sharedDrawingManager_2(); } } public static void UpdateDrawing(DrawingToolInfo info) { object sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1466; //ObjectFlowControl.CheckForSyncLockOnValueType(sharedDrawingManager_); Monitor.Enter(sharedDrawingManager_); try { SharedDrawingManager.SharedDrawingManager_2880(info); SharedDrawingManager.SharedDrawingManager_2879(info, false); SharedDrawingManager.SharedDrawingManager_274 aUpdate = new SharedDrawingManager.SharedDrawingManager_274(SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1484, info); SharedDrawingManager.SharedDrawingManager_2888(aUpdate); info.Updated = DateTime.Now; } finally { Monitor.Exit(sharedDrawingManager_); } SharedDrawingManager.DrawingChangedEventHandler sharedDrawingManager_2 = SharedDrawingManager.SharedDrawingManager_1462; bool flag = sharedDrawingManager_2 != null; if (flag) { sharedDrawingManager_2(info); } SharedDrawingManager.AnyDrawingChangedEventHandler sharedDrawingManager_3 = SharedDrawingManager.SharedDrawingManager_1461; flag = (sharedDrawingManager_3 != null); if (flag) { sharedDrawingManager_3(); } } public static void DeleteDrawing(DrawingToolInfo info) { object sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1466; //ObjectFlowControl.CheckForSyncLockOnValueType(sharedDrawingManager_); Monitor.Enter(sharedDrawingManager_); try { SharedDrawingManager.SharedDrawingManager_2880(info); SharedDrawingManager.SharedDrawingManager_274 aUpdate = new SharedDrawingManager.SharedDrawingManager_274(SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1485, info); SharedDrawingManager.SharedDrawingManager_2888(aUpdate); } finally { Monitor.Exit(sharedDrawingManager_); } SharedDrawingManager.DrawingsChangedForSymEventHandler sharedDrawingManager_2 = SharedDrawingManager.SharedDrawingManager_1460; bool flag = sharedDrawingManager_2 != null; if (flag) { sharedDrawingManager_2(info.Symbol); } flag = info.DrawOnAllSymbols; if (flag) { sharedDrawingManager_2 = SharedDrawingManager.SharedDrawingManager_1460; flag = (sharedDrawingManager_2 != null); if (flag) { sharedDrawingManager_2(null); } } SharedDrawingManager.AnyDrawingChangedEventHandler sharedDrawingManager_3 = SharedDrawingManager.SharedDrawingManager_1461; flag = (sharedDrawingManager_3 != null); if (flag) { sharedDrawingManager_3(); } } private static void SharedDrawingManager_2878(string symbol, List drawings) { bool flag = SharedDrawingManager.SharedDrawingManager_1456.ContainsKey(symbol); if (flag) { List list = new List(); list.AddRange(SharedDrawingManager.SharedDrawingManager_1456[symbol]); SharedDrawingManager.SharedDrawingManager_1456[symbol].Clear(); try { List.Enumerator enumerator = list.GetEnumerator(); while (enumerator.MoveNext()) { DrawingToolInfo current = enumerator.Current; SharedDrawingManager.SharedDrawingManager_1458.Remove(current.DrawingGUID); } } finally { //List.Enumerator enumerator; //enumerator.Dispose(); } } try { List.Enumerator enumerator2 = drawings.GetEnumerator(); while (enumerator2.MoveNext()) { DrawingToolInfo current2 = enumerator2.Current; SharedDrawingManager.SharedDrawingManager_2879(current2, false); } } finally { //List.Enumerator enumerator2; ////enumerator2.Dispose(); } SharedDrawingManager.DrawingsChangedForSymEventHandler sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1460; flag = (sharedDrawingManager_ != null); if (flag) { sharedDrawingManager_(symbol); } SharedDrawingManager.AnyDrawingChangedEventHandler sharedDrawingManager_2 = SharedDrawingManager.SharedDrawingManager_1461; flag = (sharedDrawingManager_2 != null); if (flag) { sharedDrawingManager_2(); } } private static void SharedDrawingManager_2879(DrawingToolInfo info, bool AddToDB) { object sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1466; //ObjectFlowControl.CheckForSyncLockOnValueType(sharedDrawingManager_); Monitor.Enter(sharedDrawingManager_); try { if (info == null || string.IsNullOrWhiteSpace(info.Symbol)) return; bool flag = !info.DrawOnAllSymbols; bool flag2; if (flag) { flag2 = !SharedDrawingManager.SharedDrawingManager_1459.ContainsKey(info.Symbol); if (flag2) { SharedDrawingManager.SharedDrawingManager_1459[info.Symbol] = info.Symbol; } flag2 = !SharedDrawingManager.SharedDrawingManager_1456.ContainsKey(info.Symbol); if (flag2) { SharedDrawingManager.SharedDrawingManager_1456.Add(info.Symbol, new List()); } SharedDrawingManager.SharedDrawingManager_1456[info.Symbol].Add(info); } else { SharedDrawingManager.SharedDrawingManager_1457.Add(info); } SharedDrawingManager.SharedDrawingManager_1458[info.DrawingGUID] = (info); if (AddToDB) { SharedDrawingManager.SharedDrawingManager_274 aUpdate = new SharedDrawingManager.SharedDrawingManager_274(SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1483, info); SharedDrawingManager.SharedDrawingManager_2888(aUpdate); } SharedDrawingManager.SymbolsWithDrawingsChangedEventHandler sharedDrawingManager_2 = SharedDrawingManager.SharedDrawingManager_1464; flag2 = (sharedDrawingManager_2 != null); if (flag2) { sharedDrawingManager_2(); } } finally { Monitor.Exit(sharedDrawingManager_); } } private static void SharedDrawingManager_2880(DrawingToolInfo Info) { bool flag = SharedDrawingManager.SharedDrawingManager_1458.ContainsKey(Info.DrawingGUID); if (flag) { try { SharedDrawingManager.SharedDrawingManager_1458.Remove(Info.DrawingGUID); } catch (Exception ex) { throw ex; } } flag = SharedDrawingManager.SharedDrawingManager_1456.ContainsKey(Info.Symbol); if (flag) { try { List list = new List(); try { List.Enumerator enumerator = SharedDrawingManager.SharedDrawingManager_1456[Info.Symbol].GetEnumerator(); while (enumerator.MoveNext()) { DrawingToolInfo current = enumerator.Current; flag = (current.DrawingGUID == Info.DrawingGUID); if (flag) { list.Add(current); } } } finally { //List.Enumerator enumerator; //enumerator.Dispose(); } try { List.Enumerator enumerator2 = list.GetEnumerator(); while (enumerator2.MoveNext()) { DrawingToolInfo current2 = enumerator2.Current; SharedDrawingManager.SharedDrawingManager_1456[Info.Symbol].Remove(current2); } } finally { //List.Enumerator enumerator2; ////enumerator2.Dispose(); } flag = (SharedDrawingManager.SharedDrawingManager_1456[Info.Symbol].Count == 0); if (flag) { SharedDrawingManager.SharedDrawingManager_1459.Remove(Info.Symbol); try { SharedDrawingManager.SymbolsWithDrawingsChangedEventHandler sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1464; flag = (sharedDrawingManager_ != null); if (flag) { sharedDrawingManager_(); } } catch (Exception ex) { throw ex; } } } catch (Exception ex) { throw ex; } } try { List list2 = new List(); try { List.Enumerator enumerator3 = SharedDrawingManager.SharedDrawingManager_1457.GetEnumerator(); while (enumerator3.MoveNext()) { DrawingToolInfo current3 = enumerator3.Current; flag = (current3.DrawingGUID == Info.DrawingGUID); if (flag) { list2.Add(current3); } } } finally { //List.Enumerator enumerator3; //enumerator3.Dispose(); } try { List.Enumerator enumerator4 = list2.GetEnumerator(); while (enumerator4.MoveNext()) { DrawingToolInfo current4 = enumerator4.Current; SharedDrawingManager.SharedDrawingManager_1457.Remove(current4); } } finally { //List.Enumerator enumerator4; //enumerator4.Dispose(); } } catch (Exception ex) { throw ex; } } public static void ShutDown() { SharedDrawingManager.SharedDrawingManager_2891(); } private static void SharedDrawingManager_2888(SharedDrawingManager.SharedDrawingManager_274 aUpdate) { object sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1470; //ObjectFlowControl.CheckForSyncLockOnValueType(sharedDrawingManager_); Monitor.Enter(sharedDrawingManager_); try { List list = new List(); try { List.Enumerator enumerator = SharedDrawingManager.SharedDrawingManager_1467.GetEnumerator(); while (enumerator.MoveNext()) { SharedDrawingManager.SharedDrawingManager_274 current = enumerator.Current; bool flag = current.SharedDrawingManager_274_1476 == SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1484 && current.SharedDrawingManager_274_1477.DrawingGUID == aUpdate.SharedDrawingManager_274_1477.DrawingGUID; if (flag) { list.Add(current); } } } finally { //List.Enumerator enumerator; ////enumerator.Dispose(); } try { List.Enumerator enumerator2 = list.GetEnumerator(); while (enumerator2.MoveNext()) { SharedDrawingManager.SharedDrawingManager_274 current2 = enumerator2.Current; SharedDrawingManager.SharedDrawingManager_1467.Remove(current2); } } finally { //List.Enumerator enumerator2; //////enumerator2.Dispose(); } SharedDrawingManager.SharedDrawingManager_1467.Add(aUpdate); } finally { Monitor.Exit(sharedDrawingManager_); } } private static void SharedDrawingManager_2891() { List list = new List(); list.AddRange(SharedDrawingManager.SharedDrawingManager_1467); bool flag; try { //flag = IsoStore.FileExists("PendingDrawz.dat"); //if (flag) //{ // IsoStore.DeleteFile("PendingDrawz.dat"); //} } catch (Exception ex) { throw ex; } flag = (list.Count == 0); if (!flag) { try { Dictionary dictionary = new Dictionary(); try { List.Enumerator enumerator = list.GetEnumerator(); while (enumerator.MoveNext()) { SharedDrawingManager.SharedDrawingManager_274 current = enumerator.Current; flag = (current.SharedDrawingManager_274_1476 == SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1483 || current.SharedDrawingManager_274_1476 == SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1485); if (flag) { bool flag2 = !dictionary.ContainsKey(current.SharedDrawingManager_274_1477.DrawingGUID); if (flag2) { dictionary.Add(current.SharedDrawingManager_274_1477.DrawingGUID, new SharedDrawingManager.SharedDrawingManager_275()); } flag2 = (current.SharedDrawingManager_274_1476 == SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1483); if (flag2) { dictionary[current.SharedDrawingManager_274_1477.DrawingGUID].SharedDrawingManager_275_1480 = true; } flag2 = (current.SharedDrawingManager_274_1476 == SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1485); if (flag2) { dictionary[current.SharedDrawingManager_274_1477.DrawingGUID].SharedDrawingManager_275_1481 = true; } } } } finally { //List.Enumerator enumerator; //enumerator.Dispose(); } MemoryStream memoryStream = new MemoryStream(); try { BinaryWriter binaryWriter = new BinaryWriter(memoryStream); try { bool flag2; try { List.Enumerator enumerator2 = list.GetEnumerator(); while (enumerator2.MoveNext()) { SharedDrawingManager.SharedDrawingManager_274 current2 = enumerator2.Current; flag2 = (dictionary.ContainsKey(current2.SharedDrawingManager_274_1477.DrawingGUID) && dictionary[current2.SharedDrawingManager_274_1477.DrawingGUID].SharedDrawingManager_275_2921()); if (!flag2) { binaryWriter.Write((int)current2.SharedDrawingManager_274_1476); current2.SharedDrawingManager_274_1477.toBytes(binaryWriter); } } } finally { //List.Enumerator enumerator2; ////enumerator2.Dispose(); } flag2 = (memoryStream.Length > 0L); if (flag2) { //MemoryStream memoryStream2 = Zipper.ZipToMS(memoryStream.ToArray()); //try //{ // byte[] data = memoryStream2.ToArray(); // IsoStore.SaveBinaryData(data, "PendingDrawz.dat"); //} //finally //{ // flag2 = (memoryStream2 != null); // if (flag2) // { // memoryStream2.Dispose(); // } //} } } finally { bool flag2 = binaryWriter != null; if (flag2) { binaryWriter.Dispose(); } } } finally { bool flag2 = memoryStream != null; if (flag2) { memoryStream.Dispose(); } } } catch (Exception ex) { throw ex; } } } //private static void SharedDrawingManager_2892() //{ // try // { // bool flag = IsoStore.FileExists("PendingDrawz.dat"); // if (flag) // { // byte[] data = IsoStore.LoadBinaryData("PendingDrawz.dat"); // MemoryStream memoryStream = Zipper.UnzipToMS(data); // try // { // BinaryReader binaryReader = new BinaryReader(memoryStream); // try // { // while (memoryStream.Position < memoryStream.Length) // { // SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276 sharedDrawingManager_274_ = (SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276)binaryReader.ReadInt32(); // DrawingToolInfo info = DrawingToolInfo.fromBytes(binaryReader); // switch (sharedDrawingManager_274_) // { // case SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1483: // SharedDrawingManager.SharedDrawingManager_2879(info, true); // break; // case SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1484: // SharedDrawingManager.UpdateDrawing(info); // break; // case SharedDrawingManager.SharedDrawingManager_274.SharedDrawingManager_274_276.SharedDrawingManager_274_276_1485: // SharedDrawingManager.DeleteDrawing(info); // break; // } // } // } // finally // { // flag = (binaryReader != null); // if (flag) // { // binaryReader.Dispose(); // } // } // } // finally // { // flag = (memoryStream != null); // if (flag) // { // memoryStream.Dispose(); // } // } // SharedDrawingManager.SharedDrawingManager_1472 = true; // } // } // catch (Exception expr_12E) // { // ProjectData.SetProjectError(expr_12E); // ProjectData.ClearProjectError(); // } //} } }