public Main() { InitializeComponent(); PortableSettingsProvider.SettingsFileName = Common.USER_SETTINGS; PortableSettingsProviderBase.SettingsDirectory = Process.path_prefix; PortableSettingsProvider.ApplyProvider(Common.Settings.Default, Common.History.Default); Common.Settings.Default.Upgrade(); Common.History.Default.Upgrade(); debugLogToolStripMenuItem.Checked = Common.Settings.Default.DebugLog; aboutToolStripMenuItem.Text = String.Format("&About {0}", Application.ProductName); bool init = Process.initialize(out List <string> messages); foreach (var message in messages) { MessageBox.Show(message, Application.ProductName); } if (!init) { Environment.Exit(-1); } titles = Process.processHistory(); reloadData(); toolStripStatusLabel.Text = String.Format("{0} files", titles.Count); }
static void Main() { int process = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length; if (process > 1) { return; } // Set DPI AWARE if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } PortableSettingsProvider.SettingsFileName = "Settings.config"; PortableSettingsProvider.SettingsDirectory = exePath; PortableSettingsProvider.ApplyProvider(Properties.Settings.Default); if (!File.Exists(exePath + "\\ResGen.exe")) { file = FileController.Instance; file.Dispose(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Start(); }
private void FormGUI_Load(object sender, EventArgs e) { //https://github.com/Bluegrams/SettingsProviders PortableSettingsProvider.SettingsFileName = "Il2CppDumper.config"; PortableSettingsProviderBase.SettingsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); PortableSettingsProvider.ApplyProvider(Settings.Default); binFileTxtBox.Text = Settings.Default.BinaryFileTxtBox; datFileTxtBox.Text = Settings.Default.DatFileTxtBox; outputTxtBox.Text = Settings.Default.OutputTxtBox; androArch.SelectedIndex = Settings.Default.AndroArch; if (Settings.Default.RememberWindowPosition) { Location = Settings.Default.Location; } titleLbl.Text += " " + Version; if (IsAdministrator()) { titleLbl.Text += " - Administrator "; Log("You are running as administrator. Drag and drop will not work\nIf this program is running as administrator by default, change your User Account Control back to default", Color.Yellow); } if (Settings.Default.CheckForUpdate) { CheckUpdate(); } }
private static void Main() { PortableSettingsProvider.ApplyProvider(Properties.Settings.Default); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); }
public static void Main() { PortableSettingsProvider.ApplyProvider(Calcex.Windows.Properties.Settings.Default); var application = new App(); application.InitializeComponent(); application.Run(); }
public override void WindowDidLoad() { base.WindowDidLoad(); tableViewDataSource = new TableViewDataSource(); tableViewDelegate = new TableViewDelegate(tableViewDataSource); tableView.DataSource = tableViewDataSource; tableView.Delegate = tableViewDelegate; PortableSettingsProvider.SettingsFileName = Common.USER_SETTINGS; PortableSettingsProviderBase.SettingsDirectory = Process.path_prefix; PortableSettingsProvider.ApplyProvider(Common.Settings.Default, Common.History.Default); Common.Settings.Default.Upgrade(); Common.History.Default.Upgrade(); NSMenuItem debugLog = Window.Menu?.ItemWithTitle("File")?.Submenu.ItemWithTitle("Debug Log"); if (debugLog != null) { debugLog.State = Common.Settings.Default.DebugLog ? NSCellStateValue.On : NSCellStateValue.Off; } bool init = Process.initialize(out List <string> messages); foreach (var message in messages) { var alert = new NSAlert() { InformativeText = message, MessageText = NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleExecutable").ToString(), }; alert.RunModal(); } if (!init) { Environment.Exit(-1); } backgroundWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true }; backgroundWorker.DoWork += BackgroundWorker_DoWork; backgroundWorker.ProgressChanged += BackgroundWorker_ProgressChanged; backgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted; titles = Process.processHistory(); tableViewDataSource.Titles.AddRange(titles); tableView.ReloadData(); }
static void Main() { if (AppInfo.IsPortable.GetValueOrDefault()) { PortableSettingsProvider.ApplyProvider(Settings.Default); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainApplicationContext()); }
static void Main() { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; if (AppInfo.IsPortable.GetValueOrDefault()) { PortableSettingsProvider.ApplyProvider(Settings.Default); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainApplicationContext()); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); PortableSettingsProvider.SettingsFileName = "ClientRtkGps.config"; PortableSettingsProvider.SettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"DSS\configuration\"); PortableSettingsProvider.ApplyProvider(Settings.Default); Application.Run(new RtkForm()); }
} // end method ApplyTheme /// <summary> /// Configure the customised settings provider. /// </summary> private void ConfigSettingsProvider() { PortableSettingsProvider.SettingsFileName = "user.config"; if (_productId != null && _productCompany != null) { var customisedSettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), _productCompany, _productId); if (!Directory.Exists(customisedSettingsDirectory)) Directory.CreateDirectory(customisedSettingsDirectory); PortableSettingsProviderBase.SettingsDirectory = customisedSettingsDirectory; } // end if PortableSettingsProvider.ApplyProvider(ShSzStockHelper.Properties.Settings.Default); } // end method ConfigSettingsProvider
public Main() { InitializeComponent(); PortableSettingsProvider.SettingsFileName = Common.USER_SETTINGS; PortableSettingsProviderBase.SettingsDirectory = Process.path_prefix; PortableSettingsProvider.ApplyProvider(Common.Settings.Default, Common.History.Default); Common.Settings.Default.Upgrade(); Common.History.Default.Upgrade(); debugLogToolStripMenuItem.Checked = Common.Settings.Default.DebugLog; aboutToolStripMenuItem.Text = String.Format("&About {0}", Application.ProductName); int index = 0; foreach (string property in Title.Properties) { ToolStripMenuItem menuItem = new ToolStripMenuItem { Name = String.Format("property{0}ToolStripMenuItem", index++), Text = property, }; menuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); copyToolStripMenuItem.DropDownItems.Add(menuItem); } bool init = Process.initialize(out List <string> messages); foreach (var message in messages) { MessageBox.Show(message, Application.ProductName); } if (!init) { Environment.Exit(-1); } Process.migrateSettings(); }
private void Application_Startup(object sender, StartupEventArgs e) { #if PORTABLE PortableSettingsProvider.ApplyProvider(Settings.Default); #endif AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;; initializeDefaultSettings(); // register services and view models registerServices(); InitializeDownloadEngine(); registerVMs(); // apply theme var themeResolver = SimpleIoc.Default.GetInstance <IThemeResolver>(); themeResolver.SetColorScheme(Settings.Default.AppTheme); // setup main window MainWindow mainWindow = new MainWindow(); mainWindow.DataContext = SimpleIoc.Default.GetInstance <MainViewModel <MediaEntry> >(); SimpleIoc.Default.Register <IUpdateChecker>( () => new WpfUpdateChecker(UPDATE_URL, mainWindow, UPDATE_IDENTIFIER)); mainWindow.Show(); }
public void AutoOpen() { PortableSettingsProvider.AllRoaming = true; PortableSettingsProvider.SettingsFileName = "FFE.config"; PortableSettingsProvider.ApplyProvider(AvqSetting.Default); PortableSettingsProvider.ApplyProvider(CbqSetting.Default); PortableSettingsProvider.ApplyProvider(PlugInSetting.Default); PortableSettingsProvider.ApplyProvider(SsqSetting.Default); PortableSettingsProvider.ApplyProvider(FfeSetting.Default); Log.Logger = FfeLogger.CreateDefaultLogger(); if (FfeSetting.Default.CheckUpdateOnStartup) { FfeUpdate.CheckUpdate(false); } if (FfeSetting.Default.RegisterFunctionsOnStartup) { RegisterFunctions(); RegisterDelegates(); } }
public override void WindowDidLoad() { base.WindowDidLoad(); tableViewDataSource = new TableViewDataSource(); tableViewDelegate = new TableViewDelegate(tableViewDataSource); tableView.DataSource = tableViewDataSource; tableView.Delegate = tableViewDelegate; PortableSettingsProvider.SettingsFileName = Common.USER_SETTINGS; PortableSettingsProviderBase.SettingsDirectory = Process.path_prefix; PortableSettingsProvider.ApplyProvider(Common.Settings.Default, Common.History.Default); Common.Settings.Default.Upgrade(); Common.History.Default.Upgrade(); NSMenuItem debugLog = Window.Menu?.ItemWithTitle("File")?.Submenu.ItemWithTitle("Debug Log"); if (debugLog != null) { debugLog.State = Common.Settings.Default.DebugLog ? NSCellStateValue.On : NSCellStateValue.Off; } historyMenu = Window.Menu?.ItemWithTitle("History")?.Submenu; InitContextMenu(contextMenu.ItemWithTitle("Copy")?.Submenu); bool init = Process.initialize(out List <string> messages); foreach (var message in messages) { var alert = new NSAlert() { InformativeText = message, MessageText = NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleExecutable").ToString(), }; alert.RunModal(); } if (!init) { Environment.Exit(-1); } Process.migrateSettings(); backgroundWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true }; backgroundWorker.DoWork += BackgroundWorker_DoWork; backgroundWorker.ProgressChanged += BackgroundWorker_ProgressChanged; backgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted; int index = 0; foreach (ArrayOfTitle history in Common.History.Default.Titles) { NSMenuItem menuItem = new NSMenuItem(String.Format("{0} ({1} files)", history.description, history.title.Count), new System.EventHandler(History)); historyMenu.AddItem(menuItem); index++; } if (index > 0) { historyMenu.Items[index - 1].State = NSCellStateValue.On; } titles = Process.processHistory(); tableViewDataSource.Titles.AddRange(titles); tableView.ReloadData(); }
protected override void OnStartup(object sender, StartupEventArgs e) { PortableSettingsProvider.ApplyProvider(Model.Properties.Settings.Default); DisplayRootViewFor <MasterViewModel>(); }
public static void InitilizeSettings() { // Tool Initial Settings if (!Directory.Exists(exePath + @"\Logs\")) { Directory.CreateDirectory(exePath + @"\Logs\"); } CheckNetFamework.IFNOT48(); if (!Directory.Exists(exePath + @"\Settings\")) { Directory.CreateDirectory(exePath + @"\Settings\"); } PortableSettingsProvider.SettingsFileName = "Settings.config"; PortableSettingsProvider.SettingsDirectory = "Settings\\"; PortableSettingsProvider.ApplyProvider(Properties.Settings.Default); PortableSettingsProvider.ApplyProvider(Properties.Profiles.Default); var res_man = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); if (!OSVersionInfo.Name.Equals("Windows 10") && !OSVersionInfo.Name.Equals("Windows 8.1") && !OSVersionInfo.Name.Equals("Windows 8") && !OSVersionInfo.Name.Equals("Windows 7")) { CheckNetFamework.Get48FromRegistry(); MessageBox.Show(res_man.GetString("ProgramCheckWindows", cul) + " " + OSVersionInfo.Name, res_man.GetString("ProgramCheckWindows2", cul), MessageBoxButtons.OK, MessageBoxIcon.Error); Kill.PanicKillInternal(); return; } else { CheckNetFamework.Get48FromRegistry(); } string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); if (Properties.Settings.Default.ToolVersion == "") { if (Properties.Settings.Default.UpgradeRequired == true) { Properties.Settings.Default.Upgrade(); Properties.Settings.Default.UpgradeRequired = false; } Properties.Settings.Default.ToolVersion = version; Properties.Settings.Default.Save(); } if (version != Properties.Settings.Default.ToolVersion) { Properties.Settings.Default.ToolVersion = version; Properties.Settings.Default.Save(); } if (CheckAdmin.IsUserAdministrator() == true) { Properties.Settings.Default.IsAdmin = true; Properties.Settings.Default.Save(); } else { Properties.Settings.Default.IsAdmin = false; Properties.Settings.Default.Save(); } if (Properties.Settings.Default.LogoWasSaved == true) { Properties.Settings.Default.LogoWasSaved = false; Properties.Settings.Default.Save(); } if (Properties.Settings.Default.LogoBinOpenSave == false) { Properties.Settings.Default.LogoWasSaved = false; Properties.Settings.Default.LogoBinOpen = ""; Properties.Settings.Default.Save(); } string x86path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); string x64path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); if (exePath == x86path || exePath == x64path) { if (CheckAdmin.IsUserAdministrator() == false) { MessageBox.Show(res_man.GetString("ProgramCheckPrivileges", cul), res_man.GetString("ProgramCheckPrivileges2", cul), MessageBoxButtons.OK, MessageBoxIcon.Error); Kill.PanicKillInternal(); return; } } if (!Directory.Exists(exePath + @"\Files\")) { Directory.CreateDirectory(exePath + @"\Files\"); } CreateDirectory(@"LogoZip"); CreateDirectory(@"Images\Logo"); CreateDirectory(@"Images\Icons"); CreateDirectory(@"Bin"); CreateDirectory(@"Bin\4MB"); CreateDirectory(@"Bin\6MB"); CreateDirectory(@"Bin\8MB"); CreateDirectory(@"Bin\16MB"); CreateDirectory(@"Bin\32MB"); if (File.Exists(exePath + @"\Files\*.zip")) { File.Delete(exePath + @"\Files\*.zip"); } if (File.Exists(exePath + @"\*.zip")) { File.Delete(exePath + @"\*.zip"); } }
public static void Initialize(TestContext context) { settingsFile = "portable.config"; PortableSettingsProvider.ApplyProvider(Properties.Settings.Default); Properties.Settings.Default.Reset(); }