src/Misc/EFTools/DesignXmlCore/Refactoring/PreviewData.cs
/// <summary>
///     Get FileChange for a previewNode.
///     After user clicks a preview node, the preview dialog will show
///     content of the file this change will be applied to.  And the content
///     of that file will contains all the selected changes to that file and
///     will show user the version with changes already applied.
/// </summary>
/// <param name="previewNode"></param>
/// <returns>
///     FileChange related to this node.  If this change is atomic change,
///     or the node is file node, it will return the FileChange object for
///     the file it is changing.
///     If the node is a group node, it will return null.
/// </returns>
Get FileChange for a previewNode.
After user clicks a preview node, the preview dialog will show
content of the file this change will be applied to.  And the content
of that file will contains all the selected changes to that file and
will show user the version with changes already applied.
Get FileChange for a previewNode . After user clicks a preview node the preview dialog will show content of the file this change will be applied to . And the content of that file will contains all the selected changes to that file and will show user the version with changes already applied .
public FileChange GetFileChange(PreviewChangesNode previewNode)
        {
            ArgumentValidation.CheckForNullReference(previewNode, "previewNode");
            string fileName = null;
            var changeProposal = previewNode.ChangeProposal;
            if (changeProposal != null)
            {
                fileName = changeProposal.FileName;
            }
            else
            {
                if (previewNode.ChildList != null
                    && previewNode.ChildList.Count > 0)
                {
                    var proposal = previewNode.ChildList[0].ChangeProposal;
                    if (proposal != null)
                    {
                        fileName = proposal.FileName;
                    }
                }
            }
            FileChange fileChange = null;
            if (fileName != null)
            {
                _fileChanges.TryGetValue(fileName, out fileChange);
            }
            return fileChange;
        }
public FileChange GetFileChange ( PreviewChangesNode previewNode ) { ArgumentValidation . CheckForNullReference ( previewNode , " " ) ; string fileName = null ; var changeProposal = previewNode . ChangeProposal ; if ( changeProposal != null ) { fileName = changeProposal . FileName ; } else { if ( previewNode . ChildList != null && previewNode . ChildList . Count > 0 ) { var proposal = previewNode . ChildList [ 0 ] . ChangeProposal ; if ( proposal != null ) { fileName = proposal . FileName ; } } } FileChange fileChange = null ; if ( fileName != null ) { _fileChanges . TryGetValue ( fileName , out fileChange ) ; } return fileChange ; }
Get FileChange for a previewNode.
Get FileChange for a previewNode .
// Preview Node for atomic change // Look at direct child, if that child is an atomic change, // then get filename for it, otherwise, just leave the filename as null
FileChange related to this node.  If this change is atomic change,
or the node is file node, it will return the FileChange object for
the file it is changing.
If the node is a group node, it will return null.
FileChange related to this node . If this change is atomic change or the node is file node it will return the FileChange object for the file it is changing . If the node is a group node it will return null .
previewNode
PreviewChangesNode
None