using MuchInfo.Chart.Data.Interfaces; using MuchInfo.Chart.WPF.Helpers; using MuchInfo.Chart.WPF.Primitives.Interfaces; using System; using System.Collections.Generic; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Threading; namespace MuchInfo.Chart.WPF.Primitives { public class OutputDataWrapper : ILineDataSetWithUid, IDeletable { private static List OutputDataWrapper_503 = new List(); private ILineDataSet OutputDataWrapper_504; /// /// NewGuid /// private Guid OutputDataWrapper_505; private LineDataSetDataChangedEventHandler OutputDataWrapper_506; public event LineDataSetDataChangedEventHandler DataChanged { add { this.OutputDataWrapper_506 = (LineDataSetDataChangedEventHandler)Delegate.Combine(this.OutputDataWrapper_506, value); } remove { this.OutputDataWrapper_506 = (LineDataSetDataChangedEventHandler)Delegate.Remove(this.OutputDataWrapper_506, value); } } public virtual ILineDataSet mDat { get { return this.OutputDataWrapper_504; } [MethodImpl(32)] set { LineDataSetDataChangedEventHandler dataChangedEventHandler = new LineDataSetDataChangedEventHandler(this.OutputDataWrapper_2184); bool flag = this.OutputDataWrapper_504 != null; if (flag) { this.OutputDataWrapper_504.DataChanged -= (dataChangedEventHandler); } this.OutputDataWrapper_504 = value; flag = (this.OutputDataWrapper_504 != null); if (flag) { this.OutputDataWrapper_504.DataChanged += (dataChangedEventHandler); } } } internal Guid DataGUID { get { return this.OutputDataWrapper_505; } set { this.OutputDataWrapper_505 = value; } } [DebuggerNonUserCode] private static void OutputDataWrapper_2173(object value) { List outputDataWrapper_ = OutputDataWrapper.OutputDataWrapper_503; Monitor.Enter(outputDataWrapper_); checked { try { bool flag = OutputDataWrapper.OutputDataWrapper_503.Count == OutputDataWrapper.OutputDataWrapper_503.Capacity; if (flag) { int num = 0; int arg_51_0 = 0; int num2 = OutputDataWrapper.OutputDataWrapper_503.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 = OutputDataWrapper.OutputDataWrapper_503[num3]; flag = weakReference.IsAlive; if (flag) { bool flag2 = num3 != num; if (flag2) { OutputDataWrapper.OutputDataWrapper_503[num] = (OutputDataWrapper.OutputDataWrapper_503[num3]); } num++; } num3++; } OutputDataWrapper.OutputDataWrapper_503.RemoveRange(num, OutputDataWrapper.OutputDataWrapper_503.Count - num); OutputDataWrapper.OutputDataWrapper_503.Capacity = (OutputDataWrapper.OutputDataWrapper_503.Count); } OutputDataWrapper.OutputDataWrapper_503.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value))); } finally { Monitor.Exit(outputDataWrapper_); } } } public OutputDataWrapper() { OutputDataWrapper.OutputDataWrapper_2173(this); this.OutputDataWrapper_505 = Guid.NewGuid(); } internal void OutputDataWrapper_2177(ILineDataSet dat) { this.mDat = dat; LineDataSetDataChangedEventHandler outputDataWrapper_ = this.OutputDataWrapper_506; bool flag = outputDataWrapper_ != null; if (flag) { outputDataWrapper_(null); } } /// /// 返回mDat /// /// internal ILineDataSet OutputDataWrapper_2180() { return this.mDat; } public List Data() { bool flag = this.mDat != null; List result; if (flag) { result = this.mDat.DataPoints; } else { result = null; } return result; } private void OutputDataWrapper_2184(object Change) { LineDataSetDataChangedEventHandler outputDataWrapper_ = this.OutputDataWrapper_506; bool flag = outputDataWrapper_ != null; if (flag) { outputDataWrapper_(null); } } internal void OutputDataWrapper_2185() { LineDataSetDataChangedEventHandler outputDataWrapper_ = this.OutputDataWrapper_506; bool flag = outputDataWrapper_ != null; if (flag) { outputDataWrapper_(new PlotDeletingDataChange()); } } public string UID() { return this.OutputDataWrapper_505.ToString(); } public void OnDelete() { this.mDat = null; } string ILineDataSetWithUid.UID() { throw new NotImplementedException(); } event LineDataSetDataChangedEventHandler ILineDataSet.DataChanged { add { throw new NotImplementedException(); } remove { throw new NotImplementedException(); } } List ILineDataSet.DataPoints { get { return Data(); } set { this.mDat.DataPoints = value; } } void IDeletable.OnDelete() { throw new NotImplementedException(); } } }