Beispiel #1
0
 private void AddRegistryValue(Wix.RegistryType type)
 {
     if (tvRegistries.SelectedNode != null && tvRegistries.SelectedNode.Level > 0)
     {
         TreeNode node = tvRegistries.SelectedNode;
         if (node.Tag != null)// use values in tag
         {
             if (type == Wix.RegistryType.multiString)
             {
                 List <RegistryValue> values = (List <RegistryValue>)node.Tag;
                 values.Add(new RegistryMultipleValue(type));
             }
             else
             {
                 List <RegistryValue> values = (List <RegistryValue>)node.Tag;
                 values.Add(new RegistrySingleValue(type));
             }
         }
         else  // else create new list and set the tag
         {
             if (type == Wix.RegistryType.multiString)
             {
                 List <RegistryValue> values = new List <RegistryValue>();
                 values.Add(new RegistryMultipleValue(type));
                 node.Tag = values;
             }
             else
             {
                 List <RegistryValue> values = new List <RegistryValue>();
                 values.Add(new RegistrySingleValue(type));
                 node.Tag = values;
             }
         }
         // Reselect to show all added custom items
         tvRegistries.SelectedNode = null;
         tvRegistries.SelectedNode = node;
     }
 }
 public RegistryMultipleValue(Wix.RegistryType type)
     : base(type)
 {
 }
 public RegistrySingleValue(Wix.RegistryType type)
     : base(type)
 {
 }
 public RegistryValue(Wix.RegistryType type)
 {
     this.type = type;
     name      = "New " + type.ToString() + " value " + counter++;
 }