public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _memoryReaderManager = new FFXIVMemoryManager(container); _container.Register <IMemoryReaderManager>((c, p) => _memoryReaderManager); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _configManager = _container.Resolve <IConfigManager>(); _memoryManager = _container.Resolve <IMemoryReaderManager>(); var actorManager = _container.Resolve <IActorManager>(); var resourceBundle = _container.Resolve <ILocaleManager>().GetResourceBundle("autotranslate"); var autotranslateProvider = new AutotranslateProvider(resourceBundle); _chatManager = new ChatManager(autotranslateProvider, actorManager); _configManager.AddPropertyChangeListener("behaviour.chat.updateInterval", true, true, ConfigManager_UpdateChatInterval); _configManager.AddPropertyChangeListener("behaviour.channel", true, true, ConfigManager_UpdateChannelProperties); _configManager.AddPropertyChangeListener("behaviour.segment", true, true, ConfigManager_UpdateFormaterProperties); _configManager.AddPropertyChangeListener("behaviour.groups", true, true, ConfigManager_UpdateTriggerGroupProperties); _configManager.AddPropertyChangeListener("behaviour.mentions", true, true, ConfigManager_UpdateMentions); _configManager.AddPropertyChangeListener("behaviour.chat.autodetectEmoteInSay", true, true, ConfigManager_UpdateAutodetectProperties); _configManager.AddPropertyChangeListener("behaviour.language", true, true, ConfigManager_UpdateLanguage); _configManager.AddPropertyChangeListener("behaviour.rangefilter", true, true, ConfigManager_UpdateRangeFilter); _configManager.AddPropertyChangeListener("behaviour.mentions.userCanTriggerMention", true, true, ConfigManager_UpdateUserMentionProperties); _configManager.AddPropertyChangeListener("behaviour.chattabs.data", true, true, ConfigManager_UpdateVisibleChannel); _configManager.AddPropertyChangeListener("behaviour.chattabs.data", true, true, ConfigManager_UpdateUpdateRangeFilterActive); _container.Register <IChatManager>((c, p) => _chatManager); _updater = new IndependendBackgroundWorker(); _updater.Start(UpdateJob); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _browserAPIManager = _container.Resolve <IBrowserAPIManager>(); _memoryManager = _container.Resolve <IMemoryReaderManager>(); _browserAPIManager.MemoryHandler = new BrowserMemoryHandler(this); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); var memoryReader = _container.Resolve <IMemoryReaderManager>(); memoryReader.OnConnectionStateChanged += MemoryReader_OnConnectionState; OnConnection(memoryReader.ConnectionState); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _manager = container.Resolve <IUIManager>(); _configManager = container.Resolve <IConfigManager>(); var synchronizer = _manager.UISynchronizer; synchronizer.RunSync(() => InitializeUI()); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _memoryManager = _container.Resolve <IMemoryReaderManager>(); _configManager = _container.Resolve <IConfigManager>(); _configManager.AddPropertyChangeListener("behaviour.hideOnMinimize", true, true, ConfigManager_UpdateHideOnMinimize); _memoryManager.OnWindowFocusChanged += MemoryReader_OnWindowFocusChanged; }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { if (handler == null) { throw new System.ArgumentNullException(nameof(handler)); } DeleteOldPatchData(); var configManager = container.Resolve <IConfigManager>(); var doUpdate = configManager.GetProperty <bool>("behaviour.appUpdate.checkOnline"); if (!doUpdate) { return; } var allowBetaUpdates = configManager.GetProperty <bool>("behaviour.appUpdate.acceptBeta"); var update = GetUpdate(GobchatContext.ApplicationVersion, allowBetaUpdates); if (update == null) { return; } var userRequest = AskUser(update); if (userRequest == UpdateFormDialog.UpdateType.Skip) { return; } if (userRequest == UpdateFormDialog.UpdateType.Auto) { var needRestart = PerformAutoUpdate(container, update); if (needRestart) { handler.StopStartup = true; } } if (userRequest == UpdateFormDialog.UpdateType.Manual) { var dialogText = StringFormat.Format(Resources.Module_Updater_Dialog_ManualInstall_Text, update.Version); var dialogResult = System.Windows.Forms.MessageBox.Show(dialogText, Resources.Module_Updater_Dialog_ManualInstall_Title, System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Information); //TODO improve - a lot if (System.Windows.Forms.DialogResult.Yes == dialogResult) { System.Diagnostics.Process downloadProcess = System.Diagnostics.Process.Start(update.PageUrl); handler.StopStartup = true; } } }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); var uiManager = _container.Resolve <IUIManager>(); var overlay = uiManager.GetUIElement <CefOverlayForm>(AppModuleChatOverlay.OverlayUIId); _browserAPIManager = new BrowserAPIManager(overlay, uiManager.UISynchronizer); _container.Register <IBrowserAPIManager>((c, p) => _browserAPIManager); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _chatManager = _container.Resolve <IChatManager>(); _memoryReader = _container.Resolve <IMemoryReaderManager>(); _reportError = true; //report error on startup _memoryReader.OnConnectionStateChanged += MemoryReader_OnConnectionState; Report(_memoryReader.ConnectionState); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); var synchronizer = _container.Resolve <IUISynchronizer>(); var hotkeyRegister = new OSLevelHotkeyRegister(synchronizer); _hotkeyManager = new HotkeyManager(hotkeyRegister); _container.Register <IHotkeyManager>((c, _) => _hotkeyManager); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _chatManager = _container.Resolve <IChatManager>(); _browserAPIManager = _container.Resolve <IBrowserAPIManager>(); _browserAPIManager.ChatHandler = new GobchatBrowserChatAPI(_chatManager); _browserAPIManager.OnUIReadyChanged += BrowserAPIManager_OnUIReadyChanged; _chatManager.OnChatMessage += ChatManager_ChatMessageEvent; }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _browserAPIManager = _container.Resolve <IBrowserAPIManager>(); _configManager = _container.Resolve <IConfigManager>(); _chatManager = _container.Resolve <IChatManager>(); _browserAPIManager.ConfigHandler = new BrowserConfigHandler(this); _configManager.OnProfileChange += ConfigManager_SynchronizeJSConfig; _configManager.AddPropertyChangeListener("*", ConfigManager_SynchronizeJSConfig); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { #if DEBUG var cefFolder = GobchatContext.ApplicationLocation; #else var cefFolder = System.IO.Path.Combine(GobchatContext.ApplicationLocation, "libs", "cef"); #endif System.IO.Directory.CreateDirectory(cefFolder); CEFManager.CefAssemblyLocation = cefFolder; _synchronizer = container.Resolve <IUISynchronizer>(); _synchronizer.RunSync(() => global::Gobchat.UI.Web.CEFManager.Initialize()); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _configManager = _container.Resolve <IConfigManager>(); _browserAPIManager = _container.Resolve <IBrowserAPIManager>(); var uiManager = _container.Resolve <IUIManager>(); _cefOverlay = uiManager.GetUIElement <CefOverlayForm>(AppModuleChatOverlay.OverlayUIId); _cefOverlay.Browser.OnBrowserLoadPage += Browser_BrowserLoadPage; _cefOverlay.Browser.OnBrowserLoadPageDone += Browser_BrowserLoadPageDone; _cefOverlay.Browser.OnBrowserInitialized += Browser_BrowserInitialized; }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _configManager = _container.Resolve <IConfigManager>(); _memoryManager = _container.Resolve <IMemoryReaderManager>(); _actorManager = new ActorManager(); _updater = new IndependendBackgroundWorker(); _configManager.AddPropertyChangeListener("behaviour.actor.updateInterval", true, true, ConfigManager_UpdateChatInterval); _configManager.AddPropertyChangeListener("behaviour.actor.active", true, true, ConfigManager_UpdateRangeFilter); _container.Register <IActorManager>((c, p) => _actorManager); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _chatLogger = new CustomChatLogger(); //_chatLogger.LogChannels = Enum.GetValues(typeof(ChatChannel)).Cast<ChatChannel>(); //will log everything that comes from the chat manager _configManager = _container.Resolve <IConfigManager>(); _configManager.AddPropertyChangeListener("behaviour.chatlog.active", true, true, ConfigManager_UpdateWriteLog); _configManager.AddPropertyChangeListener("behaviour.chatlog.path", true, true, ConfigManager_UpdateLogPath); _configManager.AddPropertyChangeListener("behaviour.chatlog.format", true, true, ConfigManager_UpdateLogFormat); _configManager.AddPropertyChangeListener("behaviour.channel.log", true, true, ConfigManager_UpdateLogChannels); _chatManager = _container.Resolve <IChatManager>(); _chatManager.OnChatMessage += ChatManager_ChatMessageEvent; }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _manager = container.Resolve <IUIManager>(); _manager.CreateUIElement(NotifyIconManagerId, () => { var notifyIconManager = new NotifyIconManager(new[] { "app", "debug", "close" }, "app") { Text = "Gobchat", Icon = Gobchat.Resources.GobIcon, Visible = true }; var closeMenu = new ToolStripMenuItem(Resources.Module_NotifyIcon_UI_Close); closeMenu.Click += OnEvent_MenuItem_Close; notifyIconManager.AddMenuToGroup("close", "close", closeMenu); return(notifyIconManager); }); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { try { if (AnyRedistributableLibraryLoadable()) { return; } var registrySearcher = new RedistributableRegistryChecker(); if (registrySearcher.HasRedistributables()) { return; } } catch (Exception ex) { logger.Warn(ex, "Check on redistributables failed"); } logger.Error("Chance that 2015+ redistributables are not installed"); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { var uiManager = container.Resolve <IUIManager>(); //TODO: hotkey management is still dumb _hkShowHide = new ConfigHotkeyUpdater( "behaviour.hotkeys.showhide", Resources.Module_Misc_Hotkey_ShowHide, container.Resolve <IConfigManager>(), "behaviour.hotkeys.showhide", container.Resolve <IHotkeyManager>(), container.Resolve <IChatManager>()); _hkShowHide.OnHotkey += () => { if (uiManager.TryGetUIElement <CefOverlayForm>(AppModuleChatOverlay.OverlayUIId, out var overlay)) { uiManager.UISynchronizer.RunSync(() => { overlay.Visible = !overlay.Visible; }); } }; }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _configManager = _container.Resolve <IConfigManager>(); _localeManager = new LocaleManager(); _configManager.AddPropertyChangeListener("behaviour.language", true, true, ConfigManager_UpdateLanguage); //update ui thread _localeManager.OnLocaleChange += (s, e) => { _container.Resolve <IUISynchronizer>().RunSync(() => { CultureInfo.DefaultThreadCurrentCulture = e.Locale; CultureInfo.DefaultThreadCurrentUICulture = e.Locale; Thread.CurrentThread.CurrentCulture = e.Locale; Thread.CurrentThread.CurrentUICulture = e.Locale; Resources.Culture = e.Locale; WebUIResources.Culture = e.Locale; }); }; _container.Register <ILocaleManager>((c, p) => _localeManager); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { _container = container ?? throw new ArgumentNullException(nameof(container)); _browserAPIManager = _container.Resolve <IBrowserAPIManager>(); _browserAPIManager.ActorHandler = new ActorHandler(container); }
public void Initialize(ApplicationStartupHandler handler, IDIContext container) { var uiSynchronizer = container.Resolve <IUISynchronizer>(); ProgressDisplayForm progressDisplay = null; var cefFolder = Path.Combine(GobchatContext.ApplicationLocation, "libs", "cef"); var patcherFolder = Path.Combine(GobchatContext.ApplicationLocation, "patch"); var installer = new CefInstaller(cefFolder, patcherFolder); if (installer.IsCefAvailable()) { return; } //TODO message dialog { logger.Info("CEF missing"); var dialogResult = MessageBox.Show( Resources.Module_Cef_Dialog_CefMissing_Text, "Gobchat", MessageBoxButtons.YesNo, MessageBoxIcon.Warning ); if (dialogResult != DialogResult.Yes) { handler.StopStartup = true; return; } } try { uiSynchronizer.RunSync(() => { progressDisplay = new ProgressDisplayForm(); progressDisplay.Show(); }); using (var progressMonitor = new ProgressMonitorAdapter(progressDisplay)) { try { installer.DownloadCef(progressMonitor); } catch (Exception e) { logger.Log(LogLevel.Fatal, e, () => "CEF download failed"); throw; } try { installer.ExtractCef(progressMonitor); } catch (Exception e) { logger.Log(LogLevel.Fatal, e, () => "CEF extraction failed"); throw; } } } catch (Exception e) { logger.Fatal("CEF installation failed"); logger.Fatal(e); MessageBox.Show( StringFormat.Format(Resources.Module_Cef_Dialog_InstallFailed_Text, e.Message), Resources.Module_Cef_Dialog_InstallFailed_Title, MessageBoxButtons.OK, MessageBoxIcon.Error ); handler.StopStartup = true; } finally { uiSynchronizer.RunSync(() => progressDisplay.Dispose()); } }
public static void RegisterIApplications() { ApplicationStartupHandler.RegisterHandlers(); }
// Initialize only on the first request public void InitializeApplication(HttpApplication HttpApp) { if (s_InitializedAlready) { return; } lock (s_lock) { if (s_InitializedAlready) { return; } // Perform first-request initialization here ... try { LogHelper.Info <requestModule>(string.Format("Application started at {0}", DateTime.Now)); if (UmbracoSettings.AutoCleanLogs) { AddTask(LOG_SCRUBBER_TASK_NAME, GetLogScrubbingInterval()); } } catch { } // Trigger startup handlers ApplicationStartupHandler.RegisterHandlers(); // Check for configured key, checking for currentversion to ensure that a request with // no httpcontext don't set the whole app in configure mode if (UmbracoVersion.Current != null && !GlobalSettings.Configured) { HttpApp.Application["umbracoNeedConfiguration"] = true; } /* This section is needed on start-up because timer objects * might initialize before these are initialized without a traditional * request, and therefore lacks information on application paths */ /* Initialize SECTION END */ // add current default url HttpApp.Application["umbracoUrl"] = string.Format("{0}:{1}{2}", HttpApp.Context.Request.ServerVariables["SERVER_NAME"], HttpApp.Context.Request.ServerVariables["SERVER_PORT"], IOHelper.ResolveUrl(SystemDirectories.Umbraco)); // Start ping / keepalive timer pingTimer = new Timer(new TimerCallback(keepAliveService.PingUmbraco), HttpApp.Context, 60000, 300000); // Start publishingservice publishingTimer = new Timer(new TimerCallback(publishingService.CheckPublishing), HttpApp.Context, 30000, 60000); //Find Applications and event handlers and hook-up the events //BusinessLogic.Application.RegisterIApplications(); //define the base settings for the dependency loader to use the global path settings //if (!CompositeDependencyHandler.HandlerFileName.StartsWith(GlobalSettings_Path)) // CompositeDependencyHandler.HandlerFileName = GlobalSettings_Path + "/" + CompositeDependencyHandler.HandlerFileName; // Backwards compatibility - set the path and URL type for ClientDependency 1.5.1 [LK] ClientDependency.Core.CompositeFiles.Providers.XmlFileMapper.FileMapVirtualFolder = "~/App_Data/TEMP/ClientDependency"; ClientDependency.Core.CompositeFiles.Providers.BaseCompositeFileProcessingProvider.UrlTypeDefault = ClientDependency.Core.CompositeFiles.Providers.CompositeUrlType.Base64QueryStrings; // init done... s_InitializedAlready = true; } }