src/Misc/EFTools/DesignXmlCore/Refactoring/RefactoringOperationBase.cs
// TODO: We need a common location for this method
/// <summary>
///     Ask SCC if file can be checked out.  SCC will check the file out if allowed to do so.
///     The user may be prompted (depending on settings) before checkout.
/// </summary>
/// <param name="userCanceled">Return flag indicating if the user canceled the checkout.</param>
/// <param name="files">List of file to checkout.</param>
/// <returns>True if the files were checked out, false otherwise.</returns>
Ask SCC if file can be checked out.  SCC will check the file out if allowed to do so.
The user may be prompted (depending on settings) before checkout.
Ask SCC if file can be checked out . SCC will check the file out if allowed to do so . The user may be prompted ( depending on settings ) before checkout .
internal bool QueryEditFiles(out bool userCanceled, params string[] files)
        {
            userCanceled = false;
            var queryEditQuerySave = _serviceProvider.GetService(typeof(SVsQueryEditQuerySave)) as IVsQueryEditQuerySave2;
            uint result;
            uint outFlags;
            var hr = queryEditQuerySave.QueryEditFiles(
                0, 
                files.Length, 
                files, 
                null, 
                null, 
                out result, 
                out outFlags 
                );
            if (ErrorHandler.Succeeded(hr)
                && (result == (uint)tagVSQueryEditResult.QER_EditOK))
            {
                return true;
            }
            else if (result == (uint)tagVSQueryEditResult.QER_NoEdit_UserCanceled)
            {
                userCanceled = true;
            }
            return false;
        }
internal bool QueryEditFiles ( out bool userCanceled , params string [ ] files ) { userCanceled = false ; var queryEditQuerySave = _serviceProvider . GetService ( typeof ( SVsQueryEditQuerySave ) ) as IVsQueryEditQuerySave2 ; uint result ; uint outFlags ; var hr = queryEditQuerySave . QueryEditFiles ( 0 , files . Length , files , null , null , out result , out outFlags ) ; if ( ErrorHandler . Succeeded ( hr ) && ( result == ( uint ) tagVSQueryEditResult . QER_EditOK ) ) { return true ; } else if ( result == ( uint ) tagVSQueryEditResult . QER_NoEdit_UserCanceled ) { userCanceled = true ; } return false ; }
Ask SCC if file can be checked out.
Ask SCC if file can be checked out .
// Get the QueryEditQuerySave service // Now call the QueryEdit method to find the edit status of this files // Note that this function can popup a dialog to ask the user to checkout the file. // When this dialog is visible, it is possible to receive other request to change // the file and this is the reason for the recursion guard. // Flags // Number of elements in the array // Files to edit // Input flags // Input array of VSQEQS_FILE_ATTRIBUTE_DATA // result of the checkout // Additional flags // In this case (and only in this case) we can return true from this function.
True if the files were checked out, false otherwise.
True if the files were checked out false otherwise .
bool
out
userCanceled
Return flag indicating if the user canceled the checkout.
Return flag indicating if the user canceled the checkout .
files
List of file to checkout.
List of file to checkout .