[Vsx.001] go deep into vs SDK

Source: Internet
Author: User

This article takes notes for reading the inside the Visual Studio SDK.

 

There are many ways to scale vs, the most common of which are automation, vspackage extensions, and managed extensibility framework (MEF) extensions.

 

Automation: Mainly used for repetitive tasks that can be automated, such as macro, add-in, and wizard ).

 

Vspackage Extension: VS has many components, such as vspackage (debugger) and tool bar (predefined toolbar ). vspackage is a powerful method to expand vs. It can access and expand many components of Vs, such as shell and project system ).

 

MEF (managed extensibility framework): MEF is an extension mechanism that allows you to customize and extend the editor without creating vspackage. [puzzled]

Vs extensibility model (vs scalable model)

 

The vs scalability model consists of different libraries to allow new extensions to access various components of.

 

The most basic model is that vs API is a series of interfaces. Microsoft employees use them to develop.CodeYou can use a template-based VSL (vs Library) to write extensions.

 

If you choose managed code, you can use vs InterOP assembliesProgramSet ??), Alternatively, you can use the MPF (managed package framework, different from the MEF class provided above) to encapsulate many vs API interfaces.

 

If you need to extend the editor, you can use the editor assembly or MEF assembly. [puzzled]

 

Read more:

    • Developing vspackages by using the Visual Studio Library

    • Vspackages and the managed package framework

 

Vs services)

A Service provides a series of interfaces. vs provides a series of services that can be used by any components, including extensions. for example, the service allows the tool window to be dynamically displayed/hidden, access help, Status Bar, and UI events. the services provided by the vs2010 editor can be extended and imported by the editor.

 

Read more:

    • Service Essentials

    • Registering services

    • List of available services

    • Editor services

Vs extensible Components

Frequently extended components include:

Shell Command (commands)

Menu Bar and toolbar

Tool Windows)

Document windows)

Editor)

Language Service)

Project)

Template)

 

Command)

Commands are some tasks, such as printing documents, redrawing views, and creating new files.

You can create and register these commands to vs. You can decide where these commands appear in Vs, such as menus or toolbar. Generally, custom commands appear in"Tools )"Menu, the command of the tool window is usually displayed in"View"Sub-menu"Other windows.

You must create an event handler for the command ). the event handler determines when the command is visible or enabled, lets you modify its text, and guarantees that the command responds appropriately when it is activated. in most instances, the IDE handles commands by using the iolecommandtarget interface. commands in Visual Studio are handled starting with the innermost command context, based on the local selection, and proceeding to the outermost context, based on the global selection. commands added to the main menu are immediately available for scripting.

 

Read more:

How vspackages add user interface elements to the IDE.

 

Menu and toolbar

This section is all nonsense. You can call commands for menus, including the main menu, sub menu, and context menu (right-click menu ).

Read more:

Common menu tasks

This is nonsense. What is tool bar.

Read more:

    • Menu and toolbar Essen

    • Default command, group, and toolbar placement

Tool Windows)

Tool window example: toolbox, Solution Explorer, Properties window, Web browser.

The tool window provides a variety of controls that can interact with users. for example, the Properties window allows you to set the properties of an object and use them in different scenarios. the output window is similar. and so on...

Several tool windows for vs are listed:

Different windows can be docked on a panel (PANE.

The main document window shows several editor windows docked on a panel.

 

 

When you create and correctly register your tool (or editor) Window Extensions, they automatically have the same features as the original tool window.

 

Read more:

    • Tool Windows.

    • Tool window Essentials

    • How to: create a tool window

Document windows)

The concept of a document window is the window of MDI (Multiple-Document Interface), such as the document editor and designer...

Document windows are generally associated with file types, such as HTML and C ++ files ..

Read more:

    • Document windows

    • Document windows Overview

    • Document window implementation

Editor

The editor is a new component of vs2010. the editor itself is a vspackage. You can use MEF to expand it. In most cases, you do not need to create a new vspackage. when you want to use menu commands or shortcut keys, you can create a vspackage with MEF.

When you want to create a custom designer or other components, you can create an editor.

Read more:

Editors

Language Service)

NewProgramming LanguageYou must create a language service. The language service provides editor features such as syntax highlighting and smart prompts.

The core of language service is a parser and a scanner or lexer ). the parser divides the source file into elements called tokens, and parser determines the relationship between these tokens.

You can create hosted and unmanaged language services.

Read more:

    • Implementing a language service by using the managed package framework.

    • Walkthrough: creating a Language Service (managed package Framework)

    • Developing a language service

Projects)

Project is used to organize and buildSource codeAnd other resources. You can use vspackage to provide the project type, project subtype, and custom tools to expand the vs project system.

Solution is one or more projects. solution is stored in the. sln file.

Read more:

    • Project types

    • Project subtypes

    • Solutions

    • Walkthrough: Part 1-creating a basic project system

Project and item templates

The template contains the project structure and basic files.

Read more:

Adding project and project item templates.

Integrated and independent (isolated) applications.

One is integrated into the original vs, and one contains an independent vs shell.

Read more:

    • Visual Studio shell, integrated mode and isolated Mode

    • Visual Studio shell (isolated Mode)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.