示例#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();
        }
        public ChangeNumberingProvider(RenderingSetModel rsm, ChangeTypesVisible ctv)
        {
            _ctv = ctv;
            _showOpt = rsm.FindOption("ShowChangeNumbers") as BoolOption;
            _beforeOpt = rsm.FindOption("ShowChangeNumbersBeforeChange") as BoolOption;

            _showOpt.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_opt_PropertyChanged);
            _beforeOpt.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_opt_PropertyChanged);
            _ctv.ChangeTypeVisibilityChanged += new EventHandler(_ctv_ChangeTypeVisibilityChanged);
        }
示例#3
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();
        }