private void btnChoose_Click(object sender, EventArgs e) { FolderBrowserDialog op = new FolderBrowserDialog(); if (op.ShowDialog() == DialogResult.OK) { txtpath.Text = op.SelectedPath; AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Enum_BackupPath.ToString(), txtpath.Text); AppInit.SoftwareSettings.IntiSetting(); } }
public App() { #if DEBUG HotReloader.Current.Run(this, new HotReloader.Configuration { ExtensionIpAddress = System.Net.IPAddress.Parse("192.168.1.36") }); #endif InitializeComponent(); AppInit.EntryPointAfter(); }
private void Awake() { Instance = this; //这个lua在做一次 Application.targetFrameRate = _FPS; //修改texture,保证图片分辨率,是full res,高清显示 >=QualityLevel.Fast string[] names = QualitySettings.names; if (names != null && names.Length > 1) { QualitySettings.SetQualityLevel(1); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseIISPlatformHandler(); app.UseStaticFiles(); app.UseMvc(); AppInit.Initialize(); }
static void Main() { System.Reflection.Assembly assembly = System.Reflection.Assembly.GetEntryAssembly(); Globals.Initialize(assembly.Location, ""); WindowsServiceInitOptions o = new WindowsServiceInitOptions(); o.ServiceManagerButtons_UpdateSettingsFile = false; o.ServiceManagerButtons = new ButtonDefinition[] { new ButtonDefinition("Configure", btnConfigure_Click) }; AppInit.WindowsService <DKPHistory>(o); }
private void MainForm_Shown(object sender, EventArgs e) { SetTitle("(Checking)"); Task.Factory.StartNew(GetGeneral); TrackingQueue.Enqueue("startup"); Settings_Loaded(this, new EventArgs()); UpdateIcon(); //Add this after otherwise it will save immediately due to RegionList.SelectedIndex Settings.PropertyChanged += Settings_PropertyChanged; //Start after the form is shown otherwise Invokes will fail Connection.Start(); Injector.Start(); launcher.Start(); //Fixes the team controls size on start as they keep getting messed up in the WYSIWYG MainForm_Resize(this, new EventArgs()); try { var filename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lolbans", "LoLLoader.dll"); if (File.Exists(filename)) { StaticLogger.Info("Uninstalling old loader"); var shortfilename = AppInit.GetShortPath(filename); var dlls = AppInit.AppInitDlls32; if (dlls.Contains(shortfilename)) { dlls.Remove(AppInit.GetShortPath(shortfilename)); AppInit.AppInitDlls32 = dlls; } if (File.Exists(filename)) { File.Delete(filename); } } } catch (SecurityException se) { StaticLogger.Warning(se); } catch (Exception ex) { StaticLogger.Error("Failed to uninstall " + ex); } }
[WebMethod] // 取得所有模板数据.LabelId, LabelName, LabelContent, IsDefault public int fun7(int _class, out DataTable _table) { AppInit.Init(); BarcodePrintRepository repository = new BarcodePrintRepository(); if (_class == 0) { _table = repository.GetLabelStyleByPrintTools("Z"); } else { _table = repository.GetLabelStyleByPrintTools("C"); } return(1); }
public int fun5(int _class, out string _labelStyle) { AppInit.Init(); BarcodePrintRepository repository = new BarcodePrintRepository(); if (_class == 0) { _labelStyle = repository.GetLabelStyleByType("Z"); } else { _labelStyle = repository.GetLabelStyleByType("C"); } return(1); }
private void FrmBackup_Load(object sender, EventArgs e) { if (isPormteMode) { pnlAskPromte.Visible = true; pnlPathOption.Visible = false; lblPromptMsg.Text = "Want to generate backup now ? \nAt the location " + AppInit.AppInfo.BackupPath + ""; } else { pnlAskPromte.Visible = false; pnlPathOption.Visible = true; txtpath.Text = AppInit.AppInfo.BackupPath; chkAskMe.Checked = AppInit.GetCheckBoxOrRaddioApplicationSettings(AppInit.SoftwareSettings.SoftwareSettingCode.Enum_AskBackupWhenCloseSoftware.ToString()); } }
void InitApplication(AppInit obj) { _uiBus.Publish(obj); UpdateProfile(profile => { profile.InitIfNeeded(); _currentSystem = profile.GetCurrentSystemId(); }); UpdateDomain(system => system.InitIfNeeded(_currentSystem)); // Publish the event that "ProfileLoaded" which // ClientModelController is one of the subsribers to. _queue.Enqueue(new ProfileLoaded(_currentSystem)); }
protected override void OnStop() { try { AppInit.Shutdown(this); Log.Information("BitShelter Service stopping"); } catch (Exception ex) { Log.Error(ex, "Failed to stop scheduling service"); // TODO: Handle error throw ex; } }
public int fun4(string _storeSiteExpression, out DataTable _table) { AppInit.Init(); string sql = string.Format(@"select StoreSite.storeSiteNo storeSiteNo, StoreSite.storeSiteName storeSiteName, T.storeSiteName parentStoreSiteName, D.departmentName companyName from StoreSite left join AppUser U1 on StoreSite.createId=U1.userId left join AppUser U2 on StoreSite.updateId=U2.userId left join StoreSite T on StoreSite.parentId=T.storeSiteId left join AppDepartment D on StoreSite.companyId=D.departmentId where 1=1 {0}", _storeSiteExpression); _table = AppMember.DbHelper.GetDataSet(sql).Tables[0]; return(1); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); AppInit.Init(); AppLog.DeleteLog(); Thread thread = new Thread(new ThreadStart(AutoDepreciationTask)); thread.Start(); Thread thread2 = new Thread(new ThreadStart(AutoDBBackUpTask)); thread2.Start(); Thread thread3 = new Thread(new ThreadStart(AutoMonthUpdateTask)); thread3.Start(); }
// Use this for initialization void Awake() { AppInit.Create(); AppInit.Instance.OnLoadResouce += new Func <bool>(() => { resourceManager.Init(); resourceGroupManager.OnInit(resourceManager); return(true); }); AppInit.Instance.OnLoadDevice += new Func <bool>(() => { viewManager.InitView(); return(true); }); AppInit.Instance.Init(); }
public MainWindow() { InitializeComponent(); BrowserControl.LinkClicked += HtmlPanel_LinkClicked; _notifier = new Notifier(cfg => { //place the notifications approximately inside the main editing area //(not over the toolbar area) on the top-right hand side cfg.PositionProvider = new WindowPositionProvider( parentWindow: Application.Current.MainWindow, corner: Corner.TopRight, offsetX: 15, offsetY: 90); cfg.LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor( notificationLifetime: TimeSpan.FromSeconds(5), maximumNotificationCount: MaximumNotificationCount.FromCount(5)); cfg.Dispatcher = Application.Current.Dispatcher; }); _urlsByHash = new Dictionary <string, string>(); _bookmarkManager = new BookmarkManager(this, BrowserControl); AppInit.UpgradeSettings(); AppInit.CopyAssets(); _bookmarkManager.RefreshBookmarkMenu(); var launchUri = _settings.HomeUrl; string[] args = App.Args; if (args != null) { launchUri = App.Args[0]; } Navigate(launchUri); BuildThemeMenu(); TickSelectedThemeMenu(); }
protected override void OnStart(string[] args) { #if DEBUG DebugMode(); #endif try { AppInit.Initialize(this); Log.Information("BitShelter Service started"); } catch (Exception ex) { Log.Error(ex, "Failed to start scheduling service"); // TODO: Handle error throw ex; } }
private void btnSave_Click(object sender, EventArgs e) { AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_invoiceTaxonTotalLevel.ToString(), chkInvoiceTaxOnTotalLevel.Checked ? "1" : "0"); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_invoiceItemHelp.ToString(), chkItemHelp.Checked ? "1" : "0"); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_EnableShippingDetail.ToString(), chkShippingDetails.Checked ? "1" : "0"); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_EnablePrintChallan.ToString(), chkPrintChallanEnable.Checked ? "1" : "0"); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_Enable_bf_freight.ToString(), chk_bf_freight.Checked ? "1" : "0"); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_Enable_bf_additional.ToString(), chk_bf_additional.Checked ? "1" : "0"); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_Enable_bf_discount.ToString(), chk_bf_discount.Checked ? "1" : "0"); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_invoiceformate.ToString(), txtInvoiceFormat.Text); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_challanformat.ToString(), txtChallanFormat.Text); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_DefaultCopyTag.ToString(), cmbCopy.Text); AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Inv_EnableOth1Add.ToString(), chlOtherAddField.Checked ? "1" : "0"); AppInit.SoftwareSettings.IntiSetting(); for (int i = 0; i < gvBook.Rows.Count; i++) { int lbookid = Convert.ToInt32(gvBook.Rows[i].Cells["BookId"].Value); var objitm = dbx.BookMsts.Where(u => u.BookId == lbookid).First(); if (objitm != null) { objitm.BookTitle = gvBook.Rows[i].Cells["BookTitle"].Value.ToString(); objitm.InvNo = Convert.ToInt32(gvBook.Rows[i].Cells["InvNo"].Value); objitm.IsActive = Convert.ToBoolean(gvBook.Rows[i].Cells["IsActive"].Value); objitm.IsDefault = Convert.ToBoolean(gvBook.Rows[i].Cells["IsDefault"].Value); objitm.Prefix = Convert.ToString(gvBook.Rows[i].Cells["Prefix"].Value); dbx.SaveChanges(); } } MessageBox.Show("Software Setting updated.."); }
private void chkAskMe_CheckedChanged(object sender, EventArgs e) { AppInit.UpdateSoftwareSetting(AppInit.SoftwareSettings.SoftwareSettingCode.Enum_AskBackupWhenCloseSoftware.ToString(), chkAskMe.Checked ? "1" : "0"); AppInit.SoftwareSettings.IntiSetting(); }
// This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); return(AppInit.InitAutofac(services)); }
public AutoTask() { AppInit.Init(); }
public void GivenCalculatorAppIsInitialized() { AppInit.StartApp(); calc = new CalcView(); }
private void MainForm_Shown(object sender, EventArgs e) { TrackingQueue.Enqueue("startup"); Settings_Loaded(this, new EventArgs()); UpdateStatus(); //Add this after otherwise it will save immediately due to RegionList.SelectedIndex Settings.PropertyChanged += Settings_PropertyChanged; Settings.ModuleResolver = "Toolhelp32Snapshot"; VersionLabel.Text = "v" + Version; //Start after the form is shown otherwise Invokes will fail Connection.Start(); Injector.Start(); launcher.Start(); //Fixes the team controls size on start as they keep getting messed up in the WYSIWYG MainForm_Resize(this, new EventArgs()); try { RegistryKey installed_versions = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP"); string[] version_names = installed_versions.GetSubKeyNames(); //version names start with 'v', eg, 'v3.5' which needs to be trimmed off before conversion double framework = Convert.ToDouble(version_names[version_names.Length - 1].Remove(0, 1), CultureInfo.InvariantCulture); if (framework < 4.0) { if (MessageBox.Show("The Elophant Client requires the .NET Framework 4.0 Full version. Would you like to download it?", ".NET Framework 4.0 Full Not Found", MessageBoxButtons.YesNo) == DialogResult.Yes) { Process.Start("http://www.microsoft.com/en-us/download/details.aspx?id=17718"); } MessageBox.Show("The Elophant Client will now close."); Process.GetCurrentProcess().Kill(); return; } } catch (Exception ex) { StaticLogger.Error(ex.ToString()); MessageBox.Show("An unknown exception has occurred. Check the log for more information."); Process.GetCurrentProcess().Kill(); return; } try { var filename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lolbans", "LoLLoader.dll"); if (File.Exists(filename)) { StaticLogger.Info("Uninstalling old loader."); var shortfilename = AppInit.GetShortPath(filename); var dlls = AppInit.AppInitDlls32; if (dlls.Contains(shortfilename)) { dlls.Remove(AppInit.GetShortPath(shortfilename)); AppInit.AppInitDlls32 = dlls; } if (File.Exists(filename)) { File.Delete(filename); } } } catch (SecurityException se) { StaticLogger.Warning(se); } catch (Exception ex) { StaticLogger.Error("Failed to uninstall. Message: " + ex); } // NOT SURE IF THIS WORKS - TRYING TO AVOID THE USE OF AN INSTALL BUTTON try { if (!Installer.IsInstalled) { if (!Wow.IsAdministrator) { MessageBox.Show("Please run the Elophant Client as the Administrator to install it."); Process.GetCurrentProcess().Kill(); return; } try { Installer.Install(); } catch (UnauthorizedAccessException uaex) { MessageBox.Show("Unable to fully install/uninstall. Make sure LoL is not running."); StaticLogger.Warning(uaex); } //InstallButton.Text = Installer.IsInstalled ? "Uninstall" : "Install"; UpdateStatus(); } } catch { } TryToCheckForUpdates(); }