internal void AddHyperlink([NotNull] IStartPageCommand command, [NotNull] Hyperlink hyperlink) { Debug.ArgumentNotNull(command, nameof(command)); Debug.ArgumentNotNull(hyperlink, nameof(hyperlink)); hyperlinks.Add(new Tuple <IStartPageCommand, Hyperlink>(command, hyperlink)); }
public StartPageCommandDescriptor([NotNull] IStartPageCommand command, [NotNull] StartPageCommandAttribute attribute) { Assert.ArgumentNotNull(command, nameof(command)); Assert.ArgumentNotNull(attribute, nameof(attribute)); Command = command; Attribute = attribute; }
public static bool HasDatabaseUri([NotNull] this IStartPageCommand command, [NotNull] StartPageContext context) { Assert.ArgumentNotNull(command, nameof(command)); Assert.ArgumentNotNull(context, nameof(context)); var result = context.StartPageViewer.DatabaseUri; return(result != DatabaseUri.Empty); }
public static DatabaseUri GetDatabaseUri([NotNull] this IStartPageCommand command, [NotNull] StartPageContext context) { Assert.ArgumentNotNull(command, nameof(command)); Assert.ArgumentNotNull(context, nameof(context)); var result = context.StartPageViewer.DatabaseUri; if (result != DatabaseUri.Empty) { return(result); } if (result == DatabaseUri.Empty) { var dialog = new SelectDatabaseDialog { SelectedDatabaseUri = AppHost.Settings.ActiveDatabaseUri }; if (dialog.ShowDialog()) { result = dialog.SelectedDatabaseUri; if (result != DatabaseUri.Empty) { AppHost.Settings.ActiveDatabaseUri = result; context.StartPageViewer.DatabaseUri = result; context.StartPageViewer.UpdateLinks(); return(result); } } } return(DatabaseUri.Empty); }