Пример #1
0
        /// <summary>
        /// Add a new fileinfo to the list of changed files.
        /// </summary>
        /// <param name="change"></param>
        internal void AddNewChange(ChangedFile change)
        {
            if (Application.Current == null)
            {
                return;
            }

            if (Application.Current.Dispatcher.CheckAccess())
            {
                if (!ChangedFiles.Contains(change))
                {
                    ChangedFiles.Add(change);
                }
            }
            else
            {
                AddChangeDelegate del = new AddChangeDelegate(AddNewChange);
                Application.Current.Dispatcher.Invoke(del, new object[] { change });
            }
        }
Пример #2
0
        internal void AddNewChangeSet(IEnumerable <ChangedFile> changes)
        {
            if (Application.Current == null)
            {
                return;
            }

            if (Application.Current.Dispatcher.CheckAccess())
            {
                foreach (var change in changes)
                {
                    if (!ChangedFiles.Contains(change))
                    {
                        ChangedFiles.Add(change);
                    }
                }
            }
            else
            {
                AddChangesDelegate del = new AddChangesDelegate(AddNewChangeSet);
                Application.Current.Dispatcher.Invoke(del, new object[] { changes });
            }
        }