Microsoft.VisualStudio.Project.FileNode.IsFileOnDisk C# (CSharp) Method

IsFileOnDisk() public method

Determine if this item is represented physical on disk and shows a messagebox in case that the file is not present and a UI is to be presented.
public IsFileOnDisk ( bool showMessage ) : bool
showMessage bool true if user should be presented for UI in case the file is not present
return bool
        public virtual bool IsFileOnDisk(bool showMessage)
        {
            bool fileExist = IsFileOnDisk(this.Url);

            if(!fileExist && showMessage && !Utilities.IsInAutomationFunction(this.ProjectManager.Site))
            {
                string message = String.Format(CultureInfo.CurrentCulture, SR.GetString(SR.ItemDoesNotExistInProjectDirectory, CultureInfo.CurrentUICulture), this.Caption);
                string title = string.Empty;
                OLEMSGICON icon = OLEMSGICON.OLEMSGICON_CRITICAL;
                OLEMSGBUTTON buttons = OLEMSGBUTTON.OLEMSGBUTTON_OK;
                OLEMSGDEFBUTTON defaultButton = OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST;
                VsShellUtilities.ShowMessageBox(this.ProjectManager.Site, title, message, icon, buttons, defaultButton);
            }

            return fileExist;
        }

Same methods

FileNode::IsFileOnDisk ( string path ) : bool