装配显示文件扩展名的创建方法及显示文件扩展名对应的扩展名

摘要 : 如果用户得到的离线版的Chrome插件文件(扩展名为.crx),该如何将其安装到谷歌浏览器Chrome中去呢?
在用户使用安装Chrome插件的时候,如果网络状态允许或者用户直接在谷歌提供的服务中获取的Chrome插件,就可以点击其提供的一键跳转按钮直接根据提示安装到Chrome浏览器中,这种安装Chrome插件的方式最为简单,但是要求用户的网络状态良好,并且用户可以从谷歌的相关服务中获取Chrome插件的下载链接。 但是大多数情况我们的网络状态都不会允许我们这么做的,那我们更加不可能直接获取Chrome插件在谷歌服务中的下载链接了,用户只能通过在其他网站上下载(如:),或者用户通过好友之间分享获得Chrome插件的离线安装版(扩展名为.crx的文件)。 可是就算获得了这些crx的Chrome插件离线安装文件有些用户可能还不太清楚这些离线插件的安装方法,所以今天有必要为一些不知道怎么使用crx文件的小伙伴讲解一下离线Chrome插件安装文件(crx)的安装方法了。 1.首先用户点击谷歌浏览器右上角的自定义及控制按钮,在下拉框中选择工具选项,然后点击扩展程序来启动Chrome浏览器的扩展管理器页面。
2.在打开的谷歌浏览器的扩展管理器中用户可以看到一些已经安装程序的Chrome插件,或者一个Chrome插件也没有。
3.找到自己已经下载好的Chrome离线安装文件xxx.crx,然后将其从资源管理器中拖动到Chrome的扩展管理界面中,这时候用户会发现在扩展管理器的中央部分中会多出一个”拖动以安装“的插件按钮。
4.松开鼠标就可以把当前正在拖动的插件安装到谷歌浏览器中去,但是谷歌考虑用户的安全隐私,在用户松开鼠标后还会给予用户一个确认安装的提示。
5.用户这时候只需要点击添加按钮就可以把该离线Chrome插件安装到谷歌浏览器中去,安装成功以后该插件会立即显示在浏览器右上角(如果有插件按钮的话),如果没有插件按钮的话,用户还可以通过Chrome扩展管理器找到已经安装的插件。
用户只需要通过上面介绍的五个步骤就可以轻松地把离线谷歌浏览器插件安装到Chrome中去,希望这个离线Chrome插件的安装方法能够帮助到您或者是您的朋友。 如果通过上述方法安装Chrome插件的时候,谷歌浏览器提示“只能通过Chrome网上应用商店安装该程序”,可以参考:。
转载必须注明来自:
相关Chrome插件推荐:
Chrome插件技术开发工程师
11-27 22:23
08-17 00:19
08-29 22:21其他人的建议:
没有其他建议。
&定义用于扩展 UML 的配置文件
This content was manually translated to a higher quality standard. If you wish to further improve the quality of the translation, click the Edit button associated with the sentence that you wish to modify.
You can define a UML profile to customize the standard model elements for specific purposes.
A profile defines one or more UML stereotypes.
A stereotype can be used to mark a type as representing a particular kind of object.
A stereotype can also extend an element's list of properties.
Several profiles are installed with supported editions of Visual Studio.
To see which versions of Visual Studio support this feature, see .
For more information about those profiles and about how to apply stereotypes, see .
You can define your own profiles to adapt and extend UML to your own business area or architecture.
For example:
If you frequently define Web sites, you could define your own profile that provides a <> stereotype that can be applied to classes in class diagrams.
You could then use class diagrams to plan a Web site.
Every <> class would have extra properties for page content, style, and so on.
If you develop banking software, you could define a profile that provides an <> stereotype.
You could then use class diagrams to define different types of account and show the relationships between them.
You can distribute your own profiles to your team.
Each team member can install your profile.
This enables them to edit and create models that use its stereotypes.
注意If you apply the stereotypes of a profile in a model that you are editing, and then share the model with other people, they should install the same profile on their own computers.
Otherwise, they will not be able to see the stereotypes that you have used.
A profile is often part of a larger Visual Studio extension.
For example, you could define a command that translates some parts of a model to code.
You could define a profile that users must apply to packages that they want to translate.
You would distribute your new command together with the profile in a single Visual Studio extension.
You can also define localized variants of a profile.
Users loading your extension see the variant that is appropriate to their own culture.
&How to Define a Profile
Create a new XML file with the file name extension .profile.Add stereotype definitions according to the guidelines described in .Add the profile to a Visual Studio Extension (.vsix file).
You can either create a new extension for your profile, or add the profile to an existing extension.
See the next section, . Install the extension on your computer. Double-click the extension file, which has a file name extension .vsix.Restart Visual Studio.Verify that the profile has been installed. Select the model in UML Explorer.In the Properties window, click the Profiles property.
Your profile will appear in the menu.
Set the check mark next to the profile.
Select an element for which your profile defines stereotypes.
In the Properties window, click the Stereotypes property.
Your stereotypes will appear in the list.
Set the check mark against one of the stereotypes.
If your profile defines additional properties for this stereotype, expand the stereotype property to see them.Send the extension file to other users of Visual Studio to install on their computers.
&How to Add a Profile to a Visual Studio Extension
To install a profile, and to allow you to send it to other users, you must add the profile to a Visual Studio extension.
For more information, see .
Create a Visual Studio Extension project.注意You must have installed Visual Studio SDK to use this procedure.On the File menu, point to New, and then click Project. In the New Project dialog box, under Installed Templates, expand Visual C#, click Extensibility, and then click VSIX project.
Set the project name and click OK.
Add your profile to the project.In Solution Explorer, right-click the project, point to Add, and then click Existing Item.
In the dialog box, locate your profile file.
Set the profile file's Copy to Output property.In Solution Explorer, right-click the profile file, and then click Properties. In the Properties window, set the Copy to Output Directory property to Copy Always.In Solution Explorer, open source.extension.vsixmanifest.The file opens in the extension manifest editor.On the Assets page, add a row describing the profile:Click New.
Set the fields in the Add New Asset dialog as follows.
Set Type to Microsoft.VisualStudio.UmlProfileThis is not one of the drop-down choices.
Enter this name from the keyboard.
Click File on filesystem and select the name of your profile file, for example MyProfile.profile Build the project.To debug the profile, press F5.An experimental instance of Visual Studio opens.
In this instance, open a modeling project.
In UML Explorer, select the root element of the model, and in the Properties window, select your profile.
Then select elements inside the model and set stereotypes that you have defined for them.
To extract the VSIX for deploymentIn Windows Explorer, open the folder .\bin\Debug or .\bin\Release to find the .vsix file.
This is a Visual Studio Extension file.
It can be installed on your computer and sent to other Visual Studio users.
To install the extension:Double-click the .vsix file.
The Visual Studio Extension Installer will start.
Restart any instances of Visual Studio that are running.The following alternative procedure can be used for small extensions if you have not installed Visual Studio SDK.Create a Windows directory that contains the following three files:YourProfile.profileextension.vsixmanifest[Content_Types].xml - type this name as shown here, with the square bracketsEdit [Content_Types].xml to contain the following text.
Notice that it contains an entry for each file name extension.
&?xml version="1.0" encoding="utf-8"?&
&Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"&
&Default Extension="profile" ContentType="application/octet-stream" /&
&Default Extension="vsixmanifest" ContentType="text/xml" /&
Copy an existing extension.vsixmanifest and edit it with an XML editor.
Alter the ID, Name, and Content nodes.
You can find an example of extension.vsixmanifest in this directory:drive:\Program Files\Microsoft Visual Studio [version]\Common7\IDE\Extensions\Microsoft\Architecture Tools\UmlProfilesThe Content node should be like this:
&CustomExtension Type="Microsoft.VisualStudio.UmlProfile"
&YourProfile.Profile&/CustomExtension&
&/Content&
Compress the three files into a zipped file.In Windows Explorer, select the three files, right-click, point to Send To, and then click Compressed (zipped) folder.Rename the zipped file, and change its file name extension from .zip to .vsix. To install the profile on any computer with appropriate editions of Visual Studio, double-click the .vsix file.Double-click the .vsix file in Windows Explorer, or open it within Visual Studio.Click Install in the dialog box that appears.To uninstall or temporarily disable the extension, open Extensions and Updates from the Tools menu.
&How to Define Localized Profiles
You can define different profiles for different cultures or languages, and package them all into the same extension.
When a user loads your extension, they will see the profile that you have defined for their culture.
You must always provide a default profile.
If you have not defined a profile for the user's culture, they will see the default profile.
Create a profile as described in the previous sections and .
This is the default profile, and will be used in any installation for which you do not provide a localized profile.
Add a new directory in the same directory as your default profile file. 注意If you are building the extension by using a Visual Studio Extension project, use Solution Explorer to add a new folder to the project. Change the new directory's name to the ISO short code for the localized culture, such as bg for Bulgarian, or fr for French.
You should use a neutral culture code, typically two letters, not a specific culture such as fr-CA.
For more information about culture codes, see , which provides a complete list of culture codes.
Add a copy of your default profile to the new directory.
Do not change its file name.
A sample Visual Studio Extension folder, before it is built or compressed into a .vsix file, would contain the following folders and files:
extension.vsixmanifest
MyProfile.profile
fr\MyProfile.profile
de\MyProfile.profile注意You should not insert into extension.vsixmanifest a reference to the localized versions of the profiles.
The copied profile files must have the same name as the profile in the parent folder.
Edit the new copy of the profile, translating to the target language all the parts that will be visible to the user, such as the displayName attributes.You can create additional culture folders and localized profiles for as many cultures as you want.Build the Visual Studio extension, either by building the Extension Project or compressing all the files, as described in the previous sections.
&The Structure of a Profile
The XSD file for UML profiles can be found in the following sample: .
To help you edit profile files, install the .xsd file in:
%ProgramFiles%\Microsoft Visual Studio [version]\Xml\SchemasThis section uses the C# profile as an example.
The complete profile definition can be seen in:
drive:\Program Files\Microsoft Visual Studio [version]\Common7\IDE\Extensions\Microsoft\Architecture Tools\UmlProfiles\CSharp.profileThe first parts of this path might differ in your installation.For more information about the .NET profile, see .
&Main sections of the UML Profile definition
Every profile contains the following content:
&?xml version="1.0" encoding="utf-8"?&
&profile dslVersion="1.0.0.0"
name="CSharpProfile" displayName="C# Profile"
xmlns="/UML2.1.2/ProfileDefinition"&
&stereotypes&...&/stereotypes&
&metaclasses&...&/metaclasses&
&propertyTypes&...&/propertyTypes&
&/profile&
注意The attribute called name must not contain spaces or punctuation.
The attribute displayName, which appears in the user interface, should be a valid XML string.
Every profile contains three main sections.
In reverse order, they are as follows:
&propertyTypes& - a list of types that are used for properties defined in the stereotypes section.&metaclasses& - a list of model element types to which the stereotypes in this profile apply, such as IClass, IInterface, IOperation, IDependency.&stereotypes& - the stereotype definitions.
Each definition includes the names and types of properties that are added to the target model element.
&Property Types
The &propertyTypes& section declares a list of types that are used for properties in the &stereotypes& section.
There are two kinds of property types: external and enumeration.
An external type declares the fully qualified name of a standard .NET type:
&externalType name="System.String" /&
An enumeration type defines a set of literal values:
&enumerationType name="PackageVisibility"&
&enumerationLiterals&
&enumerationLiteral name="internal" displayName="internal"
&enumerationLiteral name="protectedinternal" displayName="protected internal" /&
&/enumerationLiterals&
&/enumerationType&
&Metaclasses
The &metaclasses& section is a list of model element types to which stereotypes in this profile can be defined:
&metaclass
name="Microsoft.VisualStudio.Uml.Classes.IClass" /&
&metaclass
name="Microsoft.VisualStudio.Uml.Classes.IInterface" /&
&metaclass
name="Microsoft.ponents.IComponent" /&
For the full list of model element and relationship types that you can use as metaclasses, see .
&Stereotype definition
The &stereotypes& section contains one or more stereotype definitions:
&stereotype name="CSharpClass" displayName="C# Class"& ...
Each stereotype lists one or more model element or relationship types to which it can be applied.
You can give the name of a base type, to include all its derived types.
For example, if you specify Microsoft.VisualStudio.Uml.Classes.IType, the stereotype can be applied to IClass, IInterface, IEnumeration, and several other types of element.
&metaclasses&
&metaclassMoniker name=
"/CSharpProfile/Microsoft.VisualStudio.Uml.Classes.IClass" /&
&/metaclasses&
The name attribute of metaclassMoniker is a link to an element in the &metaClasses& section. 注意The moniker name must begin with /yourProfileName/, where yourProfileName is defined in the name attribute of the profile ("CSharpProfile" in this example).
The moniker ends with the name of one of the entries in the metaclasses section.
Each stereotype can list zero or more properties that it adds to any model element to which it is applied.
The &propertyType& contains a link to one of the types that are defined in the &propertyTypes& section.
The link must be either an &externalTypeMoniker& to refer to an &externalType&, or an &enumerationTypeMoniker& to refer to an &enumerationType&.
Again, the link begins with the name of your profile.
&properties&
&property name="IsStatic"
displayName="Is Static" defaultValue="false"&
&propertyType&
&externalTypeMoniker
name="/CSharpProfile/System.Boolean" /&
&/propertyType&
&/property&
&property name="PackageVisibility"
displayName="Package Visibility"
defaultValue="internal"&
&propertyType&
&enumerationTypeMoniker
name="/CSharpProfile/PackageVisibility"/&
&/propertyType&
&/property&
&/properties&
&/stereotype&
&Model Element Types
The set of types for which you can define stereotypes is listed in .
&Troubleshooting
My stereotypes do not appear my UML models.You have to select your profile in a package or model.
The stereotypes will then appear on elements inside the package or model.
For more information, see .
The following error appears when I open a UML model: VS1707: The following profiles cannot be loaded because a serialization error occurred: MyProfile.profileVerify that the basic XML syntax of the .profile is correct.Ensure that each Moniker name is in the form /profileName/nodeName.
The profileName is the value of the name attribute in the root profile node.
The nodeName is the value of the name attribute of a metaclass, externalType, or enumerationType.
Ensure the syntax is as described here, and as demonstrated in drive:\Program Files\Microsoft Visual Studio [version]\Common7\IDE\Extensions\Microsoft\Architecture Tools\UmlProfiles\.Uninstall the faulty extension.
On the Tools menu, click Extensions and Updates.
If the extension does not appear, see the next item.Rebuild the VSIX file and open it in Windows Explorer to re-install it.
Restart Visual Studio.
The extension does not appear in Extension Manager, but when you try to re-install it, the following message appears: The extension is already installed to all applicable products.Remove the extension file from a subfolder of LocalAppData\Microsoft\VisualStudio\[version]\Extensions\To see LocalAppData, you must set Show Hidden Files and Folders in the View tab of the Windows Explorer Folder Options. LocalAppData is typically in C:\Users\userName\AppData\Local\Restart Visual Studio.
定义用于扩展 UML 的配置文件 可以定义 UML 配置文件,以针对特定目的自定义标准模型元素。
配置文件可定义一个或多个 UML 构造型。
构造型可用于标记类型以表示一种特定对象。
构造型还可以扩展元素的属性列表。
多个配置文件与受支持版本的 Visual Studio 一起安装。
若要查看支持此功能的 Visual Studio 版本,请参阅。
有关这些配置文件以及如何应用构造型的详细信息,请参阅。
你可以定义自己的配置文件,以采用 UML 并将其扩展到自己的业务范围或体系结构。
如果需要经常定义网站,则可以定义自己的配置文件,其中提供可应用到类图中的类的 <> 构造型。
然后可以使用类图规划网站。
每个 <> 类都会具有页面内容、样式等的额外属性。
如果需要开发银行软件,则可以定义一个提供 <> 构造型的配置文件。
然后可以使用类图定义不同类型的帐户并显示这些帐户之间的关系。
你可以将自己的配置文件分发给你的团队。
每个团队成员都可以安装你的配置文件。
这样一来,团队成员便可以编辑和创建使用其构造型的模型。
注意如果你在自己所编辑的模型中应用某个配置文件的构造型,然后与他人共享该模型,则他们应在其自己的计算机上安装同一配置文件。
否则,他们将无法看到你使用的构造型。
配置文件通常是较大 Visual Studio 扩展的一部分。
例如,你可以定义用于将模型的某些部件转换为代码的命令。
你可以定义用户必须应用到他们想要转换的包的配置文件。
您将在单个 Visual Studio 扩展中分发您的新命令和该配置文件。
你还可以定义配置文件的本地化变体。
加载你的扩展的用户可以看到适合他们自己的区域性的变体。
&如何定义配置文件
创建具有文件扩展名 .profile 的新 XML 文件。根据中所述的准则添加构造型定义。将配置文件添加到 Visual Studio 扩展中(.vsix 文件)。
你可以为配置文件创建新扩展,也可以将配置文件添加到现有扩展中。
请参阅下一节,。在你的计算机上安装扩展。双击扩展文件,该文件的文件扩展名为 .vsix。重新启动 Visual Studio。确认已安装配置文件。在 UML 资源管理器中选择模型。在“属性”窗口中,单击“配置文件”属性。
此时配置文件将在菜单中显示。
设置配置文件旁边的复选标记。
选择一个你的配置文件为其定义构造型的元素。
在“属性”窗口中,单击“构造型”属性。
此时你的构造型将在列表中显示。
设置其中一个构造型的复选标记。
如果你的配置文件为此构造型定义了附加属性,则可以展开构造型属性进行查看。将扩展文件发送给 Visual Studio 的其他用户,以将该文件安装到他们的计算机上。
&如何将配置文件添加到 Visual Studio 扩展中
要安装某个配置文件并允许你将其发送给其他用户,必须将该配置文件添加到 Visual Studio 扩展中。
有关详细信息,请参阅。
创建 Visual Studio 扩展项目。注意必须安装 Visual Studio SDK 才能使用此过程。在“文件”菜单上,指向“新建”,然后单击“项目”。在“新建项目”对话框的“已安装的模板”下,展开“Visual C#”,单击“扩展性”,然后单击“VSIX 项目”。
设置项目名称,然后单击“确定”。
将你的配置文件添加到项目中。在解决方案资源管理器中,右键单击项目,指向“添加”,然后单击“现有项”。
在对话框中找到你的配置文件。
设置该配置文件的“复制到输出”属性。在解决方案资源管理器中,右键单击该配置文件,然后单击“属性”。在“属性”窗口中,将“复制到输出目录”属性设置为“始终复制”。在解决方案资源管理器中,打开 source.extension.vsixmanifest。文件将在扩展清单编辑器中打开。在“资产”页上,添加一行来描述该配置文件:单击“新建”。
在“添加新资产”对话框中设置字段,如下所示。
将“类型”设置为 Microsoft.VisualStudio.UmlProfile这不是一个下拉式选择。
使用键盘输入此名称。
单击“文件系统中的文件”并选择配置文件的名称,例如 MyProfile.profile 生成项目。若要调试配置文件,请按 F5。这将打开一个 Visual Studio 实验实例。
在此实例中,打开建模项目。
在 UML 资源管理器中,选择模型的根元素,并在“属性”窗口中选择配置文件。
然后选择模型中的元素,并设置已为其定义的构造型。
提取部署的 VSIX在 Windows 资源管理器中,打开文件夹 .\bin\Debug 或 .\bin\Release 以查找 .vsix 文件。
此文件是 Visual Studio 扩展文件。
可以在你的计算机上安装该文件,也可将其发送给其他 Visual Studio 用户。
安装扩展:双击 .vsix 文件。
Visual Studio 扩展安装程序将启动。
重启任何正在运行的 Visual Studio 实例。如果尚未安装 Visual Studio SDK,则可以使用以下替代过程进行小型扩展。创建包含下列三个文件的 Windows 目录:YourProfile.profileextension.vsixmanifest[Content_Types].xml - 按照如下所示键入此名称,并将名称括在方括号中编辑 [Content_Types].xml 以包含下面的文本。
请注意,每个文件扩展名在该文件中都有对应项。
&?xml version="1.0" encoding="utf-8"?&
&Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"&
&Default Extension="profile" ContentType="application/octet-stream" /&
&Default Extension="vsixmanifest" ContentType="text/xml" /&
复制现有 extension.vsixmanifest 并使用 XML 编辑器进行编辑。
更改“ID”、“名称”和“内容”节点。
可以在以下目录中找到 extension.vsixmanifest 的示例:drive:\Program Files\Microsoft Visual Studio [version]\Common7\IDE\Extensions\Microsoft\Architecture Tools\UmlProfiles“内容”节点应如下所示:
&CustomExtension Type="Microsoft.VisualStudio.UmlProfile"
&YourProfile.Profile&/CustomExtension&
&/Content&
将这三个文件压缩到一个压缩文件中。在 Windows 资源管理器中,选择这三个文件,右键单击鼠标,指向“发送到”,然后单击“压缩(zipped)文件夹”。重命名该压缩文件,并将其文件扩展名从 .zip 更改为 .vsix。要在具有适当 Visual Studio 版本的任何计算机上安装该配置文件,请双击 .vsix 文件。在 Windows 资源管理器中双击 .vsix 文件,或在 Visual Studio 中打开该文件。在显示的对话框中,单击“安装”。若要卸载或临时禁用该扩展,请从“工具”菜单打开“扩展和更新”。
&如何定义本地化的配置文件
你可以为不同的区域性或语言定义不同的配置文件,并将所有配置文件打包到同一扩展中。
当用户加载你的扩展时,他们将会看到你为其区域性定义的配置文件。
必须始终提供默认配置文件。
如果没有为用户的区域性定义配置文件,则他们将看到该默认配置文件。
按照前面的章节和所述,创建配置文件。
这是默认配置文件,将在你未提供本地化的配置文件的任何安装中用到该配置文件。
在默认配置文件所在目录中添加一个新目录。注意如果要使用 Visual Studio 扩展项目生成扩展,请使用解决方案资源管理器向该项目添加一个新文件夹。将新目录的名称更改为本地化区域性所对应的 ISO 短代码,例如保加利亚语对应 bg,法语对应 fr。
应使用非特定区域性代码(通常为两个字母),而不应使用特定区域性代码(例如 fr-CA)。
有关区域性代码的详细信息,请参阅 ,其中提供了区域性代码的完整列表。
将默认配置文件的副本添加到新目录中。
请不要更改其文件名。
示例 Visual Studio 扩展文件夹在生成或压缩到 .vsix 文件之前,将包含下列文件夹和文件:
extension.vsixmanifest
MyProfile.profile
fr\MyProfile.profile
de\MyProfile.profile注意不应在 extension.vsixmanifest 中插入对配置文件的本地化版本的引用。
复制的配置文件必须与父文件夹中的配置文件同名。
编辑配置文件的新副本,将用户可见的所有部分(例如 displayName 特性)转换为目标语言。可以根据需要为多个区域性创建附加区域性文件夹和本地化的配置文件。通过生成扩展项目或压缩所有文件生成 Visual Studio 扩展,如前面的章节中所述。
&配置文件的结构
UML 配置文件的 XSD 文件可在以下示例中找到:。
为帮助编辑配置文件,请在以下位置安装 .xsd 文件:
%ProgramFiles%\Microsoft Visual Studio [version]\Xml\Schemas本节使用 C# 配置文件作为示例。
完整的配置文件定义位于:
drive:\Program Files\Microsoft Visual Studio [version]\Common7\IDE\Extensions\Microsoft\Architecture Tools\UmlProfiles\CSharp.profile此路径的开头部分在你的安装中可能有所不同。有关 .NET 配置文件的详细信息,请参阅 。
&UML 配置文件定义的主要部分
每个配置文件都包含以下内容:
&?xml version="1.0" encoding="utf-8"?&
&profile dslVersion="1.0.0.0"
name="CSharpProfile" displayName="C# Profile"
xmlns="/UML2.1.2/ProfileDefinition"&
&stereotypes&...&/stereotypes&
&metaclasses&...&/metaclasses&
&propertyTypes&...&/propertyTypes&
&/profile&
注意称为 name 的特性不能包含空格或标点。
在用户界面中显示的特性 displayName 应为有效的 XML 字符串。
每个配置文件都包含三个主要部分。
按照相反顺序,这三个部分如下所示:
&propertyTypes& - 用于构造型部分中定义的属性的类型列表。&metaclasses& - 此配置文件中的构造型应用到的模型元素类型列表,例如 IClass、IInterface、IOperation 和 IDependency。&stereotypes& - 构造型定义。
每个定义都包括添加到目标模型元素中的属性的名称和类型。
&propertyTypes&
部分声明用于 &stereotypes& 部分中的属性的类型列表。
属性类型有两种:外部和枚举。
外部类型声明标准 .NET 类型的完全限定名:
&externalType name="System.String" /&
枚举类型定义一组文本值:
&enumerationType name="PackageVisibility"&
&enumerationLiterals&
&enumerationLiteral name="internal" displayName="internal"
&enumerationLiteral name="protectedinternal" displayName="protected internal" /&
&/enumerationLiterals&
&/enumerationType&
&metaclasses& 部分是此配置文件中的构造型可以定义为的模型元素类型的列表:
&metaclass
name="Microsoft.VisualStudio.Uml.Classes.IClass" /&
&metaclass
name="Microsoft.VisualStudio.Uml.Classes.IInterface" /&
&metaclass
name="Microsoft.ponents.IComponent" /&
有关可用作元类的模型元素和关系类型的完整列表,请参阅。
&构造型定义
&stereotypes& 部分包含一个或多个构造型定义:
&stereotype name="CSharpClass" displayName="C# Class"& ...
每个构造型都列出了它可以应用到的一个或多个模型元素或关系类型。
你可以指定基类的名称,以包括其所有派生类型。
例如,如果指定 Microsoft.VisualStudio.Uml.Classes.IType,则构造型可以应用到元素的 IClass、IInterface、IEnumeration 以及多个其他类型。
&metaclasses&
&metaclassMoniker name=
"/CSharpProfile/Microsoft.VisualStudio.Uml.Classes.IClass" /&
&/metaclasses&
metaclassMoniker 的 name 特性是一个指向 &metaClasses& 部分中某个元素的链接。注意名字对象的名称必须以 /yourProfileName/ 开头,其中 yourProfileName 在配置文件(此示例中为“CSharpProfile”)的 name 特性中定义。
名字对象以元类部分中的某个项的名称结尾。
每个构造型都可以列出零个或多个属性,该构造型将这些属性添加到它所应用到的任何模型元素。
&propertyType& 包含指向 &propertyTypes&
部分中定义的某个类型的链接。
该链接必须为用于引用 &externalType&, 的 &externalTypeMoniker&,或为用于引用 &enumerationType& 的 &enumerationTypeMoniker&。
再次强调,该链接以你的配置文件的名称开头。
&properties&
&property name="IsStatic"
displayName="Is Static" defaultValue="false"&
&propertyType&
&externalTypeMoniker
name="/CSharpProfile/System.Boolean" /&
&/propertyType&
&/property&
&property name="PackageVisibility"
displayName="Package Visibility"
defaultValue="internal"&
&propertyType&
&enumerationTypeMoniker
name="/CSharpProfile/PackageVisibility"/&
&/propertyType&
&/property&
&/properties&
&/stereotype&
&模型元素类型
中列出了可以为其定义构造型的类型集。
我的构造型不显示我的 UML 模型。必须在包或模型中选择配置文件。
然后,构造型将在包或模型内部的元素上显示。
有关详细信息,请参阅。
打开 UML 模型时出现以下错误:VS1707: The following profiles cannot be loaded because a serialization error occurred: MyProfile.profile验证 .profile 的基本 XML 语法是否正确。确保每个名字对象名称的格式都为 /profileName/nodeName。
profileName 是根配置文件节点中的名称特性的值。
nodeName 是元类、externalType 或 enumerationType 的名称特性的值。
确保语法与此处所述和 drive:\Program Files\Microsoft Visual Studio [version]\Common7\IDE\Extensions\Microsoft\Architecture Tools\UmlProfiles\ 中所示的语法一致。卸载有错误的扩展。
在“工具”菜单上,单击“扩展和更新”。
如果未显示该扩展,请查看下一个项。重新生成 VSIX 文件,然后在 Windows 资源管理器中打开该文件以将其重新安装。
重新启动 Visual Studio。
扩展管理器中未显示该扩展,但当你尝试重新安装它时,会出现以下消息:The extension is already installed to all applicable products.从 LocalAppData\Microsoft\VisualStudio\[版本]\Extensions\ 的子文件夹中删除该扩展文件。要查看 LocalAppData,必须在 Windows 资源管理器“文件夹选项”的“查看”选项卡中设置“显示隐藏的文件和文件夹”。LocalAppData 通常位于 C:\Users\userName\AppData\Local\ 中重新启动 Visual Studio。

我要回帖

更多关于 ug在装配中创建基准面 的文章

 

随机推荐