public NavigationInfo(string name, NavigationKind kind, SnapshotSpan span, NavigationInfo[] children) { Name = name; Kind = kind; Span = span; Children = children; }
public FSharpOption <ListItem> NavigateToListItem(ListKind listKind, NavigationKind navigationKind, FSharpOption <int> argumentOption, bool hasBang) { if (listKind == ListKind.Error) { var errors = IdeServices.TaskService.Errors; if (errors.Count > 0) { var argument = argumentOption.IsSome() ? new int?(argumentOption.Value) : null; var currentIndex = errors.CurrentLocationTask == null ? -1 : errors.IndexOf(errors.CurrentLocationTask); var index = GetListItemIndex(navigationKind, argument, currentIndex, errors.Count); if (index.HasValue) { var errorItem = errors.ElementAt(index.Value); errors.CurrentLocationTask = errorItem; errorItem.SelectInPad(); errorItem.JumpToPosition(); // Item number is one-based. var listItem = new ListItem(index.Value + 1, errors.Count, errorItem.Message); return(FSharpOption.CreateForReference(listItem)); } } } return(FSharpOption <ListItem> .None); }
public PageNavigationMessage(ViewModelBase bindingViewModel, NavigationKind kind) { this.BindingViewModel = bindingViewModel; if (kind == NavigationKind.Navigate) throw new ArgumentException("Navigate は Pageを含むコンストラクタが必要です。"); this.Kind = kind; }
public override async Task HandleArriveAsync(NavigationKind navigationKind) { if (navigationKind == NavigationKind.New) { _loginViewModel = ServiceProvider.GetRequiredService <LoginViewModel>(); } _loginViewModel.LoginSucceeded += LoginViewModel_LoginSucceeded; if (navigationKind == NavigationKind.New) { await Navigation.PushAsync(new LoginPage(_loginViewModel)); } }
public async override Task HandleArriveAsync(NavigationKind navigationKind) { if (navigationKind == NavigationKind.New) { _selectorViewModel = ServiceProvider.GetRequiredService <SelectorViewModel>(); } _selectorViewModel.ItemSelected += ItemSelectorViewModel_ItemSelected; if (navigationKind == NavigationKind.New) { await Navigation.PushModalAsync(new SelectorPage(_selectorViewModel)); } }
public override async Task HandleArriveAsync(NavigationKind navigationKind) { if (navigationKind == NavigationKind.New) { _viewModel = ServiceProvider.GetRequiredService <TabsViewModel>(); } _viewModel.SelectionRequested += ViewModel_SelectionRequested; if (navigationKind == NavigationKind.New) { await Navigation.PushAsync(new TabsPage(_viewModel)); } }
/// <summary> /// Convert the specified navigation instructions into an index for the /// new list item /// </summary> /// <param name="navigationKind">the kind of navigation</param> /// <param name="argument">an optional argument for the navigation</param> /// <param name="current">the zero-based index of the current list item</param> /// <param name="length">the length of the list</param> /// <returns>a zero-based index into the list</returns> private static int?GetListItemIndex(NavigationKind navigationKind, int?argument, int?current, int length) { var argumentOffset = argument ?? 1; var currentIndex = current ?? -1; var newIndex = -1; // The 'first' and 'last' navigation kinds are one-based. switch (navigationKind) { case NavigationKind.First: newIndex = argument.HasValue ? argument.Value - 1 : 0; break; case NavigationKind.Last: newIndex = argument.HasValue ? argument.Value - 1 : length - 1; break; case NavigationKind.Next: newIndex = currentIndex + argumentOffset; break; case NavigationKind.Previous: newIndex = currentIndex - argumentOffset; break; default: Contract.Assert(false); break; } if (newIndex >= 0 && newIndex < length) { return(newIndex); } return(null); }
public abstract FSharpOption <ListItem> NavigateToListItem(ListKind listKind, NavigationKind navigationKind, FSharpOption <int> argument, bool hasBang);
FSharpOption <ListItem> IVimHost.NavigateToListItem(ListKind listKind, NavigationKind navigationKind, FSharpOption <int> argument, bool hasBang) { return(NavigateToListItemFunc(listKind, navigationKind, argument, hasBang)); }
public override FSharpOption <ListItem> NavigateToListItem(ListKind listKind, NavigationKind navigationKind, FSharpOption <int> argument, bool hasBang) { return(FSharpOption <ListItem> .None); }
public abstract Task HandleArriveAsync(NavigationKind navigationKind);