public LauncherMainWindow() { InitializeComponent(); var launcherViewModel = new LauncherViewModel(); DataContext = launcherViewModel; }
public void Status_UpdateStatus_RecievedStatusMessage() { var vm = new LauncherViewModel(_launcherModel); Messenger.Default.Send(new StatusMessage("testStatus")); Assert.AreEqual(vm.Status, "testStatus"); }
public void EditProfile_OpenProfileEditingWindow() { var vm = new LauncherViewModel(_launcherModel); vm.EditProfile.Execute(null); _launcherModel.Received().OpenEditProfileWindow(); }
public void NewProfile_OpenProfileCreatingWindow() { var vm = new LauncherViewModel(_launcherModel); vm.NewProfile.Execute(null); _launcherModel.Received().OpenNewProfileWindow(); }
public void Progress_EqualsMessageProgress_RecievedInstallProgressMessage() { var vm = new LauncherViewModel(_launcherModel); Messenger.Default.Send(new InstallProgressMessage(50)); Assert.AreEqual(vm.Progress, 50); }
public void ProgressBarVisibility_Collapsed_ProgressEquals100() { var vm = new LauncherViewModel(_launcherModel); Messenger.Default.Send(new InstallProgressMessage(100)); Assert.AreEqual(vm.ProgresBarVisibility, Visibility.Collapsed); }
public void ProgressBarVisibility_Visible_ProgressLess100() { var vm = new LauncherViewModel(_launcherModel); Messenger.Default.Send(new InstallProgressMessage(50)); Assert.AreEqual(vm.ProgresBarVisibility, Visibility.Visible); }
internal void Initialize(NugetStore store, string defaultLogText = null) { var dispatcherService = new DispatcherService(Dispatcher); var dialogService = new DialogService(dispatcherService, Launcher.ApplicationName); var serviceProvider = new ViewModelServiceProvider(new object[] { dispatcherService, dialogService }); DataContext = new LauncherViewModel(serviceProvider, store); }
public void Start_ExecuteStartGame() { var vm = new LauncherViewModel(_launcherModel); vm.Start.Execute(null); _launcherModel.Received().StartGame(); }
public Launcher() { this.InitializeComponent(); Instance = this; this.ViewModel = new LauncherViewModel(); this.DataContext = this.ViewModel; this.ModsListBox.ItemsSource = this.ViewModel.Mods; }
public void RefreshProfiles_UpdateProfiles_RecievedProfilesChangedMessage() { var vm = new LauncherViewModel(_launcherModel); vm.Profiles.Clear(); Messenger.Default.Send(new ProfilesChangedMessage()); Assert.IsNotEmpty(vm.Profiles); }
public MainForm(bool minimize) { minimized = minimize; InitializeComponent(); launcherModelBindingSource.DataSource = Model = new LauncherViewModel(this); Model.Tunnels.CollectionChanged += RefresnTunnels; Model.PropertyChanged += Model_PropertyChanged; notifyIcon_tray.Icon = Icon; checkBox_autorun.Checked = File.Exists(Utils.GetAutoRunFile(Consts.LegacyLauncherPrefix)); }
public MainWindow() { InitializeComponent(); SetLogo(Properties.Settings.Default.LogoIndex); DataContext = Model = new LauncherViewModel(this); Tabs = new UserControl[] { new TunnelTab(Model), new LogTab(Model), new SettingsTab(Model), new AboutTab() }; Model.SwitchTab(2); }
static void Main(string[] args_) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AppDomain.CurrentDomain.UnhandledException += handleUnhandledException; Logger.SetLog4NetGlobalContextProperty("LogFileName", "Launcher"); Logger.SetLog4NetGlobalContextProperty("LogFileDir", string.Format("{0}\\Launcher", Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData))); Logger.Configure(); Logger.Debug("Logging up and running", typeof(Program)); AssemblyLoader.Init(); var launcherVM = new LauncherViewModel(); var apps = getApps(launcherVM); if (!apps.Any()) { MessageBox.Show( "You do not seem to be permissioned for any applications. Please contact '*****@*****.**' to get permissioned.", "No applications permissioned", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } // launch the launcher itself if no executable given if (args_ == null || args_.Length == 0) { if (!lancherAlreadyRunning()) { var instance = new Launcher(); instance.Create(apps); Application.Run(instance); } else MessageBox.Show("Trading Tools Launcher is already running...."); } else { var appToRun = apps.FirstOrDefault(x => x.AppID.Equals(args_[0])); if (appToRun != null) appToRun.Launch(); } }
public SettingsTab(LauncherViewModel main) { InitializeComponent(); DataContext = Model = main; Model.PropertyChanged += (s, e) => { if (Model.CheckingUpdate && e.PropertyName == nameof(Model.Update)) { Model.CheckingUpdate = false; if (!Model.Update.UpdateAvailable) { App.ShowMessage("您当前使用的启动器与 frpc 均为最新版本", "提示", MessageBoxImage.Information); } } }; }
public bool CanLaunch(LauncherViewModel vm_) { return string.IsNullOrEmpty(permissioningAppId) || vm_.HasViewPermission(permissioningAppId); }
public LogTab(LauncherViewModel main) { InitializeComponent(); DataContext = Model = main; }
public RemoteConfigWindow(LauncherViewModel launcher) { InitializeComponent(); DataContext = Model = launcher; }
public TabIndexTester(LauncherViewModel main) { Model = main; }
public LauncherWindow() { InitializeComponent(); DataContext = new LauncherViewModel(); }
public void Profiles_Loaded_Init() { var vm = new LauncherViewModel(_launcherModel); Assert.AreEqual(vm.Profiles, _profileList); }
public AboutTab(LauncherViewModel model) { InitializeComponent(); DataContext = new AboutModel(model); }
private static ILauncherItem[] getApps(LauncherViewModel launcherVM) { var apps = new ILauncherItem[] { new DashboardApp(), new BSAApp(), new TradeAnalyzerApp(), new SeasonalityApp(), new RollMonitorApp(), new LiveCMT(), new CalendarAnalysisFromTree(), new SeriesCharting(), }; return apps.Where(x => x.CanLaunch(launcherVM)).ToArray(); }
public MainWindowViewModel(INavigationService navigationService) { LauncherViewModel = new LauncherViewModel(navigationService); }