internal void OnTickRefresh()
        {
            List <string> toRefresh;
            bool          fullRefresh;

            lock (_toRefresh)
            {
                _refreshScheduled = false;

                if (_fullRefresh)
                {
                    fullRefresh = true;
                    toRefresh   = null;
                }
                else
                {
                    fullRefresh = false;
                    toRefresh   = new List <string>(_toRefresh);
                }
                _toRefresh.Clear();
                _fullRefresh = false;

                _extraFiles.UniqueAddRange(_toMonitor);
                _toMonitor.Clear();
            }

            if (fullRefresh)
            {
                InnerRefresh();
            }
            else
            {
                using (BatchStartedEventArgs br = SmartRefresh(toRefresh.Count))
                {
                    foreach (string path in toRefresh)
                    {
                        if (br != null)
                        {
                            br.Tick();
                        }
                        ItemRefresh(path);
                    }
                }
            }
        }
Example #2
0
        internal void OnSccCleanup(CommandEventArgs e)
        {
            _registeredSccCleanup = false;
            _collectHints         = false;

            _fileHints.Clear();
            _fileOrigins.Clear();
            _alreadyProcessed.Clear();
        }
Example #3
0
            void StopMonitor()
            {
                ThreadHelper.ThrowIfNotOnUIThread();

                // Stop monitoring
                foreach (uint v in _monitor.Keys)
                {
                    _change.UnadviseFileChange(v);
                }

                _monitor.Clear();

                foreach (string path in _fsIgnored)
                {
                    _change.SyncFile(path);
                    _change.IgnoreFile(0, path, 0);
                }

                _fsIgnored.Clear();

                // Sync all files for the last time
                // to make sure they are not reloaded for old changes after disposing
                foreach (string path in _locked)
                {
                    _change.SyncFile(path);
                }

                _locked.Clear();

                foreach (string path in _readonly)
                {
                    SccDocumentData dd;
                    if (_tracker._docMap.TryGetValue(path, out dd))
                    {
                        dd.SetReadOnly(false);
                    }
                }
                _readonly.Clear();

                foreach (string path in _ignoring)
                {
                    SccDocumentData dd;
                    if (_tracker._docMap.TryGetValue(path, out dd))
                    {
                        dd.IgnoreFileChanges(false);
                    }
                }

                _ignoring.Clear();
            }
Example #4
0
            internal void ReloadModified()
            {
                ThreadHelper.ThrowIfNotOnUIThread();

                if (_monitor == null || _change == null)
                {
                    return;
                }

                foreach (string file in _monitor.Values)
                {
                    _change.SyncFile(file);
                }

                foreach (KeyValuePair <string, FileInfo> item in new List <KeyValuePair <string, FileInfo> >(_altMonitor))
                {
                    string   file = item.Key;
                    FileInfo from = item.Value;
                    FileInfo to   = new FileInfo(file);

                    if (from.Exists && to.Exists &&
                        ((from.LastWriteTime != to.LastWriteTime) || (from.Length != to.Length) ||
                         (from.CreationTime != to.CreationTime)))
                    {
                        if (!_changedPaths.Contains(file))
                        {
                            _changedPaths.Add(file);
                            _altMonitor[file] = to;
                        }
                    }
                }

                List <string> changed = new List <string>(_changedPaths);

                _changedPaths.Clear();

                Reload(changed);
            }