Export to GitHub

alsing - issue #4

OnModified triggered repeatedly


Posted on Aug 15, 2008 by Helpful Monkey

What steps will reproduce the problem? 1. Attach an OnModifiedChange event to a SyntaxBox document control 2. Type in the box. 3. Watch it fire the event twice for every keystroke (keyup/keydown).

What is the expected output? What do you see instead?

I expect it to fire only when Modified actually changes value, instead of firing every time it's set at all.

What version of the product are you using? On what operating system?

Latest 3.5 source, XP

Please provide any additional information below.

Easy fix. In Alsing.SourceCode.SyntaxDocument.cs change the Modified property like this:

    /// <summary>
    /// Get or Set the Modified flag
    /// </summary>
    public bool Modified
    {
        get { return modified; }
        set
        {
            if (modified != value)
            {
                modified = value;
                OnModifiedChanged();
            }
        }
    }

Status: New

Labels:
Type-Defect Priority-Medium