Skip to content

Commit

Permalink
eerste wijzigingen omtrent onedrive
Browse files Browse the repository at this point in the history
  • Loading branch information
Mannus Etten committed Apr 4, 2018
1 parent 0e978e6 commit 832adba
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 427 deletions.
1 change: 0 additions & 1 deletion BikeTouringGISApp.Library/BikeTouringGISApp.Library.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
<Compile Include="Enumerations\LogStoryLanguage.cs" />
<Compile Include="Enumerations\RepositorySource.cs" />
<Compile Include="Interfaces\IEntity.cs" />
<Compile Include="Interfaces\IRepository.cs" />
<Compile Include="Model\Log.cs" />
<Compile Include="Model\LogBook.cs" />
<Compile Include="Model\LogStory.cs" />
Expand Down
4 changes: 2 additions & 2 deletions BikeTouringGISApp.Library/Interfaces/IEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WinUX.Data;

namespace BikeTouringGISApp.Library.Interfaces
{
public interface IEntity<T>
public interface IEntity<T> : IEntity
{
Guid Identifier { get; set; }
DateTime LastModificationDate { get; set; }
RepositorySource Source { get; set; }

Expand Down
21 changes: 0 additions & 21 deletions BikeTouringGISApp.Library/Interfaces/IRepository.cs

This file was deleted.

19 changes: 14 additions & 5 deletions BikeTouringGISApp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using WinUX.CloudServices.Facebook;
using BikeTouringGISApp.Library.Interfaces;
using BikeTouringGISApp.Library.Model;
using BikeTouringGISApp.Repositories;
using WinUX.Data;

namespace BikeTouringGISApp
{
Expand Down Expand Up @@ -48,17 +48,26 @@ public override async Task OnInitializeAsync(IActivatedEventArgs args)
public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
SimpleIoc.Default.Register<IRepository<LogBook>>(() => new LogBookRepository());
SimpleIoc.Default.Register<IRepository<Log>>(() => new LogRepository());
await ConnectToOneDrive();
await FileService.Instance.SetMainFolder();

/*
SimpleIoc.Default.Register<ICloudService, OneDriveService>();
var fbClient = new FacebookClient();
await fbClient.LoginAsync("687964081409306");
SimpleIoc.Default.Register<FacebookClient>(() => fbClient);
*/
NavigationService.Navigate(typeof(Views.CreateNewLog));
}

private async Task ConnectToOneDrive()
{
var oneDrive = new OneDriveService("00000000441DB51C", new string[] { "wl.signin", "wl.offline_access", "onedrive.readwrite", "onedrive.appfolder" });
var result = await oneDrive.Connect();
if (result.IsConnected)
{
var folder = await oneDrive.GetAppRootFolder();
SimpleIoc.Default.Register<IRepository<LogBook>>(() => new OneDriveRepository<LogBook>("logbooks.json", folder));
SimpleIoc.Default.Register<IRepository<Log>>(() => new OneDriveRepository<Log>("logs.json", folder));
}
}
}
}
13 changes: 9 additions & 4 deletions BikeTouringGISApp/BikeTouringGISApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repositories\LogBookRepository.cs" />
<Compile Include="Repositories\LogRepository.cs" />
<Compile Include="Repositories\OneDriveRepository.cs" />
<Compile Include="Repositories\Repository.cs" />
<Compile Include="Services\FileService.cs" />
<Compile Include="Services\NetworkService.cs" />
<Compile Include="Services\SettingsService.cs" />
Expand Down Expand Up @@ -237,9 +233,18 @@
<PackageReference Include="Microsoft.Graph">
<Version>1.6.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<Version>3.19.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>5.4.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.OneDriveSDK">
<Version>2.0.7</Version>
</PackageReference>
<PackageReference Include="Microsoft.OneDriveSDK.Authentication">
<Version>1.0.10</Version>
</PackageReference>
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
<Version>2.0.0</Version>
</PackageReference>
Expand Down
44 changes: 0 additions & 44 deletions BikeTouringGISApp/Repositories/LogBookRepository.cs

This file was deleted.

44 changes: 0 additions & 44 deletions BikeTouringGISApp/Repositories/LogRepository.cs

This file was deleted.

89 changes: 0 additions & 89 deletions BikeTouringGISApp/Repositories/OneDriveRepository.cs

This file was deleted.

88 changes: 0 additions & 88 deletions BikeTouringGISApp/Repositories/Repository.cs

This file was deleted.

Loading

0 comments on commit 832adba

Please sign in to comment.