src/Misc/EFTools/DesignXmlCore/Refactoring/FileChange.cs
/// <summary>
///     Add a ChangeProposal to change list of a related PreviewGroup.
/// </summary>
/// <param name="previewGroup">Preview group this change will be added to.</param>
/// <param name="change">The ChangeProposal.</param>
Add a ChangeProposal to change list of a related PreviewGroup.
Add a ChangeProposal to change list of a related PreviewGroup .
internal void AddChange(RefactoringPreviewGroup previewGroup, ChangeProposal change)
        {
            ArgumentValidation.CheckForNullReference(previewGroup, "previewGroup");
            ArgumentValidation.CheckForNullReference(change, "change");
            var exist = false;
            foreach (var existingChanges in _changeList.Values)
            {
                if (existingChanges.Contains(change))
                {
                    exist = true;
                    break;
                }
            }
            if (!exist)
            {
                HashSet<ChangeProposal> changes = null;
                if (_changeList.TryGetValue(previewGroup, out changes) == false)
                {
                    changes = new HashSet<ChangeProposal>();
                    _changeList.Add(previewGroup, changes);
                }
                changes.Add(change);
            }
        }
internal void AddChange ( RefactoringPreviewGroup previewGroup , ChangeProposal change ) { ArgumentValidation . CheckForNullReference ( previewGroup , " " ) ; ArgumentValidation . CheckForNullReference ( change , " " ) ; var exist = false ; foreach ( var existingChanges in _changeList . Values ) { if ( existingChanges . Contains ( change ) ) { exist = true ; break ; } } if ( ! exist ) { HashSet < ChangeProposal > changes = null ; if ( _changeList . TryGetValue ( previewGroup , out changes ) == false ) { changes = new HashSet < ChangeProposal > ( ) ; _changeList . Add ( previewGroup , changes ) ; } changes . Add ( change ) ; } }
Add a ChangeProposal to change list of a related PreviewGroup.
Add a ChangeProposal to change list of a related PreviewGroup .
// First check if changes for same location exists or not, if exist, we will not add it anymore // There is no change list for this preview group, // create one and add to the dictionary. // Add change to the change list.
previewGroup
RefactoringPreviewGroup
Preview group this change will be added to.
Preview group this change will be added to .
change
ChangeProposal
None