| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863 |
- 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<WeakReference> SharedDrawingManager_1455;
- private static Dictionary<string, List<DrawingToolInfo>> SharedDrawingManager_1456;
- private static List<DrawingToolInfo> SharedDrawingManager_1457;
- private static Dictionary<Guid, DrawingToolInfo> SharedDrawingManager_1458;
- private static Dictionary<string, string> 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.SharedDrawingManager_274> 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<WeakReference> 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<WeakReference>();
- SharedDrawingManager.SharedDrawingManager_1456 = new Dictionary<string, List<DrawingToolInfo>>();
- SharedDrawingManager.SharedDrawingManager_1457 = new List<DrawingToolInfo>();
- SharedDrawingManager.SharedDrawingManager_1458 = new Dictionary<Guid, DrawingToolInfo>();
- SharedDrawingManager.SharedDrawingManager_1459 = new Dictionary<string, string>();
- //SharedDrawingManager.SharedDrawingManager_1465 = new ChartsWithDrawingWatchList();
- SharedDrawingManager.SharedDrawingManager_1466 = RuntimeHelpers.GetObjectValue(new object());
- SharedDrawingManager.SharedDrawingManager_1467 = new List<SharedDrawingManager.SharedDrawingManager_274>();
- 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<DrawingToolInfo> GetDrawingsForSymbol(string symbolName)
- {
- object sharedDrawingManager_ = SharedDrawingManager.SharedDrawingManager_1466;
- //ObjectFlowControl.CheckForSyncLockOnValueType(sharedDrawingManager_);
- Monitor.Enter(sharedDrawingManager_);
- List<DrawingToolInfo> 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<DrawingToolInfo>();
- }
- }
- finally
- {
- Monitor.Exit(sharedDrawingManager_);
- }
- return result;
- }
- public static List<DrawingToolInfo> 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<DrawingToolInfo> drawings)
- {
- bool flag = SharedDrawingManager.SharedDrawingManager_1456.ContainsKey(symbol);
- if (flag)
- {
- List<DrawingToolInfo> list = new List<DrawingToolInfo>();
- list.AddRange(SharedDrawingManager.SharedDrawingManager_1456[symbol]);
- SharedDrawingManager.SharedDrawingManager_1456[symbol].Clear();
- try
- {
- List<DrawingToolInfo>.Enumerator enumerator = list.GetEnumerator();
- while (enumerator.MoveNext())
- {
- DrawingToolInfo current = enumerator.Current;
- SharedDrawingManager.SharedDrawingManager_1458.Remove(current.DrawingGUID);
- }
- }
- finally
- {
- //List<DrawingToolInfo>.Enumerator enumerator;
- //enumerator.Dispose();
- }
- }
- try
- {
- List<DrawingToolInfo>.Enumerator enumerator2 = drawings.GetEnumerator();
- while (enumerator2.MoveNext())
- {
- DrawingToolInfo current2 = enumerator2.Current;
- SharedDrawingManager.SharedDrawingManager_2879(current2, false);
- }
- }
- finally
- {
- //List<DrawingToolInfo>.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<DrawingToolInfo>());
- }
- 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<DrawingToolInfo> list = new List<DrawingToolInfo>();
- try
- {
- List<DrawingToolInfo>.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<DrawingToolInfo>.Enumerator enumerator;
- //enumerator.Dispose();
- }
- try
- {
- List<DrawingToolInfo>.Enumerator enumerator2 = list.GetEnumerator();
- while (enumerator2.MoveNext())
- {
- DrawingToolInfo current2 = enumerator2.Current;
- SharedDrawingManager.SharedDrawingManager_1456[Info.Symbol].Remove(current2);
- }
- }
- finally
- {
- //List<DrawingToolInfo>.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<DrawingToolInfo> list2 = new List<DrawingToolInfo>();
- try
- {
- List<DrawingToolInfo>.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<DrawingToolInfo>.Enumerator enumerator3;
- //enumerator3.Dispose();
- }
- try
- {
- List<DrawingToolInfo>.Enumerator enumerator4 = list2.GetEnumerator();
- while (enumerator4.MoveNext())
- {
- DrawingToolInfo current4 = enumerator4.Current;
- SharedDrawingManager.SharedDrawingManager_1457.Remove(current4);
- }
- }
- finally
- {
- //List<DrawingToolInfo>.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<SharedDrawingManager.SharedDrawingManager_274> list = new List<SharedDrawingManager.SharedDrawingManager_274>();
- try
- {
- List<SharedDrawingManager.SharedDrawingManager_274>.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<SharedDrawingManager.SharedDrawingManager_274>.Enumerator enumerator;
- ////enumerator.Dispose();
- }
- try
- {
- List<SharedDrawingManager.SharedDrawingManager_274>.Enumerator enumerator2 = list.GetEnumerator();
- while (enumerator2.MoveNext())
- {
- SharedDrawingManager.SharedDrawingManager_274 current2 = enumerator2.Current;
- SharedDrawingManager.SharedDrawingManager_1467.Remove(current2);
- }
- }
- finally
- {
- //List<SharedDrawingManager.SharedDrawingManager_274>.Enumerator enumerator2;
- //////enumerator2.Dispose();
- }
- SharedDrawingManager.SharedDrawingManager_1467.Add(aUpdate);
- }
- finally
- {
- Monitor.Exit(sharedDrawingManager_);
- }
- }
- private static void SharedDrawingManager_2891()
- {
- List<SharedDrawingManager.SharedDrawingManager_274> list = new List<SharedDrawingManager.SharedDrawingManager_274>();
- 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<Guid, SharedDrawingManager.SharedDrawingManager_275> dictionary = new Dictionary<Guid, SharedDrawingManager.SharedDrawingManager_275>();
- try
- {
- List<SharedDrawingManager.SharedDrawingManager_274>.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<SharedDrawingManager.SharedDrawingManager_274>.Enumerator enumerator;
- //enumerator.Dispose();
- }
- MemoryStream memoryStream = new MemoryStream();
- try
- {
- BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
- try
- {
- bool flag2;
- try
- {
- List<SharedDrawingManager.SharedDrawingManager_274>.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<SharedDrawingManager.SharedDrawingManager_274>.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();
- // }
- //}
- }
- }
|