我想做一个插件:
- 阅读电子邮件时可用
- 在编写电子邮件时可用
- 阅读电子邮件时是否可锁定
到目前为止,我已经成功地制作了一个Manifest,它可以实现3个需求中的2个,但不能同时实现所有3个。
- 1+2可以使用VersionOverrides V1.0,但不能使用V1.1
- 使用VersionOverrides V1.1可以使用1+3,但不使用V1.0
- 固定仅在1.1中可用,但随后我松开(2(
有什么建议吗?-除了创建两个外接程序之外?
我的示例Manifest.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>d23964fa-8ebb-4351-a07c-5348c5c88ce4</Id>
<Version>1.0.0.0</Version>
<ProviderName>@Fbsall</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Git the gist" />
<Description DefaultValue="Allows users to access their GitHub gists." />
<IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-80.png" />
<SupportUrl DefaultValue="https://localhost:3000/support.html" />
<AppDomains>
<AppDomain>fbsall.com</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html" />
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="Commands.Url" />
<!-- Message Compose -->
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgComposeCmdGroup">
<Label resid="GroupLabel" />
<Control xsi:type="Button" id="msgComposeInsertGist">
<Label resid="TaskpaneButton.Label" />
<Supertip>
<Title resid="TaskpaneButton.Title" />
<Description resid="TaskpaneButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url" />
</Action>
</Control>
<Control xsi:type="Button" id="msgComposeInsertDefaultGist">
<Label resid="FunctionButton.Label" />
<Supertip>
<Title resid="FunctionButton.Title" />
<Description resid="FunctionButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>insertDefaultGist</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="Commands.Url" />
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadCmdGroup">
<Label resid="GroupLabel" />
<Control xsi:type="Button" id="msgComposeInsertGist">
<Label resid="TaskpaneButton.Label" />
<Supertip>
<Title resid="TaskpaneButton.Title" />
<Description resid="TaskpaneButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url" />
</Action>
</Control>
<Control xsi:type="Button" id="msgComposeInsertDefaultGist">
<Label resid="FunctionButton.Label" />
<Supertip>
<Title resid="FunctionButton.Title" />
<Description resid="FunctionButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>insertDefaultGist</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png" />
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png" />
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html" />
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GroupLabel" DefaultValue="Git the gist" />
<bt:String id="TaskpaneButton.Label" DefaultValue="Insert gist" />
<bt:String id="TaskpaneButton.Title" DefaultValue="Insert gist" />
<bt:String id="FunctionButton.Label" DefaultValue="Insert default gist" />
<bt:String id="FunctionButton.Title" DefaultValue="Insert default gist" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Displays a list of your gists and allows you to insert their contents into the current message." />
<bt:String id="FunctionButton.Tooltip" DefaultValue="Inserts the content of the gist you mark as default into the current message." />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</VersionOverrides>
我通过查看一个清单找到了答案,该清单正是我想要的。
我误解了Hosts、Formfactor和ExtensionPoints的声明方式。
正确的方法是这样的:
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<ExtensionPoint xsi:type="MessageComposeCommandSurface"></ExtensionPoint>
<ExtensionPoint xsi:type="MessageReadCommandSurface"></ExtensionPoint>
</DesktopFormFactor>
<MobileFormFactor>
<ExtensionPoint xsi:type="MessageComposeCommandSurface"></ExtensionPoint>
<ExtensionPoint xsi:type="MessageReadCommandSurface"></ExtensionPoint>
</MobileFormFactor>
</Host>
</Hosts>
VersionOverride 1.0中的所有内容都将复制到1.1中。SupportsPenning在1.1中提供,适用于Compose和Read。