/// <summary> /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { // // HistoryPanel // historyPanel = new HistoryPage(); actionPanel = new ActionPage(Connector); this.Name = "DropPanel"; this.Size = new System.Drawing.Size(200, 300); this.ResumeLayout(false); this.Visible = false; this.Location = new System.Drawing.Point(830, 80); }
/// <summary> /// Инициализация контроллера. Сохранение зависимостей и подписка на события выбора типа Production /// </summary> public void Initialize(HistoryPage historyPage, HistoryScrollViewController scrollViewController) { if (_isInitialized) { return; } _historyPage = historyPage; _scrollViewController = scrollViewController; _historyPage.onFoldoutInfoShow += SetActiveUi; foldoutBtn.onClick.AddListener(Show); _isInitialized = true; }
public MainPage() { this.InitializeComponent(); // Create a XF History page and drop it into a flyout from the command bar var x = new HistoryPage().CreateFrameworkElement(); HistoryFlyout.Content = x; // Listen for lookup requests from the history tracker MessagingCenter.Subscribe <HistoryPage, string>(this, HistoryPage.HistoryItemSelected, (history, cityName) => { Flyout.Hide(); SetCityName(cityName); }); }
private void ChangeSimulatedUser(string userName) { ClearOutInAnticipationOfSwitchingUsers(); var dir = Path.Combine(_testDirectory, userName); if (!Directory.Exists(dir)) { UnZipToDirectory(dir); } var shoppingListDir = Path.Combine(dir, "ShoppingList"); //note: if you don't have a user name, you can just let chorus try to figure one out. //Also note that this is not the same name as that used for any given network repository credentials; //Rather, it's the name which will show in the history, and besides Notes that this user makes. _chorusSystem = new ChorusSystem(shoppingListDir); _chorusSystem.DisplaySettings = new ChorusNotesDisplaySettings() { WritingSystemForNoteLabel = new TestWritingSystem("Algerian"), WritingSystemForNoteContent = new TestWritingSystem("Bradley Hand ITC") }; _chorusSystem.Init(userName); _chorusSystem.Repository.SetKnownRepositoryAddresses(new RepositoryAddress[] { _serverRepository }); _chorusSystem.ProjectFolderConfiguration.IncludePatterns.Add("*.xml"); _dataEditor = new DataEditor(_chorusSystem, Path.Combine(shoppingListDir, "shopping.xml")); _dataEditor.Dock = DockStyle.Fill; _frontPage.Controls.Add(_dataEditor); _notesBrowserControl = _chorusSystem.WinForms.CreateNotesBrowser(); _notesBrowserControl.Dock = DockStyle.Fill; _notesPage.Controls.Add(_notesBrowserControl); _historyControl = _chorusSystem.WinForms.CreateHistoryPage(); _historyControl.Dock = DockStyle.Fill; _historyPage.Controls.Add(_historyControl); }
public void Init() { var welcome = new WelcomePage(this, _defaultTerms, _effectiveTerm); var optionToChangeTerms = new DefaultTermsOptionPage(this, _defaultTerms); var changeTerms = new ChangeTermsPage(this, _effectiveTerm); var calculateLoan = new CalculateLoanPage(this, _effectiveTerm, _loanService); var about = new AboutPage(this); var history = new HistoryPage(this, _historyRepository); AddPage(welcome); AddPage(optionToChangeTerms); AddPage(changeTerms); AddPage(calculateLoan); AddPage(about); AddPage(history); SetPage <WelcomePage>(); welcome.Display(); }
public void TestInit() { var options = new AppiumOptions(); options.AddAdditionalCapability("app", "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"); options.AddAdditionalCapability("deviceName", "WindowsPC"); _driver = new WindowsDriver <WindowsElement>(new Uri("http://127.0.0.1:4723"), options); _driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); _calcStandardView = new StandardCalculatorPage(_driver); _calculatorResults = new CalculatorResults(_driver); _historyPage = new HistoryPage(_driver); _memoryPage = new MemoryPage(_driver); // Identify calculator mode by locating the header try { header = _driver.FindElementByAccessibilityId("Header"); } catch { header = _driver.FindElementByAccessibilityId("ContentPresenter"); } // Ensure that calculator is in standard mode if (!header.Text.Equals("Standard", StringComparison.OrdinalIgnoreCase)) { _driver.FindElementByName("Open Navigation").Click(); Thread.Sleep(TimeSpan.FromSeconds(1)); var menu = _driver.FindElementByClassName("SplitViewPane"); menu.FindElementByName("Standard Calculator").Click(); _driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1); Assert.IsTrue(header.Text.Equals("Standard", StringComparison.OrdinalIgnoreCase)); } // Locate the calculatorResult element calculatorResult = _driver.FindElementByAccessibilityId("CalculatorResults"); Assert.IsNotNull(calculatorResult); }
public void DateIsSavingInSelectedFormat(String dateFormat, int term) { //Arrange DepositPage depositPage = new DepositPage(driver); DateTime startDate = depositPage.StartDate; DateTime endDate = startDate.AddDays(term); String strStartDate = startDate.ToString(dateFormat, CultureInfo.InvariantCulture); String strEndDate = endDate.ToString(dateFormat, CultureInfo.InvariantCulture); //Act SettingsPage settingsPage = depositPage.OpenSettingsPage(); settingsPage.SelectDateFormat.SelectByText(dateFormat); settingsPage.Save(); depositPage.SetAmountRateTerm(1, 1, term); depositPage.Calculate(); HistoryPage historyPage = depositPage.OpenHistoryPage(); String histStartDate = historyPage.GetDateFrom(1); String histEndDate = historyPage.GetDateTo(1); //Assert Assert.AreEqual(strStartDate, histStartDate, "Start Date value is wrong."); Assert.AreEqual(strEndDate, histEndDate, "End Date value is wrong."); }
public CustomTabBar(IHairBl bl, MainSessionController mainSessionController, AlarmController ac) : base() { ToolbarItems.Add(new ToolbarItem("Settings", "settingstitle.png", new Action(Foo), ToolbarItemOrder.Primary)); NavigationPage.SetTitleView(this, CustomTabBar.CreateTitleView(new Xamarin.Forms.Image() { Source = "title.png", HeightRequest = 43 })); SelectedTabColor = Color.White; UnselectedTabColor = Color.Gray; On <Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom); var navigationPage = new MainPage(ac, bl); navigationPage.IconImageSource = "home.png"; navigationPage.Title = ""; var navigationPage2 = new CalendarPage(mainSessionController, ac, bl); navigationPage2.IconImageSource = "calendar.png"; navigationPage2.Title = ""; var navigationPage3 = new HistoryPage(bl, mainSessionController); navigationPage3.IconImageSource = "checklist.png"; navigationPage3.Title = ""; var navigationPage4 = new ChartPage(bl, mainSessionController); navigationPage4.IconImageSource = "chart.png"; navigationPage4.Title = ""; Children.Add(navigationPage); Children.Add(navigationPage2); Children.Add(navigationPage3); Children.Add(navigationPage4); // NavigationPage.SetHasNavigationBar(this, false); }
private void InitInstance() { engineTimer = new DispatcherTimer(); engineTimer.Tick += dispatcherTimer_Tick; engineTimer.Interval = new TimeSpan(0, 0, 0, 0, 500); engineTimer.Start(); currentVerificationContractList = new List <VerificationContract>(); #region Pages Initializer sendPage = new SendPages(); receivePage = new ReceivePage(); historyPage = new HistoryPage(); settingsPage = new SettingsPage(); smartContractPage = new SmartContractPage(); assetInfoPage = new AssetInfoPage(); taskInfoPage = new TaskInfoPage(); #endregion #region Pages Event Handlers sendPage.TaskChangedEventHandler += TaskChangedEvent; settingsPage.ChangeLanguageEvent += ChangeLanguageEvent; settingsPage.UpdateDownloadedFinished += UpdateDownloadedFinishedEvent; settingsPage.ResetHistoryEvent += ResetHistoryEvent; settingsPage.TaskChangedEvent += TaskChangedEvent; #endregion txHistoryItems = new List <HistoryItem>(); assetItems = new List <AssetItem>(); #region Load Pages currentPageStatus = PageStatus.HistoryPage; pageMainTransitionControl.ShowPage(historyPage); currentSendOrReceivePageStatus = SendOrReceivePageStatus.None; currentMenuPageStatus = MenuPageStatus.AssetPage; ShowCurrentMenu(); #endregion if (File.Exists(Constant.PEER_STATE_PATH)) { using (FileStream fs = new FileStream(Constant.PEER_STATE_PATH, FileMode.Open, FileAccess.Read, FileShare.Read)) { LocalNode.LoadState(fs); } } try { if (Constant.LocalNode == null) { Constant.LocalNode = new LocalNode(); Constant.LocalNode.UpnpEnabled = true; } } catch { } finally { } }
/// <summary> /// Open the given repo in the 'HistoryPage' control and its sub-system of controls. /// </summary> private void OpenLocalRepo() { if (string.IsNullOrWhiteSpace(_repoFolder)) { return; } SuspendLayout(); if (_historyPage != null) { _historyPage.RevisionSelectionChanged -= HistoryPageRevisionSelectionChanged; Controls.Remove(_historyPage); _historyPage.Dispose(); _historyPage = null; } if (_chorusSystem != null) { _chorusSystem.Dispose(); _chorusSystem = null; } var repoType = GetRepoType(); ChorusSystem newChorusSystem; switch (repoType) { case RepoType.None: return; case RepoType.NotSupported: MessageBox.Show(this, "The selected repository is not supported.", "Unsupported Repository Type", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; case RepoType.LIFT: newChorusSystem = Utilities.InitializeChorusSystem(_repoFolder, Environment.UserName, LiftFolder.AddLiftFileInfoToFolderConfiguration); break; case RepoType.FLEx: newChorusSystem = Utilities.InitializeChorusSystem(_repoFolder, Environment.UserName, FlexFolderSystem.ConfigureChorusProjectFolder); break; default: MessageBox.Show(this, "The selected repository is recognized, but not yet supported.", "Unsupported Repository Type", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } _chorusSystem = newChorusSystem; // Set up some new columns in the main control of the history page. // This makes it easy for the user to know the selected revision's branch and simple rev id. var historyPageOptions = new HistoryPageOptions(); var revisionListOptions = historyPageOptions.RevisionListOptions; // Not enabled in Chorus. revisionListOptions.ShowRevisionChoiceControls = true; var branchColumnDefinition = new HistoryColumnDefinition { ColumnLabel = "Branch", StringSupplier = BranchName }; // This is available as a tool tip of the icon cell, but show it here, anyway. var revisionIdColumnDefinition = new HistoryColumnDefinition { ColumnLabel = "Revision Id", StringSupplier = RevisionId }; revisionListOptions.ExtraColumns = new List <HistoryColumnDefinition> { branchColumnDefinition, revisionIdColumnDefinition }; _historyPage = _chorusSystem.WinForms.CreateHistoryPage(historyPageOptions); _historyPage.RevisionSelectionChanged += HistoryPageRevisionSelectionChanged; Controls.Add(_historyPage); _historyPage.Dock = DockStyle.Fill; ResumeLayout(true); }
private void History_Btn_Click(object sender, RoutedEventArgs e) { HistoryPage p = new HistoryPage(Username, Wallet); this.NavigationService.Navigate(p, UriKind.Relative); }
public BottomBarPage GetBottomBar() { BottomBarPage bottomBarPage = new BottomBarPage(); Title = "Test"; bottomBarPage.BarTextColor = Color.Black; bottomBarPage.FixedMode = false; MenuViewModel menuVM = new MenuViewModel(); foreach (MenuItem item in menuVM.MenuPageList) { switch (item.Title) { case "Home": HomePage home = new HomePage(); FileImageSource homeIcon = (FileImageSource)FileImageSource.FromFile(string.Format(item.ImageSource, item.Title.ToLowerInvariant())); home.Title = item.Title; home.Icon = homeIcon; bottomBarPage.Children.Add(home); break; case "Vehicles": EditVehiclePage vehicle = new EditVehiclePage(); FileImageSource vehicleIcon = (FileImageSource)FileImageSource.FromFile(string.Format(item.ImageSource, item.Title.ToLowerInvariant())); vehicle.Title = item.Title; vehicle.Icon = vehicleIcon; bottomBarPage.Children.Add(vehicle); break; case "History": HistoryPage history = new HistoryPage(); FileImageSource historyIcon = (FileImageSource)FileImageSource.FromFile(string.Format(item.ImageSource, item.Title.ToLowerInvariant())); history.Title = item.Title; history.Icon = historyIcon; bottomBarPage.Children.Add(history); break; case "Add Shift": AddShiftPage addShift = new AddShiftPage(); FileImageSource addShiftIcon = (FileImageSource)FileImageSource.FromFile(string.Format(item.ImageSource, item.Title.ToLowerInvariant())); addShift.Title = item.Title; addShift.Icon = addShiftIcon; bottomBarPage.Children.Add(addShift); break; } } OthersPage other = new OthersPage(); bottomBarPage.Children.Add(other); return(bottomBarPage); }
void Menu_ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { //var itemclicked = new MasterMenuItem(); var item = e.SelectedItem as MasterMenuItem; //item = itemclicked; ContentPage page = null; if (item != null) { switch (item.MenuItemName) { case "Home": page = new HomePage(); break; case "Account": page = new AccountPage(); break; case "Cards": page = new AddCardPage(); break; case "Prepaid": page = new AddCardPage(); break; case "History": page = new HistoryPage(); break; case "Rewards": page = new RewardsPage(); break; case "Scan": scanPage = new ZXingScannerPage(); page = scanPage; scanPage.OnScanResult += async(result) => { scanPage.IsScanning = false; Device.BeginInvokeOnMainThread(() => { Navigation.PopAsync(); DisplayAlert("Scanned Barcode", result.Text, "OK"); }); await Navigation.PushAsync(scanPage); }; //page = new ScanPage(); break; case "Share": page = new SharePage(); break; case "Help": page = new HelpPage(); break; case "About": page = new AboutPage(); break; case "Sign Out": page = new LoginPage(); break; default: page = new LoginPage(); break; } Detail = new NavigationPage(page); masterPage.menu_ListView.SelectedItem = null; IsPresented = false; } }