ClearChanges() 개인적인 메소드

private ClearChanges ( ) : void
리턴 void
예제 #1
0
파일: EditorTree.cs 프로젝트: nomada2/RTVS
        /// <summary>
        /// Builds initial AST. Subsequent updates should be coming from a background thread.
        /// </summary>
        public void Build()
        {
            if (_ownerThread != Thread.CurrentThread.ManagedThreadId)
            {
                throw new ThreadStateException("Method should only be called on the main thread");
            }

            var sw = Stopwatch.StartNew();

            TreeUpdateTask.Cancel();

            if (TextBuffer != null)
            {
                TextSnapshot = TextBuffer.CurrentSnapshot;
                _astRoot     = RParser.Parse(new TextProvider(TextBuffer.CurrentSnapshot));
            }

            TreeUpdateTask.ClearChanges();

            // Fire UpdatesPending notification, even though we don't have ranges for the event
            List <TextChangeEventArgs> textChanges = new List <TextChangeEventArgs>();

            FireOnUpdatesPending(textChanges);

            FireOnUpdateBegin();
            FireOnUpdateCompleted(TreeUpdateType.NewTree);

            sw.Stop();
        }