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));
        }
Ejemplo n.º 2
0
            public StartPageCommandDescriptor([NotNull] IStartPageCommand command, [NotNull] StartPageCommandAttribute attribute)
            {
                Assert.ArgumentNotNull(command, nameof(command));
                Assert.ArgumentNotNull(attribute, nameof(attribute));

                Command   = command;
                Attribute = attribute;
            }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }