private static CommandState GetCommandState(ITextBuffer buffer, Func <CommandState> nextHandler) { if (!buffer.CanApplyChangeDocumentToWorkspace()) { return(nextHandler()); } return(CommandState.Available); }
private static VSCommanding.CommandState GetCommandState(ITextBuffer buffer) { if (!buffer.CanApplyChangeDocumentToWorkspace()) { return(VSCommanding.CommandState.Unspecified); } return(VSCommanding.CommandState.Available); }
private static bool CanExecuteCommand(ITextBuffer buffer) => buffer.CanApplyChangeDocumentToWorkspace();
protected static CommandState GetCommandState(ITextBuffer buffer) { return(buffer.CanApplyChangeDocumentToWorkspace() ? CommandState.Available : CommandState.Unspecified); }