Ejemplo n.º 1
0
        public SettingsViewModel(
            IScreen screen,
            ISettingsProvider settingsProvider,
            IFolderHelper folderHelper, 
            IAppContext appContext)
        {
            HostScreen = screen;

            BackCommand = new ReactiveAsyncCommand();
            BackCommand.RegisterAsyncAction(_ => HostScreen.Router.NavigateBack.Execute(null));

            SelectFolder = new ReactiveAsyncCommand();
            SelectFolder.RegisterAsyncAction(_ =>
            {
                var result = folderHelper.SelectFolder();
                if (result.Result == true) {
                    UpdateLocation = result.Folder;
                }
            }, appContext.DispatcherScheduler);

            UpdateLocation = settingsProvider.UpdateLocation;

            _IsError = this.WhenAny(vm => vm.UpdateLocation, vm => vm.Value)
                           .DistinctUntilChanged()
                           .Throttle(TimeSpan.FromMilliseconds(500))
                           .ObserveOn(appContext.DispatcherScheduler)
                           .Select(text => !IsUrlOrFolder(text))
                           .Do(error => {
                                if (!error) {
                                    settingsProvider.UpdateLocation = UpdateLocation;
                                }
                            })
                            .ToProperty(this, vm => vm.IsError, setViaReflection: false);
        }
Ejemplo n.º 2
0
 public void LoadChildren(IEnumerable <string> children)
 {
     IFolderHelper.RemovePlaceholder(this);
     foreach (var child in children)
     {
         Nodes.Add(new ContainerNode(child));
     }
 }
Ejemplo n.º 3
0
 private async Task LoadFoldersAsync <T>(T folderNode) where T : TreeNode, IFolderNode
 {
     await DoActionAsync(tslAccountStatus, "Finding directories...", async() =>
     {
         var account      = CurrentAccount;
         string container = CurrentContainer.Name;
         var service      = new BlobService(account.Name, account.Key);
         var folders      = await service.ListDirectoriesAsync(container, folderNode.Prefix);
         tvwObjects.BeginUpdate();
         IFolderHelper.RemovePlaceholder(folderNode);
         foreach (var dir in folders)
         {
             folderNode.Nodes.Add(new FolderNode(dir));
         }
         tvwObjects.EndUpdate();
     });
 }
Ejemplo n.º 4
0
        public void Configure(IApplicationBuilder app,
                              SeedDatabase seedDatabase,
                              IHostingEnvironment env,
                              IFolderHelper folderHelper,
                              IOptions <FilesOptions> filesOptions,
                              ILoggerFactory loggerFactory)
        {
            loggerFactory.AddSerilog();

            app.UseAuthentication();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
            }

            folderHelper.CreateFilesFoldersIfNotExist();

            seedDatabase.Seed();

            app.UseStaticFiles();

            app.AllowFilesGettingFromServer(env, filesOptions.Value.UploadFolder);

            app.UseSwagger();

            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "UniHub V1");
            });

            app.UseAuthentication();

            app.UseMvcWithDefaultRoute();
            app.UseMvc();
        }
Ejemplo n.º 5
0
        public SettingsViewModel(
            IScreen screen,
            ISettingsProvider settingsProvider,
            IFolderHelper folderHelper,
            IAppContext appContext)
        {
            HostScreen = screen;

            BackCommand = new ReactiveAsyncCommand();
            BackCommand.RegisterAsyncAction(_ => HostScreen.Router.NavigateBack.Execute(null));

            SelectFolder = new ReactiveAsyncCommand();
            SelectFolder.RegisterAsyncAction(_ =>
            {
                var result = folderHelper.SelectFolder();
                if (result.Result == true)
                {
                    UpdateLocation = result.Folder;
                }
            }, appContext.DispatcherScheduler);

            UpdateLocation = settingsProvider.UpdateLocation;

            _IsError = this.WhenAny(vm => vm.UpdateLocation, vm => vm.Value)
                       .DistinctUntilChanged()
                       .Throttle(TimeSpan.FromMilliseconds(500))
                       .ObserveOn(appContext.DispatcherScheduler)
                       .Select(text => !IsUrlOrFolder(text))
                       .Do(error => {
                if (!error)
                {
                    settingsProvider.UpdateLocation = UpdateLocation;
                }
            })
                       .ToProperty(this, vm => vm.IsError, setViaReflection: false);
        }
 public InternalDirectoryProcessor(IFolderHelper folderHelper, IQueryInternalDirectory internalDirectory)
 {
     _folderHelper      = folderHelper;
     _internalDirectory = internalDirectory;
 }
Ejemplo n.º 7
0
 public PathBuilder(IFolderHelper folderHelper)
 {
     this.folderHelper = folderHelper;
 }
Ejemplo n.º 8
0
 public void LoadChildren(IEnumerable <IFolderNode> children)
 {
     IFolderHelper.RemovePlaceholder(this);
 }
Ejemplo n.º 9
0
 public bool HasChildren() => IFolderHelper.HasFolders(this);
 /// <summary>Initializes a new instance of the <see cref="T:MvvmCross.Template.FixTemplateRoot"/> class.</summary>
 /// <param name="folderHelper">Helper service to handle folder operations.</param>
 public FixTemplateRoot(IFolderHelper folderHelper) => _folderHelper = folderHelper;
Ejemplo n.º 11
0
 public FixIosProject(IFolderHelper folderHelper)
 {
     _folderHelper  = folderHelper;
     _iOsFolder     = Path.Combine(TemplateFolder, "Proso.MvvmCross.iOS");
     _testIosFolder = Path.Combine(TemplateFolder, "Proso.MvvmCross.Test.iOS");
 }
Ejemplo n.º 12
0
 public PathBuilder(IFolderHelper folderHelper)
 {
     this.folderHelper = folderHelper;
 }