public void OnLineChanged(object sender, TextLineChange[] changes, int last)
        {
            if (committing)
            {
                return;
            }

            CodeDomFileCodeModel model = parent.FileCodeModel as CodeDomFileCodeModel;

            Debug.Assert(model != null);

            for (int i = 0; i < changes.Length; i++)
            {
                UpdatePositions(changes[i].iStartLine, changes[i].iNewEndLine - changes[i].iOldEndLine, changes[i].iNewEndIndex - changes[i].iOldEndIndex);
            }

            isDirty = true;
        }
        protected void CommitChanges()
        {
            object curParent = ParentElement;

            while (!(curParent is CodeDomFileCodeModel))
            {
                curParent = ((ICodeDomElement)curParent).ParentElement;
                CodeDomFileCodeModel fcm = curParent as CodeDomFileCodeModel;
                if (fcm != null)
                {
                    fcm.CommitChanges();
                    break;
                }

                if (curParent == null)
                {
                    Debug.Assert(false, "Not ICodeDomElement or CodeDomFileCodeModel in parent hierarchy");
                    break;
                }
            }
        }