void App_Startup(object sender, StartupEventArgs e) { //if (!File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + "BackupSoftDB.mdf")) // SetConnectionString(); //DBContext = new BackupSoftDBContext(); //System.Diagnostics.Debug.WriteLine(DBContext.Database.Connection.ConnectionString); //var test = new BackupFolder { Fullname = @"C:\test", IsChecked = true }; //DBContext.BackupFolders.Add(test); //DBContext.SaveChanges(); //DBContext.Database.CreateIfNotExists(); Config = Sauvegarde.c; notifyIcon = new System.Windows.Forms.NotifyIcon(); ConfigureNotifyIcon(); Configuretimer(); Directory.CreateDirectory("Data"); Log.Write("Lancement de l'application"); //ConnectedToAMFNetwork(); this.isAutoLogonEnabled = (bool)Serialization.deserialize(); if (this.isAutoLogonEnabled == true) { Thread.Sleep(60000); RegistryModifier.disableAutoLogon(); this.isAutoLogonEnabled = false; Serialization.serialize(this.isAutoLogonEnabled); //initSaveViewer(); } }
public void CreationRegistryTest() { RegistryModel registry = new RegistryModel(); registry.RegistryName = "TestRegistry"; registry.SubKeySeparatedByBackSlashes = "HKEY_CURRENT_USER\\SOFTWARE\\RegistryManipulationAPI"; var modifier = new RegistryModifier(); Assert.IsFalse(registry.IsRegistryReal); modifier.Create(new { Installed = true }, registry); Assert.IsTrue(registry.IsRegistryReal); registry.SubKey.DeleteEntireTree(); }
public void ChangeRegistryTest() { var finder = new RegistryFinder(); var modifier = new RegistryModifier(); RegistryModel registry = new RegistryModel { SubKeySeparatedByBackSlashes = "Control Panel\\Desktop", RegistryName = "LogPixels" }; var beforeValue = new RegistryFinder().GetValueFrom(registry); modifier.Set("60", registry); var afterValue = new RegistryFinder().GetValueFrom(registry); Assert.IsTrue((string)afterValue == "60"); modifier.Set("96", registry); afterValue = new RegistryFinder().GetValueFrom(registry); Assert.IsTrue((string)afterValue == "96"); }
public static SettingsModel GetSettingsModel(RegistryModifier registryModifier, Settings settings) { return(new SettingsModel(registryModifier, settings)); }
public static HidGuardianManager GetHidGuardianManager(RegistryModifier registryModifier) { return(new HidGuardianManager(registryModifier)); }