/// <summary> /// Method used to dispose the controls used in ApplicationMenu.xaml. /// </summary> /// <param name="e">Specifies the cancel event.</param> protected override void OnClosing(CancelEventArgs e) { // Release all managed resources if (this.Resources != null) { this.Resources.Clear(); } if (this.mainRibbon != null) { this.mainRibbon.Dispose(); this.mainRibbon = null; } if (this.ribbonStatusBar != null) { this.ribbonStatusBar = null; } if (this._applicationMenu != null) { this._applicationMenu.Dispose(); this._applicationMenu = null; } if (this.editor != null) { this.editor = null; } GettingStartedViewModel.Dispose(); base.OnClosing(e); }
public ViewResult GettingStarted(string filePath) { GettingStartedViewModel model = ViewModelFactory.CreateGettingStartedViewModel(this.PathHelper, this.TableOfContentsRepository, this.HelpContentRepository, this.ControlRepository, this.SampleRepository, filePath, MemoryCache.Default); return(View("GettingStarted", model)); }
public string GettingStartedLocalInstall(string filePath) { GettingStartedViewModel model = ViewModelFactory.CreateGettingStartedViewModel(this.PathHelper, this.TableOfContentsRepository, this.HelpContentRepository, this.ControlRepository, this.SampleRepository, filePath, MemoryCache.Default); return(ViewRenderer.RenderView("~/Views/Shared/GettingStarted.cshtml", model, ControllerContext)); }
/// <summary> /// Adds the finished analysis back into the UI /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AnalysisRunningViewModel_AnalysisComplete(object sender, AnalysisStatusArgs e) { var path = e.Configuration.AnalysisPath; var name = Path.GetFileName(e.Configuration.AnalysisName); var recent = new RecentAnalysis(path, name); StateModerator.CurrentViewState = ViewState.AnalysisView; StateModerator.CurrentAnalysisState = AnalysisState.Viewing; GettingStartedViewModel.AddAnalysis(recent); DisplayAnalysis(e.Configuration.Analysis); }
protected override void Dispose(bool disposing) { // Release all managed resources if (this.Resources != null) { this.Resources.Clear(); } if (this.mainRibbon != null) { this.mainRibbon.Dispose(); this.mainRibbon = null; } if (this.editor != null) { this.editor = null; } GettingStartedViewModel.Dispose(); base.Dispose(disposing); }
public void GettingStartedLocalInstallMobile(string outDir, string filePath) { GettingStartedViewModel model = ViewModelFactory.CreateGettingStartedViewModel(this.PathHelper, this.TableOfContentsRepository, this.HelpContentRepository, this.ControlRepository, this.SampleRepository, filePath, MemoryCache.Default); string sample = ViewRenderer.RenderView("~/Views/Shared/GettingStarted.cshtml", model, ControllerContext); string gettingStartedMobile = sample.Replace("href=\"~/", rootHref).Replace(rootHref, "href=\"./").Replace(rootSrc, "src=\"./").Replace("src=\"./../igniteui/", "src=\"./igniteui/"); string gettingStartedMobileFileName = Path.Combine(outDir, "getting-started-mobile.html"); List <string> iframeSrcs = new List <string>(); foreach (Sample s in model.GettingStartedContent.Samples) { this.CreateMobileSamplePage(outDir, s.Control.PathID, s.PathID); iframeSrcs.Add(s.Control.PathID + "/" + s.PathID); } gettingStartedMobile = parser.AddFileExtentionToIFrames(gettingStartedMobile, iframeSrcs); parser.ChangeNavLinks(gettingStartedMobile, gettingStartedMobileFileName); }
public MainViewModel() { // Create the state moderation (between views) BuildStateModerator(); MainDataDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); MainDataName = "analysis.db3"; // Titles and Status var version = ApplicationUtility.GetEntryAssemblyData(); Title = version; // Command Setup ShowAnalysisCommand = new BaseCommand(ShowAnalysis, BaseCommand.AlwaysPass); ShowStartCommand = new BaseCommand(ShowStart, BaseCommand.AlwaysPass); // View Models var workSpacePath = ApplicationUtility.GetApplicationDataFolderPath("MultiAlign"); workSpacePath = Path.Combine(workSpacePath, Settings.Default.WorkspaceFile); GettingStartedViewModel = new GettingStartedViewModel(workSpacePath, StateModerator); GettingStartedViewModel.NewAnalysisStarted += GettingStartedViewModel_NewAnalysisStarted; GettingStartedViewModel.ExistingAnalysisSelected += GettingStartedViewModel_ExistingAnalysisSelected; AnalysisRunningViewModel = new AnalysisRunningViewModel(); AnalysisRunningViewModel.AnalysisCancelled += AnalysisRunningViewModel_AnalysisCancelled; AnalysisRunningViewModel.AnalysisComplete += AnalysisRunningViewModel_AnalysisComplete; LoadingAnalysisViewModel = new AnalysisLoadingViewModel(); LoadingAnalysisViewModel.AnalysisLoaded += LoadingAnalysisViewModel_AnalysisLoaded; ApplicationStatusMediator.SetStatus("Ready."); }
public async Task <IActionResult> GettingStarted(GettingStartedViewModel model) { var accessToken = await HttpContext.GetTokenAsync("access_token"); var dbConfig = mapper.Map <DbConfig>(model); var result = await sportApi.Configure(dbConfig, accessToken); result = result && await competitionApi.Configure(dbConfig, accessToken); result = result && await countryApi.Configure(dbConfig, accessToken); result = result && await teamApi.Configure(dbConfig, accessToken); if (result) { initSettings.Update(opt => { opt.Init = true; }); } return(RedirectToAction("Index", new { init = true })); }
public MainWindow() { try { InitializeComponent(); // Initialize ViewModels if (MainWindowViewModel == null) { MainWindowViewModel = (MainWindowViewModel)this.DataContext; } if (AccountViewModel == null) { AccountViewModel = new AccountViewModel(MainWindowViewModel); } if (GettingStartedViewModel == null) { GettingStartedViewModel = new GettingStartedViewModel(); } if (WalletViewModel == null) { WalletViewModel = new WalletViewModel(); } if (MonitorViewModel == null) { MonitorViewModel = new MonitorViewModel(); } if (WorkerViewModel == null) { WorkerViewModel = new WorkerViewModel(); } DataContext = MonitorViewModel; // Display MainView data MainWindowViewModel.GetMinerMonitoringResults(); MainWindowViewModel.InitWhatToMine(); MainWindowViewModel.InitPayments(); //Force window size to prevent crashing ResizeWindow(); // Initialize Profitability ViewModel after main window data loaded if (ProfitabilityViewModel == null) { ProfitabilityViewModel = new ProfitabilityViewModel(MainWindowViewModel); } // Pass a reference of the Profitability ViewMode to the MainWindowViewModel. This will allow // rerendering of charts from the main window view timer event MainWindowViewModel.profitabilityViewModel = ProfitabilityViewModel; // Pass a reference of the Wallet View Model to the Account View model. // This will allow the account view model to refresh the wallet if needed when linking account id's. AccountViewModel.WalletViewModel = WalletViewModel; // Check to see if should start mining on applications tart. CheckAutoStartMining(); // Handle special Feature Tour Navigation events InitFeatureTourNavigation(); } catch (Exception e) { logger.Error(e, $"Unhandled exception caught"); } }