示例#1
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 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();
     }
 }
示例#3
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;
        }