using Microsoft.VisualBasic.CompilerServices; using MuchInfo.Chart.Data.EnumTypes; using MuchInfo.Chart.Infrastructure.Helpers; using MuchInfo.Chart.Infrastructure.Utilities; using MuchInfo.Chart.WPF.Helpers; using MuchInfo.Chart.WPF.Primitives.Interfaces; using System; using System.Collections.Generic; using System.Windows; using System.Windows.Media; using System.Windows.Shapes; namespace MuchInfo.Chart.WPF.Primitives.Drawing { public class DrawingVerticalLine : Drawing1PointBase { #region Fields private Line _vLine; #endregion Fields #region Properties #region Public Properties public override string RootName { get { return "DrawVLine"; } } #endregion Public Properties #endregion Properties #region Methods #region Public Methods public override string Abbreviation() { return LanguageManager.FindResource(LanguageConst.DrawingTool_Abbreviation_VerticalLine); } public override List AdditionalEditors() { return new List(); } public override bool CanPlotOnAllSymbols() { return true; } public override bool CanSaveByPercent() { return true; } public override IDrawingTool Clone() { return new DrawingVerticalLine { mColor = Colors.White }; } public override string Description() { return this.MenuDescription(); } public override ImageSource Icon() { ImageSource result; try { result = ImageHelper.GetImage("VLine.png"); } catch (Exception expr_3A) { ProjectData.SetProjectError(expr_3A); result = null; ProjectData.ClearProjectError(); } return result; } public override string MenuDescription() { return LanguageManager.FindResource(LanguageConst.DrawingTool_Edit_Description_VerticalLine); } public override DrawingToolType ToolType() { return DrawingToolType.VLine; } #endregion Public Methods #region Protected Methods protected override void ColorChanged() { bool flag = this._vLine != null; if (flag) { this._vLine.Stroke = (new SolidColorBrush(this.mColor)); } } protected override List GetDrawingPlots(Chart owner, ScaleLayer aScale, Rect aRect) { var list = new List(); this._vLine = new Line { Stroke = new SolidColorBrush(this.mColor), StrokeThickness = 1.4 }; this.MoveDrawingToNewLocations(aRect); list.Add(this._vLine); return list; } protected override void MoveDrawingToNewLocations(Rect aRect) { bool flag = this._vLine != null; if (flag) { this._vLine.X1 = (this.mLastX1); this._vLine.Y1 = (aRect.Top); this._vLine.X2 = (this.mLastX1); this._vLine.Y2 = (aRect.Bottom); } flag = (this.SelectionArea != null); if (flag) { this.SelectionArea.SetPosition(this.mLastX1, aRect.Top, this.mLastX1, aRect.Bottom); } } #endregion Protected Methods #endregion Methods } }