using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Xml; using System.Xml.Serialization; using System.Windows.Forms; //using Microsoft.VisualStudio.CommandBars; //using EnvDTE; //using EnvDTE80; using BismNormalizer.TabularCompare.Core; using System.Runtime.InteropServices; using System.Linq; namespace BismNormalizer.TabularCompare.UI { public enum CompareState { NotCompared, Compared, Validated }; /// /// The main BISM Normalizer comparison control, containing the differences grid, and source/target object definition text boxes. /// public partial class ComparisonControl : UserControl { #region Private variables private ComparisonInfo _comparisonInfo; private Comparison _comparison; private ContextMenu _menuComparisonGrid = new ContextMenu(); //private BismNormalizerPackage _bismNormalizerPackage; //private EditorPane _editorPane; private const string _bismNormalizerCaption = "BISM Normalizer"; private CompareState _compareState = CompareState.NotCompared; #endregion #region DiffVariables // this is the diff object; DiffMatchPatch _diff = new DiffMatchPatch(); // these are the diffs List _diffs; // chunks for formatting the two RTBs: List _chunklistSource; List _chunklistTarget; // color list: Color[] _backColors = new Color[3] { ColorTranslator.FromHtml("#e2f6c5"), ColorTranslator.FromHtml("#ffd6d5"), Color.White, }; Color[] _backColorsMerge = new Color[3] { ColorTranslator.FromHtml("#e2f6c5"), Color.LightGray, Color.White, }; public struct Chunk { public int StartPosition; public int Length; public Color BackColor; } #endregion #region DPI private float _dpiScaleFactor = 1; private void Rescale() { this._dpiScaleFactor = Utils.GetDpiFactor(); if (this._dpiScaleFactor == 1) return; float fudgedDpiScaleFactor = _dpiScaleFactor * Utils.PrimaryFudgeFactor; this.Scale(new SizeF(fudgedDpiScaleFactor, fudgedDpiScaleFactor)); this.Font = new Font(this.Font.FontFamily, this.Font.Size * fudgedDpiScaleFactor, this.Font.Style); //foreach (Control c in HighDPIUtils.GetChildInControl(this)) //.OfType