Ejemplo n.º 1
0
 private void Execute(ISender client, GetDeleteRegistryValueResponse message)
 {
     if (!message.IsError)
     {
         OnValueDeleted(message.KeyPath, message.ValueName);
     }
     else
     {
         OnReport(message.ErrorMsg);
     }
 }
Ejemplo n.º 2
0
 public static void HandleDeleteRegistryValue(GetDeleteRegistryValueResponse 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.DeleteValue(packet.KeyPath, packet.ValueName);
             }
             else
             {
                 client.Value.FrmRe.ShowErrorMessage(packet.ErrorMsg);
             }
         }
     }
     catch { }
 }
        public static void HandleDeleteRegistryValue(DoDeleteRegistryValue packet, Networking.Client client)
        {
            GetDeleteRegistryValueResponse responsePacket = new GetDeleteRegistryValueResponse();
            string errorMsg;

            try
            {
                responsePacket.IsError = !(RegistryEditor.DeleteRegistryValue(packet.KeyPath, packet.ValueName, out errorMsg));
            }
            catch (Exception ex)
            {
                responsePacket.IsError = true;
                errorMsg = ex.Message;
            }
            responsePacket.ErrorMsg  = errorMsg;
            responsePacket.ValueName = packet.ValueName;
            responsePacket.KeyPath   = packet.KeyPath;

            client.Send(responsePacket);
        }
Ejemplo n.º 4
0
        private void Execute(ISender client, DoDeleteRegistryValue message)
        {
            GetDeleteRegistryValueResponse responsePacket = new GetDeleteRegistryValueResponse();
            string errorMsg;

            try
            {
                responsePacket.IsError = !(RegistryEditor.DeleteRegistryValue(message.KeyPath, message.ValueName, out errorMsg));
            }
            catch (Exception ex)
            {
                responsePacket.IsError = true;
                errorMsg = ex.Message;
            }
            responsePacket.ErrorMsg  = errorMsg;
            responsePacket.ValueName = message.ValueName;
            responsePacket.KeyPath   = message.KeyPath;

            client.Send(responsePacket);
        }
Ejemplo n.º 5
0
 public static void HandleDeleteRegistryValue(GetDeleteRegistryValueResponse 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.DeleteValueFromList(packet.KeyPath, packet.ValueName);
             }
             else
             {
                 client.Value.FrmRe.ShowErrorMessage(packet.ErrorMsg);
             }
         }
     }
     catch
     {
     }
 }