Microsoft.VisualStudio.Project.TrackDocumentsHelper.CanRenameItem C# (CSharp) Method

CanRenameItem() public method

Asks the environment for permission to rename files.
public CanRenameItem ( string oldFileName, string newFileName, VSRENAMEFILEFLAGS flag ) : bool
oldFileName string Path to the file to be renamed.
newFileName string Path to the new file.
flag VSRENAMEFILEFLAGS The VSRENAMEFILEFLAGS associated with the file to be renamed.
return bool
        public virtual bool CanRenameItem(string oldFileName, string newFileName, VSRENAMEFILEFLAGS flag)
        {
            // If we are silent then we assume that the file can be renamed, since we do not want to trigger this event.
            if((this.projectMgr.EventTriggeringFlag & SuppressEvents.Tracker) != 0)
            {
                return true;
            }

            int iCanContinue = 0;
            ErrorHandler.ThrowOnFailure(this.GetIVsTrackProjectDocuments2().OnQueryRenameFile(this.projectMgr.InteropSafeIVsProject3, oldFileName, newFileName, flag, out iCanContinue));
            return (iCanContinue != 0);
        }