Skip to content

Format code snippets #1702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/extensibility/registering-and-unregistering-vspackages.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ You use attributes to register a VSPackage, but
[PackageRegistration(UseManagedResourcesOnly = true)]
[Guid("0B81D86C-0A85-4f30-9B26-DD2616447F95")]
public sealed class BasicPackage : Package
{. . .}
{
// ...
}
```

## Unregister an extension
Expand Down Expand Up @@ -57,9 +59,9 @@ The following code shows how to create a new registration attribute.

```csharp
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
public class CustomRegistrationAttribute : RegistrationAttribute
{
}
public class CustomRegistrationAttribute : RegistrationAttribute
{
}
```

The <xref:System.AttributeUsageAttribute> is used on attribute classes to specify the program element (class, method, etc.) to which the attribute pertains, whether it can be used more than once, and whether it can be inherited.
Expand Down Expand Up @@ -107,7 +109,7 @@ public override void Register(RegistrationAttribute.RegistrationContext context)
{
if (packageKey != null)
packageKey.Close();
}
}
}

public override void Unregister(RegistrationContext context)
Expand Down