public DScanLocatorControl() { if (_posMapper == null) { _posMapper = new WindowInstanceManager <PosMapperDialog>((MainWindow)Application.Current.MainWindow); } CurrentRangeItems = new ObservableCollection <DScanItemViewModel>(); CurrentShips = new ObservableCollection <IDScanItem>(); InitializeComponent(); //TODO DI und so _dScanFinder = DIContainer.GetInstance <DScanFinder>(); _dScanFinder.InitialItems += InitialItems; _dScanFinder.AddedAnomlies += AddedAnomalies; _dScanFinder.NextScanRequested += NextScanRequested; _dScanFinder.PotentiallyFoundAtDScanItemGroup += TargetPotentiallyFoundAt; _dScanFinder.Fail += ScanFailed; _dScanFinder.Success += ScanSuccess; _dScanFinder.LowerVerificationScanRequested += LowerVerification; _dScanFinder.UpperVerificationScanRequested += UpperVerification; _dScanFinder.IsActiveChanged += DScanFinderOnIsActiveChanged; _types = DIContainer.GetInstance <IEveTypes>(); Initialize(); }
void DeleteProfileButton_Click(object sender, RoutedEventArgs e) { Common.Window.SetCurrentView(NavigationButtons.Window_Selection); WindowInstanceManager.SaveProfileContainer.Profiles.Remove(WinAPI.GetWindowClassName(WindowInstanceManager.SelectedWindowInstance.InstanceProcess.MainWindowHandle)); WindowInstanceManager.SelectedWindowInstance.ListItem.HasProfileImage.Visibility = Visibility.Hidden; WindowInstanceManager.SaveProfiles(); }
protected override void OnExit(ExitEventArgs e) { WindowInstanceManager.StopUpdater(); Common.NotificationIcon.Dispose(); #if !DEBUG //Steam.Shutdown(); #endif KeyboardListener.Unhook(); //new SoundPlayer("C:\\Windows\\Media\\Speech Sleep.wav").PlaySync(); base.OnExit(e); }
static void Main() { new SplashScreen("splash.png").Show(true); FileIO.ValidateFileSystem(); Logger.LogInfo("Initializing BordeX"); Common.TaskbarInstance = new Taskbar(); Common.ProgramInstance = new Program(); Common.ProgramInstance.ShutdownMode = ShutdownMode.OnExplicitShutdown; Common.Window = new BaseWindow(); Common.NotificationIcon = new NotifyIcon(); Common.NotificationIcon.Icon = BordeX.Properties.Resources.logo; Common.NotificationIcon.Text = References.Name; Common.NotificationIcon.BalloonTipText = References.Name; Common.NotificationIcon.ContextMenu = new System.Windows.Forms.ContextMenu(); Common.NotificationIcon.Click += ((object sender, EventArgs arg) => { OpenWindow(); }); Common.NotificationIcon.ContextMenu.MenuItems.Add("Open/Show Window", (object sender, EventArgs e) => { OpenWindow(); }); Common.NotificationIcon.ContextMenu.MenuItems.Add("Close Window", (object sender, EventArgs e) => { CloseWindow(); }); Common.NotificationIcon.ContextMenu.MenuItems.Add("-"); Common.NotificationIcon.ContextMenu.MenuItems.Add("Shutdown Application", (object sender, EventArgs e) => { CloseWindow(true); }); Common.NotificationIcon.Visible = true; if (!WMI.IsWindows10) { // Need to figure out a way to keep this messagebox open without RUN Logger.LogError("You're current Operating System is not supported by BordeX or something is blocking access to Operating System information!\n\nPlease upgrade to either Windows 10 (Recommended), Windows 8.1 or Windows 7.", true); return; } WindowInstanceManager.BeginUpdater(); SettingsHandler.LoadSettings(); WindowInstanceManager.SaveProfileContainer = FileIO.LoadProfiles <WindowInstanceSaveProfilesContainer>(); #if !DEBUG //Steam.Initialize(Process.GetCurrentProcess().Id); #endif OpenWindow(); if (BaseWindow.Settings.Start_Sound_Enabled) { new SoundPlayer("C:\\Windows\\Media\\Windows Unlock.wav").Play(); } KeyboardListener.Hook(); Common.ProgramInstance.Run(Common.Window); }
private void App_OnStartup(object sender, StartupEventArgs e) { System.Net.WebRequest.DefaultWebProxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; IGeneralSettings generalSettings = null; IExplicitConnectionCache explicitConnectionCache = null; IInitialLayoutStructureProvider initialLayoutStructureProvider = null; string rawData; if (new Persistance().TryLoadRaw(out rawData)) { try { var settingsContainer = Serializer.Objectify(rawData); generalSettings = settingsContainer.GeneralSettings; explicitConnectionCache = settingsContainer.ExplicitConnectionCache; initialLayoutStructureProvider = new InitialLayoutStructureProvider(settingsContainer.LayoutStructure); } catch (Exception exc) { //TODO summit System.Diagnostics.Debug.WriteLine(exc.Message); } } generalSettings = generalSettings ?? new GeneralSettings(10); explicitConnectionCache = explicitConnectionCache ?? new ExplicitConnectionCache(); initialLayoutStructureProvider = initialLayoutStructureProvider ?? new InitialLayoutStructureProvider(); var container = new Container(_ => { _.ForSingletonOf <DispatcherScheduler>().Use(DispatcherScheduler.Current); _.ForSingletonOf <DispatcherTaskSchedulerProvider>().Use(DispatcherTaskSchedulerProvider.Create(Dispatcher)); _.ForSingletonOf <IGeneralSettings>().Use(generalSettings); _.ForSingletonOf <IExplicitConnectionCache>().Use(explicitConnectionCache); _.ForSingletonOf <IImplicitConnectionCache>(); _.ForSingletonOf <LocalEmulatorDetector>(); _.ForSingletonOf <IInitialLayoutStructureProvider>().Use(initialLayoutStructureProvider); _.ForSingletonOf <ISnackbarMessageQueue>().Use(new SnackbarMessageQueue(TimeSpan.FromSeconds(5))); _.ForSingletonOf <FeatureRegistry>() .Use( ctx => FeatureRegistry .WithDefault(ctx.GetInstance <QueryDeveloperFeatureFactory>()) .Add(ctx.GetInstance <ManagementFeatureFactory>())); _.AddRegistry <DoobryRegistry>(); _.Scan(scanner => { scanner.TheCallingAssembly(); scanner.WithDefaultConventions(); }); }); var windowInstanceManager = new WindowInstanceManager(container.GetInstance <MainWindowViewModel>); //grease the Dragablz wheels var featureRegistry = container.GetInstance <FeatureRegistry>(); NewItemFactory = () => { var contentLifetimeHost = featureRegistry.Default.CreateTabContent(); var tabContentContainer = new TabItemContainer(Guid.NewGuid(), featureRegistry.Default.FeatureId, contentLifetimeHost, featureRegistry.Default); return(tabContentContainer); }; InterTabClient = new InterTabClient(windowInstanceManager); ClosingItemCallback = OnItemClosingHandler; var localEmulatorSubscription = UseLocalEmulatorDetector(container); Exit += (o, args) => localEmulatorSubscription.Dispose(); ShutdownMode = ShutdownMode.OnExplicitShutdown; var mainWindow = windowInstanceManager.Create(); mainWindow.Show(); Task.Factory.StartNew(() => CheckForUpdates(container.GetInstance <ISnackbarMessageQueue>())); }