Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: experimental/visual_studio_plugin/src/NaClVsx.Package/Installation/PortSupplierRegistrationAttribute.cs

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using Microsoft.VisualStudio.Shell;
6
7 namespace Google.NaClVsx.Installation
8 {
9 [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
10 public sealed class PortSupplierRegistrationAttribute : RegistrationAttribute
11 {
12 public PortSupplierRegistrationAttribute(Type portSupplierType) {
13 portSupplierType_ = portSupplierType;
14 }
15
16 public Type PortSupplierType {
17 get { return portSupplierType_; }
18 set { portSupplierType_ = value; }
19 }
20
21 public string Name {
22 get { return name_; }
23 set { name_ = value; }
24 }
25
26 public bool DisallowUserPorts {
27 get { return disallowUserPorts_; }
28 set { disallowUserPorts_ = value; }
29 }
30
31 #region Overrides of RegistrationAttribute
32
33 public override void Register(RegistrationContext context) {
34 Key key = context.CreateKey(KeyName());
35 key.SetValue("CLSID", ClsIdString());
36 key.SetValue("DisallowUserEnteredPorts", disallowUserPorts_ ? 1 : 0);
37 key.SetValue("Name", name_);
38 }
39
40 public override void Unregister(RegistrationContext context) {
41 context.RemoveKey(KeyName());
42 }
43
44 #endregion
45
46 string ClsIdString() {
47 return PortSupplierType.GUID.ToString("B");
48 }
49
50 string KeyName()
51 {
52 return string.Format("AD7Metrics\\PortSupplier\\{0}", ClsIdString());
53 }
54
55 private Type portSupplierType_;
56 private string name_ = "[Port provider name goes here]";
57 private bool disallowUserPorts_ = false;
58 }
59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698