ILSupport 项目使用教程

随笔3周前发布 水中莲
36 0 0

ILSupport 项目使用教程

ILSupportA Visual Studio extension that provides syntax highlighting for the IL (Intermediate Language) and project templates for C#, F# and Visual Basic that support embedding and calling IL code.项目地址:https://gitcode.com/gh_mirrors/il/ILSupport

1. 项目的目录结构及介绍

ILSupport 是一个 Visual Studio 扩展,用于为 IL(Intermediate Language)提供语法高亮和项目模板。以下是项目的目录结构及各部分介绍:

  1. ILSupport/

  2. ├── src/

  3. │ ├── ILSupport/

  4. │ │ ├── Properties/

  5. │ │ ├── Resources/

  6. │ │ ├── bin/

  7. │ │ ├── obj/

  8. │ │ ├── ILSupportPackage.cs

  9. │ │ ├── ILSupportPackage.vsct

  10. │ │ ├── ILSupportPackage.resx

  11. │ │ ├── ILSupportPackage.csproj

  12. │ │ └── ...

  13. │ ├── ILSupport.Test/

  14. │ │ ├── Properties/

  15. │ │ ├── bin/

  16. │ │ ├── obj/

  17. │ │ ├── ILSupportTest.csproj

  18. │ │ └── ...

  19. ├── .gitignore

  20. ├── LICENSE

  21. ├── README.md

  22. └── ILSupport.sln

  • src/ILSupport/: 包含扩展的主要代码和资源文件。
    • ILSupportPackage.cs: 扩展的主入口点。
    • ILSupportPackage.vsct: 命令表配置文件。
    • ILSupportPackage.resx: 资源文件。
    • ILSupportPackage.csproj: 项目文件。
  • src/ILSupport.Test/: 包含测试代码。
  • .gitignore: Git 忽略文件。
  • LICENSE: 许可证文件。
  • README.md: 项目说明文档。
  • ILSupport.sln: Visual Studio 解决方案文件。

2. 项目的启动文件介绍

项目的启动文件是 ILSupportPackage.cs,它是扩展的主入口点。该文件负责初始化扩展并注册必要的命令和服务。

  1. [ProvideAutoLoad(UIContextGuids80.SolutionExists)]

  2. [PackageRegistration(UseManagedResourcesOnly = true)]

  3. [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]

  4. [ProvideMenuResource("Menus.ctmenu", 1)]

  5. [Guid(GuidList.guidILSupportPkgString)]

  6. public sealed class ILSupportPackage : Package

  7. {

  8. // 初始化方法

  9. protected override void Initialize()

  10. {

  11. base.Initialize();

  12. // 注册命令和服务

  13. }

  14. }

3. 项目的配置文件介绍

项目的配置文件主要包括 ILSupportPackage.vsctILSupportPackage.resx

  • ILSupportPackage.vsct: 该文件定义了扩展的命令表,包括菜单项、工具栏按钮等。
  1. <CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  2. <Commands package="guidILSupportPkg">

  3. <Menus>

  4. <Menu id="cmdidILSupportMenu" priority="0x1000" type="Menu" ...>

  5. <Strings>

  6. <ButtonText>IL Support</ButtonText>

  7. </Strings>

  8. </Menu>

  9. </Menus>

  10. <Buttons>

  11. <Button id="cmdidILSupportCommand" priority="0x0100" ...>

  12. <Strings>

  13. <ButtonText>IL Support Command</ButtonText>

  14. </Strings>

  15. </Button>

  16. </Buttons>

  17. </Commands>

  18. </CommandTable>

  • ILSupportPackage.resx: 该文件包含扩展的本地化资源,如字符串和图标。
  1. <root>

  2. <data name="110" xml:space="preserve">

  3. <value>IL Support</value>

  4. </data>

  5. <data name="112" xml:space="preserve">

  6. <value>Provides syntax highlighting for IL code</value>

  7. </data>

  8. </root>

以上是 ILSupport 项目的目录结构、启动文件和配置文件的介绍。希望这份教程能帮助你更好地理解和使用 ILSupport 扩展。

ILSupportA Visual Studio extension that provides syntax highlighting for the IL (Intermediate Language) and project templates for C#, F# and Visual Basic that support embedding and calling IL code.项目地址:https://gitcode.com/gh_mirrors/il/ILSupport

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...