public ApplicationsModule(IApplicationStore store, IApplicationFactory factory) : base("/applications")
        {
            this.RequiresAuthentication();

            Get["/create"] = parameters => {
                return View["create"];
            };

            Post["/create"] = parameters => {
                var model = 
                    this.Bind<ApplicationModel>();

                var application =
                    factory.Create(model);

                store.Add(application);

                return Response.AsRedirect("~/applications/display/" + application.Id.ToString());
            };

            Get["/display/{id}"] = parameters => {
                return View["display", store.First(x => x.Id.ToString().Equals(parameters.id))];
            };

            Get["/list"] = parameters => {
                return View["list", store];
            };
        }
예제 #2
0
 public AddBreweryPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                                IDeviceService deviceService)
     : base(navigationService, applicationStore, deviceService)
 {
     Title       = Resources.AddBreweryPageTitle;
     SaveCommand = new DelegateCommand(OnSaveCommandExecuted);
 }
 public ApplicationPartByIdDataLoader(
     IApplicationStore applicationStore,
     IBatchScheduler batchScheduler)
     : base(batchScheduler)
 {
     _applicationStore = applicationStore;
 }
예제 #4
0
 /// <summary>
 /// Creates a new <see cref="OAuthRequestContextValidator"/>.
 /// </summary>
 /// <param name="appStore">The <see cref="IApplicationStore"/> to get registered applications.</param>
 /// <param name="scopeStore">The <see cref="IResourceAccessDelegateScopeStore"/> is get resource access delegate scope.</param>
 /// <param name="oauthGrantStore">The <see cref="IOAuthGrantStore"/> to get currently effective authorization code, access token and refresh token.</param>
 /// <param name="systemClock">The <see cref="ISystemClock"/> to provide standard time.</param>
 /// <exception cref="ArgumentNullException">Specified <paramref name="appStore"/> is null.</exception>
 /// <exception cref="ArgumentNullException">Specified <paramref name="scopeStore"/> is null.</exception>
 /// <exception cref="ArgumentNullException">Specified <paramref name="oauthGrantStore"/> is null.</exception>
 /// <exception cref="ArgumentNullException">Specified <paramref name="systemClock"/> is null.</exception>
 public OAuthContextValidator(IApplicationStore appStore, IDelegateScopeStore scopeStore, IOAuthGrantStore oauthGrantStore, ISystemClock systemClock)
 {
     ApplicationStore = Guard.ArgumentNotNull(appStore, nameof(appStore));
     ScopeStore       = Guard.ArgumentNotNull(scopeStore, nameof(scopeStore));
     OAuthGrantStore  = Guard.ArgumentNotNull(oauthGrantStore, nameof(oauthGrantStore));
     SystemClock      = Guard.ArgumentNotNull(systemClock, nameof(systemClock));
 }
예제 #5
0
 public ViewModelBase(INavigationService navigationService, IApplicationStore applicationStore,
                      IDeviceService deviceService)
 {
     _applicationStore  = applicationStore;
     _deviceService     = deviceService;
     _navigationService = navigationService;
 }
예제 #6
0
        public ApplicationsModule(IApplicationStore store, IApplicationFactory factory) : base("/applications")
        {
            this.RequiresAuthentication();

            Get["/create"] = parameters => {
                return(View["create"]);
            };

            Post["/create"] = parameters => {
                var model =
                    this.Bind <ApplicationModel>();

                var application =
                    factory.Create(model);

                store.Add(application);

                return(Response.AsRedirect("~/applications/display/" + application.Id.ToString()));
            };

            Get["/display/{id}"] = parameters => {
                return(View["display", store.First(x => x.Id.ToString().Equals(parameters.id))]);
            };

            Get["/list"] = parameters => {
                return(View["list", store]);
            };
        }
 public BreweryBeersPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                                  IDeviceService deviceService)
     : base(navigationService, applicationStore, deviceService)
 {
     Title = Resources.BreweryBeersPageTitle;
     Beers = new ObservableRangeCollection <Beer>();
     BeerSelectedCommand = new DelegateCommand <Beer>(OnBeerSelectedCommandExecuted);
 }
 public static bool IsDataLoaded(this IApplicationStore applicationStore)
 {
     if (applicationStore.Properties.TryGetValue(ApplicationStoreKeys.LOADED_DATA, out object result))
     {
         return(Convert.ToBoolean(result));
     }
     return(false);
 }
예제 #9
0
 public ApiKeyAuthenticationHandler(
     IOptionsMonitor <ApiKeyAuthenticationOptions> options,
     ILoggerFactory logger,
     UrlEncoder encoder,
     ISystemClock clock,
     IApplicationStore applicationStore) : base(options, logger, encoder, clock)
 {
     _applicationStore = applicationStore;
 }
예제 #10
0
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationStore appStore)
 {
     app
     .UseDeveloperExceptionPage()
     .UseAuthentication()
     .UseOAuthServer()
     .UseMvc();
     //appStore.CreateAsync(new Application("foobarapp", "Foobar", "123-456-789", new Uri[] { new Uri("http://localhost:3721") }, ClientType.Confidential, "foobar")).Wait();
 }
        public TodoItemDetailViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                                       IDeviceService deviceService, IAppDataContext dataContext)
            : base(navigationService, applicationStore, deviceService)
        {
            _dataContext = dataContext;

            Title       = Resources.TodoItemDetailTitle;
            SaveCommand = new DelegateCommand(OnSaveCommandExecuted);
        }
 public BreweriesPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                               IDeviceService deviceService)
     : base(navigationService, applicationStore, deviceService)
 {
     _realm    = Realm.GetInstance(Helpers.AppConstants.RealmConfiguration);
     Title     = Resources.BreweriesPageTitle;
     Breweries = new ObservableRangeCollection <Brewer>();
     BrewerySelectedCommand = new DelegateCommand <Brewer>(OnBrewerySelectedCommandExecuted);
 }
예제 #13
0
 public MenuPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                          IDeviceService deviceService, IAppDataContext context)
     : base(navigationService, applicationStore, deviceService)
 {
     _context          = context;
     Title             = Resources.MainPageTitle;
     Rooms             = new ObservableRangeCollection <ChatRoom>();
     RoomTappedCommand = new DelegateCommand <ChatRoom>(OnRoomTappedCommandExecuted);
     AddRoomCommand    = new DelegateCommand(OnAddRoomCommandExecuted);
 }
예제 #14
0
        public MainPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                                 IDeviceService deviceService, IPageDialogService pageDialogService, ILoggerFacade logger)
            : base(navigationService, applicationStore, deviceService)
        {
            _pageDialogService = pageDialogService;
            _logger            = logger;
            Title = Resources.MainPageTitle;

            NavigateCommand = new DelegateCommand <string>(OnNavigateCommandExecuted);
        }
예제 #15
0
 public ApplicationService(
     ILogger <ApplicationService> log,
     IOptions <ShipbotConfiguration> configuration,
     IApplicationStore applicationStore
     )
 {
     _log              = log;
     _configuration    = configuration;
     _applicationStore = applicationStore;
 }
예제 #16
0
        public MapPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                                IDeviceService deviceService)
            : base(navigationService, applicationStore, deviceService)
        {
            Title = "地图";


            IsActiveChanged += HandleIsActiveTrue;
            IsActiveChanged += HandleIsActiveFalse;
        }
    public async Task <ApplicationPart?> GetApplicationPartAsync(
        [Service] IApplicationStore store,
        [Parent] ApplicationPartComponent partComponent,
        CancellationToken cancellationToken)
    {
        Application?application =
            await store.GetByComponentPartIdAsync(partComponent.Id, cancellationToken);

        return(application?.Parts
               .FirstOrDefault(x => x.Components.Any(y => y.Id == partComponent.Id)));
    }
예제 #18
0
 public ChatPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                          IDeviceService deviceService, IAppDataContext context)
     : base(navigationService, applicationStore, deviceService)
 {
     _context                   = context;
     Messages                   = new ObservableRangeCollection <ChatMessage>();
     RefreshCommand             = new DelegateCommand(OnRefreshCommandExecuted, () => IsNotBusy).ObservesProperty(() => IsNotBusy);
     AddMessageCommand          = new DelegateCommand(OnAddMessageCommandExecuted);
     AddMessageCompositeCommand = new CompositeCommand();
     AddMessageCompositeCommand.RegisterCommand(AddMessageCommand);
     AddMessageCompositeCommand.RegisterCommand(RefreshCommand);
 }
예제 #19
0
 public LoginPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                           IDeviceService deviceService, IAppDataContext context, IPageDialogService pageDialogService)
     : base(navigationService, applicationStore, deviceService)
 {
     Title              = "Login Page";
     _context           = context;
     _pageDialogService = pageDialogService;
     Model              = new User()
     {
         Email       = Settings.Current.EmailAddress ?? string.Empty,
         DisplayName = Settings.Current.DisplayName ?? string.Empty
     };
     LoginCommand = new DelegateCommand(OnLoginCommandExecuted);
 }
예제 #20
0
        public MainPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                                 IDeviceService deviceService, IAppDataContext dataContext, ICloudService cloudService)
            : base(navigationService, applicationStore, deviceService)
        {
            _cloudService = cloudService;
            _dataContext  = dataContext;

            Title     = Resources.MainPageTitle;
            TodoItems = new ObservableRangeCollection <TodoItem>();

            AddItemCommand        = new DelegateCommand(OnAddItemCommandExecuted);
            DeleteItemCommand     = new DelegateCommand <TodoItem>(OnDeleteItemCommandExecuted);
            TodoItemTappedCommand = new DelegateCommand <TodoItem>(OnTodoItemTappedCommandExecuted);
        }
예제 #21
0
 public ApplicationManager(
     IOptions <ApplicationOptions> options,
     IApplicationStore <TApplication> store,
     IPasswordHasher <TApplication> passwordHasher,
     IEnumerable <IApplicationValidator <TApplication> > applicationValidators,
     ILogger <ApplicationManager <TApplication> > logger,
     ApplicationErrorDescriber errorDescriber)
 {
     Options               = options.Value;
     Store                 = store;
     PasswordHasher        = passwordHasher;
     ApplicationValidators = applicationValidators;
     ErrorDescriber        = errorDescriber;
     Logger                = Logger;
 }
예제 #22
0
        public ApplicationManager(
            IApplicationStore <TApplication> applicationStore,
            IEnumerable <IApplicationValidator <TApplication, TUser, TKey> > applicationValidators,
            IOptions <IdentityOptionsExtended> optionsAccessor,
            ILookupNormalizer keyNormalizer,
            IServiceProvider serviceProvider,
            ILogger <ApplicationManager <TApplication, TUser, TKey> > logger)
        {
            _applicationStore = applicationStore;
            _serviceProvider  = serviceProvider;

            Logger                = logger;
            Options               = optionsAccessor?.Value ?? new IdentityOptionsExtended();
            KeyNormalizer         = keyNormalizer;
            ApplicationValidators = applicationValidators?.ToList() ??
                                    Enumerable.Empty <IApplicationValidator <TApplication, TUser, TKey> >().ToList();
        }
예제 #23
0
 public ApplicationService(
     IApplicationStore appStore,
     IChangeLogService changeLogService,
     IApplicationPartDataLoader applicationPartByIdDataLoader,
     IApplicationPartComponentDataLoader applicationPartComponentByIdDataloader,
     IComponentStore compStore,
     IDataLoader <Guid, Component> componentById,
     ISchemaService schemaService)
 {
     _appStore         = appStore;
     _changeLogService = changeLogService;
     _applicationPartByIdDataLoader           = applicationPartByIdDataLoader;
     _applicationPartByIdDataloaderDataLoader = applicationPartComponentByIdDataloader;
     _compStore     = compStore;
     _schemaService = schemaService;
     _componentById = componentById;
 }
예제 #24
0
 public ApiKeyValidator(IApplicationStore applicationStore)
 {
     _applicationStore = applicationStore;
 }
 public JwtOTPGrantValidator(IApplicationStore store)
 {
     this.mApplicationStore = store;
 }
 public DefaultAuthorizationEndPointService(IApplicationStore applicationStore, IAuthorizationTokenStore authorizationTokenStore)
 {
     this.applicationStore        = applicationStore;
     this.authorizationTokenStore = authorizationTokenStore;
 }
예제 #27
0
 public ApplicationManager(IApplicationStore store, IApplicationEventQueries queries, IHttpContextAccessor httpContextAccessor)
 {
     Store               = store ?? throw new ArgumentNullException(nameof(store));
     Queries             = queries;
     HttpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
 }
 public DefaultAuthorizationEndPointService(IApplicationStore applicationStore, IAuthorizationTokenStore authorizationTokenStore)
 {
     this.applicationStore = applicationStore;
     this.authorizationTokenStore = authorizationTokenStore;
 }
예제 #29
0
 public ApplicationController(IApplicationStore store)
 {
     _store = store ?? throw new ArgumentNullException(nameof(store));
 }
예제 #30
0
 public BeerPageViewModel(INavigationService navigationService, IApplicationStore applicationStore,
                          IDeviceService deviceService)
     : base(navigationService, applicationStore, deviceService)
 {
     Title = Resources.BeerPageTitle;
 }
예제 #31
0
 public ApiKeysQueryHandler(IApplicationStore applicationStore)
 {
     _applicationStore = applicationStore;
 }
예제 #32
0
 public ApplicationController(IApplicationStore store)
 {
     mStore = store;
 }