public bool CounterConfigerSelective(List<ConfigerStatus> configerStatus)
 {
     try
     {
         RegeditWriteRead writeToReg = new RegeditWriteRead();
         var tempRegistryInfo = from allRegistryData in new RegistryData().registryDataCollection from confiStatus in configerStatus where allRegistryData.Name.Equals(confiStatus.Name) select new { allRegistryData, confiStatus };
         foreach (var registryEntry in tempRegistryInfo)
         {
             if (registryEntry.confiStatus.Status)
             {
                 writeToReg.RegistryWriter(registryEntry.allRegistryData.Name, registryEntry.allRegistryData.keyName, registryEntry.allRegistryData.enableValue, registryEntry.allRegistryData.valueKind);
             }
             else
             {
                 writeToReg.RegistryWriter(registryEntry.allRegistryData.Name, registryEntry.allRegistryData.keyName, registryEntry.allRegistryData.disableValue, registryEntry.allRegistryData.valueKind);
             }
         }
         return true;
     }
     catch (Exception)
     {
         throw new FaultException(ClientVariables.ERROR_MESSAGES[0, 0]);
     }
     finally
     {
         this.RestartCounter();
     }
 }
Example #2
0
 public bool CounterConfigerSelective(List <ConfigerStatus> configerStatus)
 {
     try
     {
         RegeditWriteRead writeToReg = new RegeditWriteRead();
         var tempRegistryInfo        = from allRegistryData in new RegistryData().registryDataCollection from confiStatus in configerStatus where allRegistryData.Name.Equals(confiStatus.Name) select new { allRegistryData, confiStatus };
         foreach (var registryEntry in tempRegistryInfo)
         {
             if (registryEntry.confiStatus.Status)
             {
                 writeToReg.RegistryWriter(registryEntry.allRegistryData.Name, registryEntry.allRegistryData.keyName, registryEntry.allRegistryData.enableValue, registryEntry.allRegistryData.valueKind);
             }
             else
             {
                 writeToReg.RegistryWriter(registryEntry.allRegistryData.Name, registryEntry.allRegistryData.keyName, registryEntry.allRegistryData.disableValue, registryEntry.allRegistryData.valueKind);
             }
         }
         return(true);
     }
     catch (Exception)
     {
         throw new FaultException(ClientVariables.ERROR_MESSAGES[0, 0]);
     }
     finally
     {
         this.RestartCounter();
     }
 }
 public List<ConfigerStatus> LoadCounterConfiger()
 {
     List<ConfigerStatus> AllCounterConfigration = new List<ConfigerStatus>();
     RegeditWriteRead registrCheck=new RegeditWriteRead();
     foreach (ResistryProperty configInfo in new RegistryData().registryDataCollection)
     {
         AllCounterConfigration.Add(new ConfigerStatus { Name = configInfo.Name, Status = registrCheck.CheckRegistryKey(configInfo.FullPath, configInfo.keyName) });
     }
     return AllCounterConfigration;
 }
Example #4
0
        //At Start up Unchecked
        private void GeneralCheckBoxStartAtStartUpUnChecked(object sender, System.Windows.RoutedEventArgs e)
        {
            this.GeneralCheckBoxStartAtStartUp.IsEnabled = false;
            this.Cursor = Cursors.Wait;
            RegeditWriteRead registryDaelete = new RegeditWriteRead();

            registryDaelete.RegistryKeyDelete(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\", "Albatross");
            Properties.Settings.Default.StartupEnable = false;
            Properties.Settings.Default.Save();
            this.GeneralCheckBoxStartAtStartUp.IsEnabled = true;
            this.Cursor = Cursors.Arrow;
        }
Example #5
0
        //At Start Up Checked
        private void GeneralCheckBoxStartAtStartUpChecked(object sender, System.Windows.RoutedEventArgs e)
        {
            this.GeneralCheckBoxStartAtStartUp.IsEnabled = false;
            this.Cursor = Cursors.Wait;
            RegeditWriteRead registryWrite = new RegeditWriteRead();

            registryWrite.RegistryWriter(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Albatross", string.Format("{0} -s", System.Reflection.Assembly.GetExecutingAssembly().Location), Microsoft.Win32.RegistryValueKind.String);
            Properties.Settings.Default.StartupEnable = true;
            Properties.Settings.Default.Save();
            this.GeneralCheckBoxStartAtStartUp.IsEnabled = true;
            this.Cursor = Cursors.Arrow;
        }
Example #6
0
        public List <ConfigerStatus> LoadCounterConfiger()
        {
            List <ConfigerStatus> AllCounterConfigration = new List <ConfigerStatus>();
            RegeditWriteRead      registrCheck           = new RegeditWriteRead();

            foreach (ResistryProperty configInfo in new RegistryData().registryDataCollection)
            {
                AllCounterConfigration.Add(new ConfigerStatus {
                    Name = configInfo.Name, Status = registrCheck.CheckRegistryKey(configInfo.FullPath, configInfo.keyName)
                });
            }
            return(AllCounterConfigration);
        }