If the selection is a file (rather than a folder), then we adjust the text and tool tip to reflect that file name and enable it.
如果选择是文件(而不是文件夹),则调整文本和工具提示以反映该文件的名称并启用它。
If we don't have exactly one item selected, we disable the action, adjust the tool tip to say why it is disabled, and return.
如果选中的不是恰好一项,则禁用该操作,调整工具提示以说明为什么禁用,然后返回。
Tip: If we pass in the text after we passed it through the StripTags filter, we don't have to strip tags later. It might look something like this.
提示:如果在通过StripTags过滤器传递文本之后再传入文本,那么之后无需去掉标记。
应用推荐