public ContentControl GetView() { var view = new HistoryView(); view.DataContext = new HistoryViewModel(eventAggregator); return(view); }
public Control view() { Control v = new HistoryView(); v.DataContext = this; return(v); }
public MainWindow() { InitializeComponent(); var connFactory = new Func<SQLiteConnectionWithLock>(() => new SQLiteConnectionWithLock( new SQLitePlatformWin32(), new SQLiteConnectionString("requests.db", false))); var sqlite = new SQLiteAsyncConnection(connFactory); var sqliteWrapper = new SQLiteAsyncConnectionImpl(sqlite); sqlite.CreateTableAsync<HttpRequest>().ContinueWith(_ => { var requestHistory = new RequestHistory(sqliteWrapper); var historyViewModel = new HistoryViewModel(requestHistory); var historyView = new HistoryView(historyViewModel); Grid.SetColumn(historyView, 0); rootGrid.Children.Add(historyView); var requestViewModel = new RequestViewModel(requestHistory, historyViewModel.SelectedRequestObservable); var requestView = new RequestView(requestViewModel); Grid.SetColumn(requestView, 1); rootGrid.Children.Add(requestView); }, TaskScheduler.FromCurrentSynchronizationContext()); }
/// <summary> /// The execute show graph history. /// </summary> private void ExecuteShowGraphHistory() { var view = new HistoryView { GraphHistory = this.graphSteps }; view.Show(); }
private View HistoryView() { var historyView = new HistoryView(); historyView.SetBinding(BindingContextProperty, nameof(HomeViewModel.HistoryViewModel)); Utils.Accessibility.Unused(historyView); return(historyView); }
private void OnDeleteElement(object obj) { if (SelectedItem != null) { History.Remove(SelectedItem); HistoryView.Refresh(); SelectedIndex = -1; } }
public void LoadHistoryView() { HistoryView subView = new HistoryView(); HistoryController subViewController = new HistoryController(subView); subViewController.LoadView(); view.AddControlToMainPanel(subView); }
public InfoView(InfoViewModel viewModel, HistoryView historyView, AppInformationView appInformationView) { InitializeComponent(); BindingContext = viewModel; historyView.BindingContext = viewModel.HistoryViewModel; Children.Add(historyView); Children.Add(appInformationView); }
public void SelectFade(IInsertData insert) { if (AlreadyExists(insert)) { SelectedItem = History.First(x => x.FirstLine == insert.FirstLine && x.SecondLine == insert.SecondLine); HistoryView.Refresh(); return; } SelectedIndex = -1; }
public HomeScreenViewModel() { Debug.WriteLine("HomeScreenViewModel"); mainView = new MainView(); otherView = new LandslideRecordView(); recordView = new FloodRecordView(); dHistoryView = new HistoryView(); MyMenu = Model.Menu.Instance; LogoutCommand = new RelayCommand(DoLogout); }
public void UpdateValues() { HistoryView.ItemCount = log.Names.Count; if (AutoScrollCheck.Checked && _lastCount != HistoryView.ItemCount) { HistoryView.ensureVisible(HistoryView.ItemCount - 1); } _lastCount = HistoryView.ItemCount; HistoryView.Refresh(); }
public async Task <History> AddHistory([FromBody] HistoryView history) { try { return(await service.Add(MapperHelp.GetHistory(history))); } catch (CustomException ex) { return(null); } }
private void ShowHistory() { Hide(); HistoryView historyView = new HistoryView { Topmost = Topmost, mainWindow = this }; historyView.ShowDialog(); Show(); }
private async void historyToolStripMenuItem_Click(object sender, EventArgs e) { var data = await manager.List <LocationHistory>("LocationHistory"); var view = new HistoryView(data); view.Anchor = Constants.FullScreenStyles; view.Width = mainPanel.Width; view.Height = mainPanel.Height; this.mainPanel.Controls.Clear(); this.mainPanel.Controls.Add(view); }
public void UpdateValues() { HistoryView.ItemCount = log.Names.Count; if (AutoScrollCheck.Checked && _lastUndoAction != log.NextUndoStepName) { HistoryView.ensureVisible(log.UndoIndex); HistoryView.clearSelection(); HistoryView.SelectItem(log.UndoIndex - 1, true); } _lastUndoAction = log.NextUndoStepName; HistoryView.Refresh(); }
public ActionResult History(int id) { var transactions = _transactionDao.GetTransactionsByBatchId(id); var supplyChain = SupplyChainFactory.Make(transactions); var model = new HistoryView { BatchId = id, SupplyChain = supplyChain }; return(View("History", model)); }
public void UpdateValues() { HistoryView.RowCount = Log.Names.Count; if (AutoScrollCheck.Checked && _lastUndoAction != Log.NextUndoStepName) { HistoryView.ScrollToIndex(Log.UndoIndex); HistoryView.DeselectAll(); HistoryView.SelectRow(Log.UndoIndex - 1, true); } _lastUndoAction = Log.NextUndoStepName; HistoryView.Refresh(); }
private void ToolStripButtonHistory_Click(object sender, EventArgs e) { if (IsViewOpen(typeof(HistoryView)) == true) { return; } var History = new HistoryView(new HistoryViewModel()) { MdiParent = this }; // this.toolStrip1.Hide(); History.Show(); }
private void HistoryView_MouseUp(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { RightClickMenu.Show(HistoryView, e.X, e.Y); } else if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (HistoryView.selectedItem == -1) { HistoryView.SelectItem(_hackSelect, true); } } }
//列表查看 public List <HistoryView> Load() { var listHistory = UnitWork.SqlQuery <History>( "select Id, UserName,Remake,GU_ID,Updatetime,UserID,Wom_ID From History", new object[] { }).ToList(); var listHistoryView = new List <HistoryView>(); foreach (var v in listHistory) { HistoryView hv = v; listHistoryView.Add(hv); } return(listHistoryView); }
private void showHistButton_Click(object sender, EventArgs e) { if (byDateRB.Checked) { textBox1.Text = ""; DateTime startDate = Convert.ToDateTime(monthCalendar1.SelectionStart); DateTime endDate = Convert.ToDateTime(monthCalendar1.SelectionEnd); try { String[] historyLines = HistoryView.historyByDate(startDate, endDate); textBox1.Lines = historyLines; historyError(historyLines); } catch { textBox1.Text = "right now file is busy , pleas try again later"; } } if (byDayRB.Checked) { textBox1.Text = ""; int dayNum = (int)numericUpDown1.Value; try { String[] historyLines = HistoryView.historyBydays(dayNum); textBox1.Lines = historyLines; historyError(historyLines); } catch { textBox1.Text = "right now file is busy , pleas try again later"; } } if (radioButtonByLines.Checked) { textBox1.Text = ""; int numLines = (int)numOfLines.Value; try { String[] historyLines = HistoryView.historyByLines(numLines); textBox1.Lines = historyLines; historyError(historyLines); } catch { textBox1.Text = "right now file is busy , pleas try again later"; } } }
public void LogMessage(string message) { lock (locker) { EnsureFileExists(); message = $"[{DateTime.Now.ToShortDateString()} {DateTime.Now.ToShortTimeString()}] {message}\r\n"; HistoryView.Invoke((MethodInvoker) delegate { // Running on the UI thread HistoryView.AppendText(message); }); File.AppendAllText(GetLogFilePath(), message); } }
public void AddToHistory(IInsertData insertData) { OnPropertyChanged("ItemWith"); if (!AlreadyExists(insertData)) { History.Add(insertData); HistoryView.Refresh(); SelectedItem = insertData; } else { SelectedItem = History.First(x => x.FirstLine == insertData.FirstLine && x.SecondLine == insertData.SecondLine); HistoryView.Refresh(); } }
/// <summary> /// Gets a feed from a Uri. /// </summary> private void GetFeed(bool withCache = true, bool withHistory = true) { try { IsLoading = true; if (withCache && opdsManager.CanFromCache(_CurrentUrl)) { OpdsFeed temp = null; Task.Factory.StartNew(() => { temp = opdsManager.ConvertFeed(_CurrentUrl); }).ContinueWith(ant => { Content = temp; IsLoading = false; if (withHistory) { _History.Add(_CurrentUrl); HistoryView.MoveCurrentTo(_CurrentUrl); } //updates UI no problem as we are using correct SynchronizationContext }, TaskScheduler.FromCurrentSynchronizationContext()); } else { WebClient client = CreateWebClient(); client.OpenReadCompleted += new OpenReadCompletedEventHandler(Client_OpenReadCompleted); client.OpenReadAsync(_CurrentUrl, new AsyncFeedParam() { currentUri = _CurrentUrl, withHisto = withHistory, clientWeb = client }); } } catch (Exception err) { LogHelper.Manage("FeedViewModel.GetFeed", err); } }
public ActionResult ViewDetail(string id) { List <HistoryView> list = new List <HistoryView>(); IHistoryTripProvider historyTrip = new HistoryTripProvider(); var exhibition = _exhibitionProvider.GetExhibitionById(id); var listhistory = historyTrip.GetAllHistoryTripByExhibitionId(id); ViewBag.KindService = _kindServiceProvider.GetKindServiceById(exhibition.KindServiceId).KindServiceName; HistoryView historyview = new HistoryView(); foreach (var item in listhistory) { historyview.HistoryTrip = item; historyview.ExhibitionStatus = _exhibitionStatusProvider.GetExhibitionStatusById(item.ExhibitionStatusId.Value).Name; list.Add(historyview); } ViewBag.ListHistory = list; return(PartialView("_ViewDetail", exhibition)); }
public async Task <IActionResult> CreateHistory([FromBody] HistoryView model) { if (ModelState.IsValid) { var UserId = _userManager.GetUserId(User); var history = new HISTORY { ID_RESULTH = model.H.ID_RESULTH, ID_TYPE = model.H.ID_TYPE, ID_USER = UserId }; await historyService.Add(history); return(Ok(history)); } return(BadRequest(ModelState)); }
public ActionResult Histories(string id) { if (!String.IsNullOrEmpty(id)) { var agentinfo = new TransactionSystem().FindPersonDetail(id); var trnsaction = new TransactionSystem().GetTransactionHistories(s => s.AgentId.Equals(id)) .OrderByDescending(s => s.CreatedOn); var history = new HistoryView { Agent = agentinfo, TransactionHistoryList = trnsaction.ToList() }; return(View(history)); } return(View()); }
void FindGameObjects() { // find var canvas = GameObject.Find("Canvas").transform; bmiView = canvas.Find("BMIView").GetComponent <BMIView>(); historyView = canvas.Find("HistoryView").GetComponent <HistoryView>(); accountView = canvas.Find("AccountView").GetComponent <AccountView>(); // prefab var prefab = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/BMIApp/Prefabs/HistoryElm.prefab"); var historyElm = prefab.GetComponent <HistoryElmView>(); // data sharedData = ScriptableObject.CreateInstance <SharedScriptableObject>(); historyData = new TemporaryHistoryDataStore(); // set bmiPresenter.InnerPresenter = new BMIPresenter(bmiView); historyPresenter.InnerPresenter = new HistoryListPresenter(historyView, historyElm); accountPresenter.InnerPresenter = new AccountPresenter(accountView); accountRepository.InnerRepository = new UserAccountRepository(sharedData); historyRepository.InnerRepository = new BMIHistoryRepository(historyData); }
private void Rebuild() { TreeNode lastNode = null; HistoryView.BeginUpdate(); HistoryView.Nodes.Clear(); if (_activeDocument.TryGetTarget(out MapDocument md)) { var nodes = HistoryView.Nodes; var stack = md.Map.Data.GetOne <HistoryStack>(); if (stack != null) { foreach (var item in stack.GetOperations()) { lastNode = nodes.Add(item.GetType().Name); } } } HistoryView.EndUpdate(); lastNode?.EnsureVisible(); }
/// <summary> /// Gets the response, and parses as a feed. /// </summary> /// <param name="sender">The web client.</param> /// <param name="e">Open Read Completed Event Args</param> private void Client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { try { if (e.Error == null && e.Result != null) { try { AsyncFeedParam par = e.UserState as AsyncFeedParam; par.clientWeb.OpenReadCompleted -= new OpenReadCompletedEventHandler(Client_OpenReadCompleted); Content = opdsManager.ConvertFeed(e.Result, par.currentUri); if (par.withHisto) { _History.Add(_CurrentUrl); HistoryView.MoveCurrentTo(_CurrentUrl); } } catch (XmlException err) { LogHelper.Manage("FeedViewModel:Client_OpenReadCompleted", err); } } else if (e.Error != null) { LogHelper.Manage("FeedViewModel:Client_OpenReadCompleted", e.Error); } } catch (Exception err) { LogHelper.Manage("FeedViewModel:Client_OpenReadCompleted", err); } finally { IsLoading = false; } }
/// <summary> /// Navigate to the appropriate page /// </summary> /// <param name="mode">Enum parameter representing page to navigate to</param> internal void Navigate(Mode mode) { switch (mode) { case Mode.LogIn: _contentWindow.ContentControl.Content = _loginView ?? (_loginView = new LoginFormView()); break; case Mode.Register: _contentWindow.ContentControl.Content = _registerView ?? (_registerView = new RegisterFormView()); break; case Mode.TextEditor: _contentWindow.ContentControl.Content = _textEditorView ?? (_textEditorView = new TextEditorView()); break; case Mode.History: _contentWindow.ContentControl.Content = _historyView ?? (_historyView = new HistoryView()); break; default: throw new ArgumentOutOfRangeException(nameof(mode), mode, null); } }
public Control view() { Control v = new HistoryView(); v.DataContext = this; return v; }
private void Open() { var historyView = new HistoryView(); m_viewModel.PauseCommand.Execute(null); historyView.Owner = this; HistoryModel historyModel = HistoryModel.Instance; if (historyModel.HistoryItems.Count == 0) { historyView.BrowseFiles(); } else { historyView.ShowDialog(); } if (historyView.FileList.Count == 0) { return; } var playList = m_viewModel.GenerateFileList(historyView.FileList); if (playList.Count != 0) { m_viewModel.PlayAListOfFiles(playList); } }