示例#1
0
        public ChangeTypePreview(string changedText, RenderingSetModel rsm, ChangeTypesVisible ctsbt, 
            string foregroundProp, string backgroundProp, string formatProp, string surroundProp, ChangeNumberingProvider cnp, int baseChangeNum, ChangeTypes changeType)
        {

            //ChangeNumberingVisibility = cnbt;
            _changeText = changedText;
            _changeTypesShown = ctsbt;
            _cnp = cnp;
            _baseChangeNum = baseChangeNum;
            _changeType = changeType;

            cnp.RegisterChangeNumber(baseChangeNum, changeType);

            Foreground = new ColorPreviewBindingTarget(rsm, foregroundProp);
            if (!string.IsNullOrEmpty(backgroundProp))
                Background = new ColorPreviewBindingTarget(rsm, backgroundProp);
            if (!string.IsNullOrEmpty(formatProp))
                Formatting = new FormatPreviewBindingTarget(rsm, formatProp);
            if (!string.IsNullOrEmpty(surroundProp))
                SurroundChars = new SurroundTextBindingTarget(rsm, surroundProp);
            ChangeNumberFormatting = new FormatPreviewBindingTarget(rsm, "ChangeNumberTextFormat");
            ChangeNumberForeground = new ColorPreviewBindingTarget(rsm, "ChangeNumberTextColour");

            _changeTypesShown.ChangeTypeVisibilityChanged += new EventHandler(_changeTypesShown_ChangeTypeVisibilityChanged);
            cnp.ChangeNumberingChanged += new EventHandler(cnp_ChangeNumberingChanged);

            SetupProperties();
        }
示例#2
0
        public DeletedTextPreview(string changedText, RenderingSetModel rsm, ChangeTypesVisible ctsbt, 
            string foregroundProp, string backgroundProp, string formatProp, string surroundProp, ChangeNumberingProvider cnp, int baseChangeNum, ChangeTypes changeType) :
            base (changedText, rsm, ctsbt, foregroundProp, backgroundProp, formatProp, surroundProp, cnp, baseChangeNum, changeType)
        {
            _singleCharProp = rsm.FindOption("DeletedTextReplaceWithSingleChar") as BoolOption;
            _charProp = rsm.FindOption("DeletedTextReplaceChar") as CharacterOption;

            _charProp.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(opt_PropertyChanged);
            _singleCharProp.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(opt_PropertyChanged);
            SetupChangeText();
        }