This commit is contained in:
SunboX 2016-11-02 22:41:47 +01:00
Коммит 644355dc6d
159 изменённых файлов: 36538 добавлений и 0 удалений

46
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,46 @@
#Autosave files
*~
#build
[Oo]bj/
[Bb]in/
packages/
TestResults/
# globs
Makefile.in
*.DS_Store
*.sln.cache
*.suo
*.cache
*.pidb
*.userprefs
*.usertasks
config.log
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.user
*.tar.gz
tarballs/
test-results/
Thumbs.db
#Mac bundle stuff
*.dmg
*.app
#resharper
*_Resharper.*
*.Resharper
#dotCover
*.dotCover
Binaries/RestSharp.dll
Binaries/RestSharp.pdb
Binaries/RestSharp.xml
Binaries/RestSharp.Build.dll
Binaries/RestSharp.Build.pdb
cov-int

3
.gitmodules поставляемый Normal file
Просмотреть файл

@ -0,0 +1,3 @@
[submodule "webdavnet"]
path = webdavnet
url = https://github.com/bnoffer/webdavnet.git

Разница между файлами не показана из-за своего большого размера Загрузить разницу

365
LICENSE.md Normal file
Просмотреть файл

@ -0,0 +1,365 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
6. Disclaimer of Warranty
-------------------------
Covered Software is provided under this License on an "as is"
basis, without warranty of any kind, either expressed, implied, or
statutory, including, without limitation, warranties that the
Covered Software is free of defects, merchantable, fit for a
particular purpose or non-infringing. The entire risk as to the
quality and performance of the Covered Software is with You.
Should any Covered Software prove defective in any respect, You
(not any Contributor) assume the cost of any necessary servicing,
repair, or correction. This disclaimer of warranty constitutes an
essential part of this License. No use of any Covered Software is
authorized under this License except under this disclaimer.
7. Limitation of Liability
--------------------------
Under no circumstances and under no legal theory, whether tort
(including negligence), contract, or otherwise, shall any
Contributor, or anyone who distributes Covered Software as
permitted above, be liable to You for any direct, indirect,
special, incidental, or consequential damages of any character
including, without limitation, damages for lost profits, loss of
goodwill, work stoppage, computer failure or malfunction, or any
and all other commercial damages or losses, even if such party
shall have been informed of the possibility of such damages. This
limitation of liability shall not apply to liability for death or
personal injury resulting from such party's negligence to the
extent applicable law prohibits such limitation. Some
jurisdictions do not allow the exclusion or limitation of
incidental or consequential damages, so this exclusion and
limitation may not apply to You.
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

84
NextcloudApp.sln Normal file
Просмотреть файл

@ -0,0 +1,84 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NextcloudClient", "NextcloudClient\NextcloudClient.csproj", "{E2015378-CEFF-4913-A4A6-48706F2625D4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDavClient", "WebDavClient\WebDavClient\WebDavClient.csproj", "{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NextcloudApp", "NextcloudApp\NextcloudApp.csproj", "{99EFB7EA-88A3-4FCF-9289-22734215B5CF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Debug|ARM.Build.0 = Debug|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Debug|x64.ActiveCfg = Debug|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Debug|x64.Build.0 = Debug|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Debug|x86.ActiveCfg = Debug|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Debug|x86.Build.0 = Debug|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Release|Any CPU.Build.0 = Release|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Release|ARM.ActiveCfg = Release|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Release|ARM.Build.0 = Release|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Release|x64.ActiveCfg = Release|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Release|x64.Build.0 = Release|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Release|x86.ActiveCfg = Release|Any CPU
{E2015378-CEFF-4913-A4A6-48706F2625D4}.Release|x86.Build.0 = Release|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Debug|ARM.ActiveCfg = Debug|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Debug|ARM.Build.0 = Debug|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Debug|x64.ActiveCfg = Debug|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Debug|x64.Build.0 = Debug|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Debug|x86.ActiveCfg = Debug|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Debug|x86.Build.0 = Debug|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Release|Any CPU.Build.0 = Release|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Release|ARM.ActiveCfg = Release|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Release|ARM.Build.0 = Release|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Release|x64.ActiveCfg = Release|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Release|x64.Build.0 = Release|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Release|x86.ActiveCfg = Release|Any CPU
{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}.Release|x86.Build.0 = Release|Any CPU
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|Any CPU.ActiveCfg = Debug|x86
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|ARM.ActiveCfg = Debug|ARM
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|ARM.Build.0 = Debug|ARM
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|ARM.Deploy.0 = Debug|ARM
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|x64.ActiveCfg = Debug|x64
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|x64.Build.0 = Debug|x64
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|x64.Deploy.0 = Debug|x64
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|x86.ActiveCfg = Debug|x86
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|x86.Build.0 = Debug|x86
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Debug|x86.Deploy.0 = Debug|x86
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|Any CPU.ActiveCfg = Release|x86
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|ARM.ActiveCfg = Release|ARM
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|ARM.Build.0 = Release|ARM
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|ARM.Deploy.0 = Release|ARM
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|x64.ActiveCfg = Release|x64
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|x64.Build.0 = Release|x64
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|x64.Deploy.0 = Release|x64
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|x86.ActiveCfg = Release|x86
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|x86.Build.0 = Release|x86
{99EFB7EA-88A3-4FCF-9289-22734215B5CF}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
description = A portable class library to interact with ownCloud servers through WebDAV and the ownCloud OCS API.
version = 0.1.0
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=NextcloudApp_002EAnnotations/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=WebDavClient_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

Просмотреть файл

@ -0,0 +1,19 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls.Primitives;
using Microsoft.Xaml.Interactivity;
namespace NextcloudApp.Actions
{
public class OpenMenuFlyoutAction : DependencyObject, IAction
{
public object Execute(object sender, object parameter)
{
var senderElement = sender as FrameworkElement;
var flyoutBase = FlyoutBase.GetAttachedFlyout(senderElement);
flyoutBase.ShowAt(senderElement);
return null;
}
}
}

34
NextcloudApp/App.xaml Normal file
Просмотреть файл

@ -0,0 +1,34 @@
<prismUnity:PrismUnityApplication
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prismUnity="using:Prism.Unity.Windows"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converter="using:NextcloudApp.Converter"
mc:Ignorable="d"
x:Class="NextcloudApp.App">
<prismUnity:PrismUnityApplication.Resources>
<ResourceDictionary>
<converter:ContentTypeToIconConverter x:Key="ContentTypeToIconConverter"/>
<converter:BytesToHumanReadableConverter x:Key="BytesToHumanReadableConverter"/>
<converter:DateTimeToStringConverter x:Key="DateTimeToStringConverter"/>
<converter:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<converter:IntToVisibilityConverter x:Key="IntToVisibilityConverter"/>
<converter:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
<converter:EmptyPathToSlashConverter x:Key="EmptyPathToSlashConverter"/>
<converter:AddSlashToPathConverter x:Key="AddSlashToPathConverter"/>
<converter:IsSortingToSelectionModeConverter x:Key="IsSortingToSelectionModeConverter"/>
<converter:IsFileAndNotFolderToVisibilityConverter x:Key="IsFileAndNotFolderToVisibilityConverter"/>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Themes/Fonts.xaml" />
<ResourceDictionary Source="ms-appx:///Themes/SplitViewStyles.xaml" />
<ResourceDictionary Source="ms-appx:///Themes/MenuFlyoutIconItemStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</prismUnity:PrismUnityApplication.Resources>
</prismUnity:PrismUnityApplication>

203
NextcloudApp/App.xaml.cs Normal file
Просмотреть файл

@ -0,0 +1,203 @@
using System;
using System.IO;
using System.Net;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Microsoft.Practices.Unity;
using Prism.Unity.Windows;
using Prism.Windows.AppModel;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Resources;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using NextcloudApp.Services;
using NextcloudApp.Utils;
using NextcloudClient.Exceptions;
using Prism.Windows.Mvvm;
namespace NextcloudApp
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : PrismUnityApplication
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
InitializeComponent();
UnhandledException += OnUnhandledException;
}
private async void OnUnhandledException(object sender, UnhandledExceptionEventArgs args)
{
var exceptionStackTrace = string.Empty;
try
{
exceptionStackTrace = args.Exception.StackTrace + "";
}
// ReSharper disable once EmptyGeneralCatchClause
catch { }
var exceptionMessage = args.Message;
var exceptionType = string.Empty;
var innerExceptionType = string.Empty;
var exceptionHashCode = string.Empty;
if (args.Exception != null)
{
// Tasks will throw a canceled exception if they get canceled
// We don't care, but avoid closing the app
if (args.Exception.GetType() == typeof(TaskCanceledException))
{
args.Handled = true;
return;
}
if (args.Exception.GetType() == typeof(OperationCanceledException))
{
args.Handled = true;
return;
}
if (args.Exception.GetType() == typeof(FileNotFoundException))
{
args.Handled = true;
return;
}
// Temporary Workaround for WP10
if (args.Exception.GetType() == typeof(ArgumentException))
{
args.Handled = true;
return;
}
if (args.Exception.GetType() == typeof(ResponseError))
{
args.Handled = true;
ResponseErrorHandlerService.HandleException((ResponseError)args.Exception);
return;
}
// 0x8000000B, E_BOUNDS, System.Exception, OutOfBoundsException
if ((uint)args.Exception.HResult == 0x80004004)
{
args.Handled = true;
return;
}
// 0x80072EE7, ERROR_WINHTTP_NAME_NOT_RESOLVED, The server name or address could not be resolved
if ((uint)args.Exception.HResult == 0x80072EE7)
{
args.Handled = true;
var resourceLoader = Container.Resolve<IResourceLoader>();
var dialogService = Container.Resolve<DialogService>();
var dialog = new ContentDialog
{
Title = resourceLoader.GetString("AnErrorHasOccurred"),
Content = new TextBlock
{
Text = resourceLoader.GetString("ServerNameOrAddressCouldNotBeResolved"),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = resourceLoader.GetString("OK")
};
await dialogService.ShowAsync(dialog);
return;
}
exceptionType = args.Exception.GetType().ToString();
if (args.Exception.InnerException != null)
{
innerExceptionType = args.Exception.InnerException.GetType().ToString();
}
exceptionHashCode = string.IsNullOrEmpty(exceptionStackTrace)
? args.Exception.GetHashCode().ToString()
: exceptionStackTrace.GetHashCode().ToString();
}
if (args.Handled)
{
return;
}
args.Handled = true;
await
ExceptionReportService.Handle(exceptionType, exceptionMessage, exceptionStackTrace,
innerExceptionType, exceptionHashCode);
}
protected override UIElement CreateShell(Frame rootFrame)
{
var shell = Container.Resolve<AppShell>();
shell.SetContentFrame(rootFrame);
return shell;
}
protected override Task OnInitializeAsync(IActivatedEventArgs args)
{
Container.RegisterInstance(new DialogService());
Container.RegisterInstance<IResourceLoader>(new ResourceLoaderAdapter(new ResourceLoader()));
var task = base.OnInitializeAsync(args);
DeviceGestureService.GoBackRequested += DeviceGestureServiceOnGoBackRequested;
// Just count total app starts
SettingsService.Instance.Settings.AppTotalRuns = SettingsService.Instance.Settings.AppTotalRuns + 1;
// Count app starts after last update
var currentVersion =
$"{Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}.{Package.Current.Id.Version.Revision}";
if (currentVersion == SettingsService.Instance.Settings.AppRunsAfterLastUpdateVersion)
{
SettingsService.Instance.Settings.AppRunsAfterLastUpdate = SettingsService.Instance.Settings.AppRunsAfterLastUpdate + 1;
}
else
{
SettingsService.Instance.Settings.AppRunsAfterLastUpdateVersion = currentVersion;
SettingsService.Instance.Settings.AppRunsAfterLastUpdate = 1;
}
return task;
}
protected override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args)
{
if (
string.IsNullOrEmpty(SettingsService.Instance.Settings.ServerAddress) ||
string.IsNullOrEmpty(SettingsService.Instance.Settings.Username) ||
string.IsNullOrEmpty(SettingsService.Instance.Settings.Password)
)
{
var loadState = args.PreviousExecutionState == ApplicationExecutionState.Terminated;
//NavigationService.Navigate(PageTokens.Login.ToString(), loadState);
NavigationService.Navigate(PageTokens.Login.ToString(), null);
}
else
{
NavigationService.Navigate(PageTokens.DirectoryList.ToString(), null);
}
// Ensure the current window is active
Window.Current.Activate();
return Task.FromResult(true);
}
private void DeviceGestureServiceOnGoBackRequested(object sender, DeviceGestureEventArgs e)
{
var appShell = (AppShell)Window.Current.Content;
var contentFrame = (Frame)appShell.GetContentFrame();
var page = (SessionStateAwarePage)contentFrame.Content;
var revertable = page?.DataContext as IRevertState;
if (revertable == null || !revertable.CanRevertState())
{
return;
}
e.Handled = true;
e.Cancel = true;
revertable.RevertState();
}
}
}

Просмотреть файл

@ -0,0 +1,54 @@
<Page
x:Class="NextcloudApp.AppShell"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="using:NextcloudApp.Views"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="MenuStates">
<VisualState x:Name="Wide">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="1280" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="rootSplitView.DisplayMode" Value="Inline" />
<Setter Target="rootSplitView.IsPaneOpen" Value="True" />
<Setter Target="togglePaneButton.IsEnabled" Value="False" />
<Setter Target="togglePaneButton.Opacity" Value="0" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Medium">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="800" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="rootSplitView.DisplayMode" Value="CompactOverlay" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Narrow" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<SplitView
x:Name="RootSplitView"
Style="{StaticResource MenuSplitViewStyle}"
IsPaneOpen="{Binding DataContext.IsMenuOpen, ElementName=MenuView, Mode=TwoWay}">
<Frame x:Name="ContentFrame" />
<SplitView.Pane>
<views:MenuView x:Name="MenuView"/>
</SplitView.Pane>
</SplitView>
<!-- Declared last to have it rendered above everything else, but it needs to be the first item in the tab sequence. -->
<ToggleButton
x:Name="TogglePaneButton"
Visibility="{Binding DataContext.ShowMenuButton, ElementName=MenuView, Converter={StaticResource BooleanToVisibilityConverter}}"
IsChecked="{Binding IsPaneOpen, ElementName=RootSplitView, Mode=TwoWay}"
Style="{StaticResource SplitViewTogglePaneButtonStyle}"
TabIndex="1" />
</Grid>
</Page>

Просмотреть файл

@ -0,0 +1,28 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace NextcloudApp
{
public sealed partial class AppShell : Page
{
public AppShell()
{
InitializeComponent();
}
public void SetContentFrame(Frame frame)
{
RootSplitView.Content = frame;
}
public void SetMenuPaneContent(UIElement content)
{
RootSplitView.Pane = content;
}
public UIElement GetContentFrame()
{
return RootSplitView.Content;
}
}
}

Двоичные данные
NextcloudApp/Assets/Fonts/nextcloud.ttf Normal file

Двоичный файл не отображается.

Двоичные данные
NextcloudApp/Assets/Images/ThumbnailNotFound.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 444 B

Двоичные данные
NextcloudApp/Assets/LockScreenLogo.scale-200.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 323 B

Двоичные данные
NextcloudApp/Assets/SplashScreen.scale-200.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 8.8 KiB

Двоичные данные
NextcloudApp/Assets/Square150x150Logo.scale-200.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
NextcloudApp/Assets/Square44x44Logo.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 206 B

Двоичные данные
NextcloudApp/Assets/Square44x44Logo.scale-200.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 413 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 206 B

Двоичные данные
NextcloudApp/Assets/StoreLogo.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 311 B

Двоичные данные
NextcloudApp/Assets/Wide310x150Logo.scale-200.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.9 KiB

Просмотреть файл

@ -0,0 +1,61 @@
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Microsoft.Xaml.Interactivity;
namespace NextcloudApp.Behaviors
{
internal class ScrollListBoxToEndBehavior : DependencyObject, IBehavior
{
private FrameworkElement _element;
private ListBox _listBox;
private ObservableCollection<Models.PathInfo> _observable;
public DependencyObject AssociatedObject => _element;
public void Attach(DependencyObject associatedObject)
{
_element = (FrameworkElement)associatedObject;
_listBox = (ListBox)AssociatedObject;
_listBox.DataContextChanged += (sender, args) =>
{
AttachToItemSource();
};
_listBox.Loaded += (sender, args) =>
{
AttachToItemSource();
};
}
private void AttachToItemSource()
{
_observable = _listBox.ItemsSource as ObservableCollection<Models.PathInfo>;
if (_observable != null)
{
_observable.CollectionChanged += ObservableOnCollectionChanged;
}
var scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(_listBox, 0);
scrollViewer?.ChangeView(scrollViewer.ExtentWidth, 0, 1);
}
private void ObservableOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
{
// always scroll path to end
if (VisualTreeHelper.GetChildrenCount(_listBox) <= 0)
{
return;
}
var scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(_listBox, 0);
scrollViewer.ChangeView(scrollViewer.ExtentWidth, 0, 1);
}
public void Detach()
{
if (_observable != null)
{
_observable.CollectionChanged -= ObservableOnCollectionChanged;
}
}
}
}

Просмотреть файл

@ -0,0 +1,3 @@
MainPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\bin\ARM\Release\Upload\NextcloudApp_1.0.0.0_ARM.appx
SymbolPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\AppPackages\NextcloudApp_1.0.0.0\NextcloudApp_1.0.0.0_ARM.appxsym
ResourcePack=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\_language-de.appx

Просмотреть файл

@ -0,0 +1,2 @@
MainPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\bin\x64\Release\Upload\NextcloudApp_1.0.0.0_x64.appx
SymbolPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\AppPackages\NextcloudApp_1.0.0.0\NextcloudApp_1.0.0.0_x64.appxsym

Просмотреть файл

@ -0,0 +1,2 @@
MainPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\bin\x86\Release\Upload\NextcloudApp_1.0.0.0_x86.appx
SymbolPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\AppPackages\NextcloudApp_1.0.0.0\NextcloudApp_1.0.0.0_x86.appxsym

Просмотреть файл

@ -0,0 +1,3 @@
MainPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\bin\ARM\Release\NextcloudApp_1.0.0.0_ARM.appx
SymbolPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\AppPackages\NextcloudApp_1.0.0.0_Test\NextcloudApp_1.0.0.0_ARM.appxsym
ResourcePack=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\bin\ARM\Release\NextcloudApp_1.0.0.0_language-de.appx

Просмотреть файл

@ -0,0 +1,2 @@
MainPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\bin\x64\Release\NextcloudApp_1.0.0.0_x64.appx
SymbolPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\AppPackages\NextcloudApp_1.0.0.0_Test\NextcloudApp_1.0.0.0_x64.appxsym

Просмотреть файл

@ -0,0 +1,2 @@
MainPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\bin\x86\Release\NextcloudApp_1.0.0.0_x86.appx
SymbolPackage=D:\00_Work\99_AFiedler\NextcloudApp\NextcloudApp\AppPackages\NextcloudApp_1.0.0.0_Test\NextcloudApp_1.0.0.0_x86.appxsym

Просмотреть файл

@ -0,0 +1,18 @@
using System;
using Windows.UI.Xaml.Data;
namespace NextcloudApp.Converter
{
public class AddSlashToPathConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return ((string) value).EndsWith("/") ? value : value + "/";
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}

Просмотреть файл

@ -0,0 +1,29 @@
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace NextcloudApp.Converter
{
public class BooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var invert = parameter != null;
if (value is bool && (bool)value)
{
return !invert ? Visibility.Visible : Visibility.Collapsed;
}
return !invert ? Visibility.Collapsed : Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
var invert = parameter != null;
if (value is Visibility && (Visibility)value == Visibility.Visible)
{
return !invert;
}
return invert;
}
}
}

Просмотреть файл

@ -0,0 +1,38 @@
using System;
using Windows.UI.Xaml.Data;
using NextcloudClient.Types;
namespace NextcloudApp.Converter
{
public class BytesToHumanReadableConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var size = decimal.Parse(((long)value).ToString());
string[] sizes = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
var order = 0;
while (size >= 1024m && ++order < sizes.Length)
{
size = size / 1024m;
}
switch (order)
{
case 0:
return string.Format("{0:0} {1}", size, sizes[order]);
case 1:
return string.Format("{0:0.#} {1}", size, sizes[order]);
case 2:
return string.Format("{0:0.##} {1}", size, sizes[order]);
}
return string.Format("{0:0.###} {1}", size, sizes[order]);
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return new ResourceInfo();
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
using System;
using Windows.UI.Xaml.Data;
using NextcloudClient.Types;
namespace NextcloudApp.Converter
{
public class ContentTypeToIconConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var item = (ResourceInfo)value;
return item.ContentType.Equals("dav/directory") ? "\uE8B7" : "\uE8A5";
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return new ResourceInfo();
}
}
}

Просмотреть файл

@ -0,0 +1,45 @@
using System;
using System.Globalization;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace NextcloudApp.Converter
{
internal class DateTimeToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var dt = value as DateTime?;
return dt != null ? dt.Value.ToString(CultureInfo.CurrentCulture) : string.Empty;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
if (value == null || value.ToString().Trim().Length == 0)
{
return null;
}
var s = value.ToString();
if (string.Compare(s, "today", StringComparison.Ordinal) == 0)
{
return DateTime.Today;
}
if (string.Compare(s, "now", StringComparison.Ordinal) == 0)
{
return DateTime.Now;
}
if (string.Compare(s, "yesterday", StringComparison.Ordinal) == 0)
{
return DateTime.Today.AddDays(-1);
}
if (string.Compare(s, "tomorrow", StringComparison.Ordinal) == 0)
{
return DateTime.Today.AddDays(1);
}
DateTime dt;
return DateTime.TryParse(value.ToString(), out dt) ? dt : DependencyProperty.UnsetValue;
}
}
}

Просмотреть файл

@ -0,0 +1,18 @@
using System;
using Windows.UI.Xaml.Data;
namespace NextcloudApp.Converter
{
public class EmptyPathToSlashConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return string.IsNullOrEmpty((string) value) ? "/" : value;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return (string) value == "/" ? "" : value;
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace NextcloudApp.Converter
{
public class IntToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var number = int.Parse(value.ToString());
return number == 0 ? Visibility.Collapsed : Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return null;
}
}
}

Просмотреть файл

@ -0,0 +1,21 @@
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using NextcloudClient.Types;
namespace NextcloudApp.Converter
{
public class IsFileAndNotFolderToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var item = (ResourceInfo)value;
return item.ContentType.Equals("dav/directory") ? Visibility.Collapsed : Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return new ResourceInfo();
}
}
}

Просмотреть файл

@ -0,0 +1,30 @@
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
namespace NextcloudApp.Converter
{
public class IsSortingToSelectionModeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var invert = parameter != null;
if (value is bool && (bool)value)
{
return !invert ? ListViewSelectionMode.None : ListViewSelectionMode.Single;
}
return !invert ? ListViewSelectionMode.Single : ListViewSelectionMode.None;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
var invert = parameter != null;
if (value is ListViewSelectionMode && (ListViewSelectionMode)value == ListViewSelectionMode.None)
{
return !invert;
}
return invert;
}
}
}

Просмотреть файл

@ -0,0 +1,22 @@
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace NextcloudApp.Converter
{
public class NullToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var invert = parameter != null;
return value == null
? (invert ? Visibility.Visible : Visibility.Collapsed)
: (invert ? Visibility.Collapsed : Visibility.Visible);
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
using NextcloudClient.Types;
namespace NextcloudApp.Models
{
public class FileInfoPageParameters : PageParameters<FileInfoPageParameters>
{
public ResourceInfo ResourceInfo { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,48 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Windows.UI.Xaml.Media.Imaging;
using NextcloudApp.Annotations;
using NextcloudClient.Types;
namespace NextcloudApp.Models
{
public class FileOrFolder : ResourceInfo, INotifyPropertyChanged
{
private BitmapImage _thumbnail;
public FileOrFolder(ResourceInfo item)
{
Name = item.Name;
Path = item.Path;
Size = item.Size;
ETag = item.ETag;
ContentType = item.ContentType;
LastModified = item.LastModified;
Created = item.Created;
QuotaUsed = item.QuotaUsed;
QuotaAvailable = item.QuotaAvailable;
}
public BitmapImage Thumbnail
{
get { return _thumbnail; }
set
{
if (_thumbnail == value)
{
return;
}
_thumbnail = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

Просмотреть файл

@ -0,0 +1,11 @@
using Windows.Storage.Pickers;
using NextcloudClient.Types;
namespace NextcloudApp.Models
{
public class FileUploadPageParameters : PageParameters<FileUploadPageParameters>
{
public ResourceInfo ResourceInfo { get; set; }
public PickerLocationId PickerLocationId { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,19 @@
using System.Windows.Input;
using NextcloudApp.ViewModels;
namespace NextcloudApp.Models
{
public class MenuItem : ViewModel
{
public string DisplayName { get; set; }
public string FontIcon { get; set; }
public ICommand Command { get; set; }
public override string ToString()
{
return DisplayName;
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
using Newtonsoft.Json;
namespace NextcloudApp.Models
{
public class PageParameters<T> where T : class
{
public string Serialize()
{
return JsonConvert.SerializeObject(this);
}
public static T Deserialize(object json)
{
var parameters = json as string;
return string.IsNullOrEmpty(parameters)
? null
: JsonConvert.DeserializeObject<T>(parameters);
}
}
}

Просмотреть файл

@ -0,0 +1,11 @@
using NextcloudClient.Types;
namespace NextcloudApp.Models
{
public class PathInfo
{
public ResourceInfo ResourceInfo { get; set; }
public bool IsRoot { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,33 @@
using NextcloudApp.Utils;
namespace NextcloudApp.Models
{
public class PreviewImageDownloadModeItem
{
public string Name { get; set; }
public PreviewImageDownloadMode Value { get; set; }
public override string ToString()
{
return Name;
}
public override bool Equals(object obj)
{
return obj as PreviewImageDownloadMode? == Value;
}
protected bool Equals(PreviewImageDownloadModeItem other)
{
return Value == other.Value;
}
public override int GetHashCode()
{
unchecked
{
return ((Name?.GetHashCode() ?? 0)*397) ^ (int) Value;
}
}
}
}

Просмотреть файл

@ -0,0 +1,153 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using NextcloudApp.Annotations;
using NextcloudApp.Utils;
namespace NextcloudApp.Models
{
public class Settings : INotifyPropertyChanged
{
private string _serverAddress;
private string _username;
private string _password;
private bool _showFileAndFolderGroupingHeader = true;
private PreviewImageDownloadMode _previewImageDownloadMode = PreviewImageDownloadMode.Always;
private int _appTotalRuns;
private string _appRunsAfterLastUpdateVersion;
private int _appRunsAfterLastUpdate;
public string ServerAddress
{
get { return _serverAddress; }
set
{
if (value == null)
{
value = "";
}
if (_serverAddress == value)
{
return;
}
_serverAddress = value;
OnPropertyChanged();
}
}
public string Username
{
get { return _username; }
set
{
if (value == null)
{
value = "";
}
if (_username == value)
{
return;
}
_username = value;
OnPropertyChanged();
}
}
public string Password
{
get { return _password; }
set
{
if (value == null)
{
value = "";
}
if (_password == value)
{
return;
}
_password = value;
OnPropertyChanged();
}
}
public bool ShowFileAndFolderGroupingHeader
{
get { return _showFileAndFolderGroupingHeader; }
set
{
if (_showFileAndFolderGroupingHeader == value)
{
return;
}
_showFileAndFolderGroupingHeader = value;
OnPropertyChanged();
}
}
public PreviewImageDownloadMode PreviewImageDownloadMode
{
get { return _previewImageDownloadMode; }
set
{
if (_previewImageDownloadMode == value)
{
return;
}
_previewImageDownloadMode = value;
OnPropertyChanged();
}
}
public int AppTotalRuns
{
get { return _appTotalRuns; }
set
{
if (_appTotalRuns == value)
{
return;
}
_appTotalRuns = value;
OnPropertyChanged();
}
}
public string AppRunsAfterLastUpdateVersion
{
get { return _appRunsAfterLastUpdateVersion; }
set
{
if (value == null)
{
value = "";
}
if (_appRunsAfterLastUpdateVersion == value)
{
return;
}
_appRunsAfterLastUpdateVersion = value;
OnPropertyChanged();
}
}
public int AppRunsAfterLastUpdate
{
get { return _appRunsAfterLastUpdate; }
set
{
if (_appRunsAfterLastUpdate == value)
{
return;
}
_appRunsAfterLastUpdate = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
using NextcloudClient.Types;
namespace NextcloudApp.Models
{
public class SingleFileDownloadPageParameters : PageParameters<SingleFileDownloadPageParameters>
{
public ResourceInfo ResourceInfo { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">
<NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
</PropertyGroup>
<ImportGroup>
<Import Project="$(NuGetPackageRoot)\Microsoft.Bcl.Build\1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('$(NuGetPackageRoot)\Microsoft.Bcl.Build\1.0.21\build\Microsoft.Bcl.Build.targets')" />
</ImportGroup>
</Project>

Просмотреть файл

@ -0,0 +1,288 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{99EFB7EA-88A3-4FCF-9289-22734215B5CF}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NextcloudApp</RootNamespace>
<AssemblyName>NextcloudApp</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>NextcloudApp_StoreKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>FF3446F276329AC954729FBEA0FCDCB5FBBCB7A3</PackageCertificateThumbprint>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<Content Include="Assets\Fonts\nextcloud.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="NextcloudApp_StoreKey.pfx" />
<None Include="project.json" />
<PRIResource Include="Strings\de-DE\Resources.resw" />
<PRIResource Include="Strings\en-US\Resources.resw" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="AppShell.xaml.cs">
<DependentUpon>AppShell.xaml</DependentUpon>
</Compile>
<Compile Include="Actions\OpenMenuFlyoutAction.cs" />
<Compile Include="Behaviors\ScrollListBoxToEndBehavior.cs" />
<Compile Include="Converter\AddSlashToPathConverter.cs" />
<Compile Include="Converter\IsSortingToSelectionModeConverter.cs" />
<Compile Include="Converter\EmptyPathToSlashConverter.cs" />
<Compile Include="Models\PageParameters.cs" />
<Compile Include="Models\SingleFileDownloadPageParameters.cs" />
<Compile Include="Models\FileUploadPageParameters.cs" />
<Compile Include="Models\FileInfoPageParameters.cs" />
<Compile Include="Models\PreviewImageDownloadModeItem.cs" />
<Compile Include="Services\ClientService.cs" />
<Compile Include="Services\DialogService.cs" />
<Compile Include="Services\DirectoryService.cs" />
<Compile Include="Services\ExceptionReportService.cs" />
<Compile Include="Services\ResponseErrorHandlerService.cs" />
<Compile Include="Utils\PreviewImageDownloadMode.cs" />
<Compile Include="Utils\RelayCommand.cs" />
<Compile Include="Utils\SizeSorter.cs" />
<Compile Include="Converter\NullToVisibilityConverter.cs" />
<Compile Include="Converter\IsFileAndNotFolderToVisibilityConverter.cs" />
<Compile Include="Converter\IntToVisibilityConverter.cs" />
<Compile Include="Converter\BooleanToVisibilityConverter.cs" />
<Compile Include="Converter\BytesToHumanReadableConverter.cs" />
<Compile Include="Converter\ContentTypeToIconConverter.cs" />
<Compile Include="Converter\DateTimeToStringConverter.cs" />
<Compile Include="Models\FileOrFolder.cs" />
<Compile Include="Models\PathInfo.cs" />
<Compile Include="Models\Settings.cs" />
<Compile Include="PageTokens.cs" />
<Compile Include="Properties\Annotations.cs" />
<Compile Include="Services\LocalizationService.cs" />
<Compile Include="Services\SettingsService.cs" />
<Compile Include="Services\StatusBarService.cs" />
<Compile Include="Utils\Grouping.cs" />
<Compile Include="Utils\IRevertState.cs" />
<Compile Include="Utils\DateSorter.cs" />
<Compile Include="Utils\NameSorter.cs" />
<Compile Include="Utils\ObservableGroupingCollection.cs" />
<Compile Include="Utils\SortMode.cs" />
<Compile Include="ViewModels\FileUploadPageViewModel.cs" />
<Compile Include="ViewModels\SingleFileDownloadPageViewModel.cs" />
<Compile Include="ViewModels\FileInfoPageViewModel.cs" />
<Compile Include="ViewModels\SettingsPageViewModel.cs" />
<Compile Include="ViewModels\DirectoryListPageViewModel.cs" />
<Compile Include="ViewModels\ViewModel.cs" />
<Compile Include="Views\FileUploadPage.xaml.cs">
<DependentUpon>FileUploadPage.xaml</DependentUpon>
</Compile>
<Compile Include="Views\SingleFileDownloadPage.xaml.cs">
<DependentUpon>SingleFileDownloadPage.xaml</DependentUpon>
</Compile>
<Compile Include="Views\FileInfoPage.xaml.cs">
<DependentUpon>FileInfoPage.xaml</DependentUpon>
</Compile>
<Compile Include="Views\SettingsPage.xaml.cs">
<DependentUpon>SettingsPage.xaml</DependentUpon>
</Compile>
<Compile Include="Views\DirectoryListPage.xaml.cs">
<DependentUpon>DirectoryListPage.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\LoginPageViewModel.cs" />
<Compile Include="Models\MenuItem.cs" />
<Compile Include="ViewModels\MenuViewModel.cs" />
<Compile Include="Views\LoginPage.xaml.cs">
<DependentUpon>LoginPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Views\MenuView.xaml.cs">
<DependentUpon>MenuView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="Nextcloud_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Images\ThumbnailNotFound.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Package.StoreAssociation.xml" />
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="AppShell.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Fonts.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\MenuFlyoutIconItemStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\SplitViewStyles.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\FileUploadPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\SingleFileDownloadPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\FileInfoPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\SettingsPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\DirectoryListPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\LoginPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MenuView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NextcloudClient\NextcloudClient.csproj">
<Project>{E2015378-CEFF-4913-A4A6-48706F2625D4}</Project>
<Name>NextcloudClient</Name>
</ProjectReference>
<ProjectReference Include="..\WebDavClient\WebDavClient\WebDavClient.csproj">
<Project>{4AD0BDDE-D9AF-49F8-912C-4B6970CBE1BA}</Project>
<Name>WebDavClient</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Controls\" />
<Folder Include="SampleData\" />
</ItemGroup>
<ItemGroup>
<SDKReference Include="BehaviorsXamlSDKManaged, Version=12.0">
<Name>Behaviors SDK %28XAML%29</Name>
</SDKReference>
<SDKReference Include="WindowsMobile, Version=10.0.10586.0">
<Name>Windows Mobile Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<SkipValidatePackageReferences>true</SkipValidatePackageReferences>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">
<NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
</PropertyGroup>
<ImportGroup>
<Import Project="$(NuGetPackageRoot)\Microsoft.Bcl.Build\1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('$(NuGetPackageRoot)\Microsoft.Bcl.Build\1.0.21\build\Microsoft.Bcl.Build.targets')" />
</ImportGroup>
</Project>

Двоичные данные
NextcloudApp/NextcloudApp_StoreKey.pfx Normal file

Двоичный файл не отображается.

Двоичные данные
NextcloudApp/Nextcloud_TemporaryKey.pfx Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,368 @@
<?xml version="1.0" encoding="utf-8"?>
<StoreAssociation xmlns="http://schemas.microsoft.com/appx/2010/storeassociation">
<Publisher>CN=917F995D-B866-486B-AAD5-A2B63E22FF51</Publisher>
<PublisherDisplayName>André Fiedler</PublisherDisplayName>
<GeneratePackageHash>http://www.w3.org/2001/04/xmlenc#sha256</GeneratePackageHash>
<SupportedLocales>
<Language Code="af" InMinimumRequirementSet="true" />
<Language Code="af-za" InMinimumRequirementSet="true" />
<Language Code="am" InMinimumRequirementSet="true" />
<Language Code="am-et" InMinimumRequirementSet="true" />
<Language Code="ar" InMinimumRequirementSet="true" />
<Language Code="ar-ae" InMinimumRequirementSet="true" />
<Language Code="ar-bh" InMinimumRequirementSet="true" />
<Language Code="ar-dz" InMinimumRequirementSet="true" />
<Language Code="ar-eg" InMinimumRequirementSet="true" />
<Language Code="ar-iq" InMinimumRequirementSet="true" />
<Language Code="ar-jo" InMinimumRequirementSet="true" />
<Language Code="ar-kw" InMinimumRequirementSet="true" />
<Language Code="ar-lb" InMinimumRequirementSet="true" />
<Language Code="ar-ly" InMinimumRequirementSet="true" />
<Language Code="ar-ma" InMinimumRequirementSet="true" />
<Language Code="ar-om" InMinimumRequirementSet="true" />
<Language Code="ar-qa" InMinimumRequirementSet="true" />
<Language Code="ar-sa" InMinimumRequirementSet="true" />
<Language Code="ar-sy" InMinimumRequirementSet="true" />
<Language Code="ar-tn" InMinimumRequirementSet="true" />
<Language Code="ar-ye" InMinimumRequirementSet="true" />
<Language Code="as" InMinimumRequirementSet="true" />
<Language Code="as-in" InMinimumRequirementSet="true" />
<Language Code="az" InMinimumRequirementSet="true" />
<Language Code="az-arab" InMinimumRequirementSet="true" />
<Language Code="az-arab-az" InMinimumRequirementSet="true" />
<Language Code="az-cyrl" InMinimumRequirementSet="true" />
<Language Code="az-cyrl-az" InMinimumRequirementSet="true" />
<Language Code="az-latn" InMinimumRequirementSet="true" />
<Language Code="az-latn-az" InMinimumRequirementSet="true" />
<Language Code="be" InMinimumRequirementSet="true" />
<Language Code="be-by" InMinimumRequirementSet="true" />
<Language Code="bg" InMinimumRequirementSet="true" />
<Language Code="bg-bg" InMinimumRequirementSet="true" />
<Language Code="bn" InMinimumRequirementSet="true" />
<Language Code="bn-bd" InMinimumRequirementSet="true" />
<Language Code="bn-in" InMinimumRequirementSet="true" />
<Language Code="bs" InMinimumRequirementSet="true" />
<Language Code="bs-cyrl" InMinimumRequirementSet="true" />
<Language Code="bs-cyrl-ba" InMinimumRequirementSet="true" />
<Language Code="bs-latn" InMinimumRequirementSet="true" />
<Language Code="bs-latn-ba" InMinimumRequirementSet="true" />
<Language Code="ca" InMinimumRequirementSet="true" />
<Language Code="ca-es" InMinimumRequirementSet="true" />
<Language Code="ca-es-valencia" InMinimumRequirementSet="true" />
<Language Code="chr-cher" InMinimumRequirementSet="true" />
<Language Code="chr-cher-us" InMinimumRequirementSet="true" />
<Language Code="chr-latn" InMinimumRequirementSet="true" />
<Language Code="cs" InMinimumRequirementSet="true" />
<Language Code="cs-cz" InMinimumRequirementSet="true" />
<Language Code="cy" InMinimumRequirementSet="true" />
<Language Code="cy-gb" InMinimumRequirementSet="true" />
<Language Code="da" InMinimumRequirementSet="true" />
<Language Code="da-dk" InMinimumRequirementSet="true" />
<Language Code="de" InMinimumRequirementSet="true" />
<Language Code="de-at" InMinimumRequirementSet="true" />
<Language Code="de-ch" InMinimumRequirementSet="true" />
<Language Code="de-de" InMinimumRequirementSet="true" />
<Language Code="de-li" InMinimumRequirementSet="true" />
<Language Code="de-lu" InMinimumRequirementSet="true" />
<Language Code="el" InMinimumRequirementSet="true" />
<Language Code="el-gr" InMinimumRequirementSet="true" />
<Language Code="en" InMinimumRequirementSet="true" />
<Language Code="en-011" InMinimumRequirementSet="true" />
<Language Code="en-014" InMinimumRequirementSet="true" />
<Language Code="en-018" InMinimumRequirementSet="true" />
<Language Code="en-021" InMinimumRequirementSet="true" />
<Language Code="en-029" InMinimumRequirementSet="true" />
<Language Code="en-053" InMinimumRequirementSet="true" />
<Language Code="en-au" InMinimumRequirementSet="true" />
<Language Code="en-bz" InMinimumRequirementSet="true" />
<Language Code="en-ca" InMinimumRequirementSet="true" />
<Language Code="en-gb" InMinimumRequirementSet="true" />
<Language Code="en-hk" InMinimumRequirementSet="true" />
<Language Code="en-id" InMinimumRequirementSet="true" />
<Language Code="en-ie" InMinimumRequirementSet="true" />
<Language Code="en-in" InMinimumRequirementSet="true" />
<Language Code="en-jm" InMinimumRequirementSet="true" />
<Language Code="en-kz" InMinimumRequirementSet="true" />
<Language Code="en-mt" InMinimumRequirementSet="true" />
<Language Code="en-my" InMinimumRequirementSet="true" />
<Language Code="en-nz" InMinimumRequirementSet="true" />
<Language Code="en-ph" InMinimumRequirementSet="true" />
<Language Code="en-pk" InMinimumRequirementSet="true" />
<Language Code="en-sg" InMinimumRequirementSet="true" />
<Language Code="en-tt" InMinimumRequirementSet="true" />
<Language Code="en-us" InMinimumRequirementSet="true" />
<Language Code="en-vn" InMinimumRequirementSet="true" />
<Language Code="en-za" InMinimumRequirementSet="true" />
<Language Code="en-zw" InMinimumRequirementSet="true" />
<Language Code="es" InMinimumRequirementSet="true" />
<Language Code="es-019" InMinimumRequirementSet="true" />
<Language Code="es-419" InMinimumRequirementSet="true" />
<Language Code="es-ar" InMinimumRequirementSet="true" />
<Language Code="es-bo" InMinimumRequirementSet="true" />
<Language Code="es-cl" InMinimumRequirementSet="true" />
<Language Code="es-co" InMinimumRequirementSet="true" />
<Language Code="es-cr" InMinimumRequirementSet="true" />
<Language Code="es-do" InMinimumRequirementSet="true" />
<Language Code="es-ec" InMinimumRequirementSet="true" />
<Language Code="es-es" InMinimumRequirementSet="true" />
<Language Code="es-gt" InMinimumRequirementSet="true" />
<Language Code="es-hn" InMinimumRequirementSet="true" />
<Language Code="es-mx" InMinimumRequirementSet="true" />
<Language Code="es-ni" InMinimumRequirementSet="true" />
<Language Code="es-pa" InMinimumRequirementSet="true" />
<Language Code="es-pe" InMinimumRequirementSet="true" />
<Language Code="es-pr" InMinimumRequirementSet="true" />
<Language Code="es-py" InMinimumRequirementSet="true" />
<Language Code="es-sv" InMinimumRequirementSet="true" />
<Language Code="es-us" InMinimumRequirementSet="true" />
<Language Code="es-uy" InMinimumRequirementSet="true" />
<Language Code="es-ve" InMinimumRequirementSet="true" />
<Language Code="et" InMinimumRequirementSet="true" />
<Language Code="et-ee" InMinimumRequirementSet="true" />
<Language Code="eu" InMinimumRequirementSet="true" />
<Language Code="eu-es" InMinimumRequirementSet="true" />
<Language Code="fa" InMinimumRequirementSet="true" />
<Language Code="fa-ir" InMinimumRequirementSet="true" />
<Language Code="fi" InMinimumRequirementSet="true" />
<Language Code="fi-fi" InMinimumRequirementSet="true" />
<Language Code="fil" InMinimumRequirementSet="true" />
<Language Code="fil-latn" InMinimumRequirementSet="true" />
<Language Code="fil-ph" InMinimumRequirementSet="true" />
<Language Code="fr" InMinimumRequirementSet="true" />
<Language Code="fr-011" InMinimumRequirementSet="true" />
<Language Code="fr-015" InMinimumRequirementSet="true" />
<Language Code="fr-021" InMinimumRequirementSet="true" />
<Language Code="fr-029" InMinimumRequirementSet="true" />
<Language Code="fr-155" InMinimumRequirementSet="true" />
<Language Code="fr-be" InMinimumRequirementSet="true" />
<Language Code="fr-ca" InMinimumRequirementSet="true" />
<Language Code="fr-cd" InMinimumRequirementSet="true" />
<Language Code="fr-ch" InMinimumRequirementSet="true" />
<Language Code="fr-ci" InMinimumRequirementSet="true" />
<Language Code="fr-cm" InMinimumRequirementSet="true" />
<Language Code="fr-fr" InMinimumRequirementSet="true" />
<Language Code="fr-ht" InMinimumRequirementSet="true" />
<Language Code="fr-lu" InMinimumRequirementSet="true" />
<Language Code="fr-ma" InMinimumRequirementSet="true" />
<Language Code="fr-mc" InMinimumRequirementSet="true" />
<Language Code="fr-ml" InMinimumRequirementSet="true" />
<Language Code="fr-re" InMinimumRequirementSet="true" />
<Language Code="frc-latn" InMinimumRequirementSet="true" />
<Language Code="frp-latn" InMinimumRequirementSet="true" />
<Language Code="ga" InMinimumRequirementSet="true" />
<Language Code="ga-ie" InMinimumRequirementSet="true" />
<Language Code="gd-gb" InMinimumRequirementSet="true" />
<Language Code="gd-latn" InMinimumRequirementSet="true" />
<Language Code="gl" InMinimumRequirementSet="true" />
<Language Code="gl-es" InMinimumRequirementSet="true" />
<Language Code="gu" InMinimumRequirementSet="true" />
<Language Code="gu-in" InMinimumRequirementSet="true" />
<Language Code="ha" InMinimumRequirementSet="true" />
<Language Code="ha-latn" InMinimumRequirementSet="true" />
<Language Code="ha-latn-ng" InMinimumRequirementSet="true" />
<Language Code="he" InMinimumRequirementSet="true" />
<Language Code="he-il" InMinimumRequirementSet="true" />
<Language Code="hi" InMinimumRequirementSet="true" />
<Language Code="hi-in" InMinimumRequirementSet="true" />
<Language Code="hr" InMinimumRequirementSet="true" />
<Language Code="hr-ba" InMinimumRequirementSet="true" />
<Language Code="hr-hr" InMinimumRequirementSet="true" />
<Language Code="hu" InMinimumRequirementSet="true" />
<Language Code="hu-hu" InMinimumRequirementSet="true" />
<Language Code="hy" InMinimumRequirementSet="true" />
<Language Code="hy-am" InMinimumRequirementSet="true" />
<Language Code="id" InMinimumRequirementSet="true" />
<Language Code="id-id" InMinimumRequirementSet="true" />
<Language Code="ig-latn" InMinimumRequirementSet="true" />
<Language Code="ig-ng" InMinimumRequirementSet="true" />
<Language Code="is" InMinimumRequirementSet="true" />
<Language Code="is-is" InMinimumRequirementSet="true" />
<Language Code="it" InMinimumRequirementSet="true" />
<Language Code="it-ch" InMinimumRequirementSet="true" />
<Language Code="it-it" InMinimumRequirementSet="true" />
<Language Code="iu-cans" InMinimumRequirementSet="true" />
<Language Code="iu-latn" InMinimumRequirementSet="true" />
<Language Code="iu-latn-ca" InMinimumRequirementSet="true" />
<Language Code="ja" InMinimumRequirementSet="true" />
<Language Code="ja-jp" InMinimumRequirementSet="true" />
<Language Code="ka" InMinimumRequirementSet="true" />
<Language Code="ka-ge" InMinimumRequirementSet="true" />
<Language Code="kk" InMinimumRequirementSet="true" />
<Language Code="kk-kz" InMinimumRequirementSet="true" />
<Language Code="km" InMinimumRequirementSet="true" />
<Language Code="km-kh" InMinimumRequirementSet="true" />
<Language Code="kn" InMinimumRequirementSet="true" />
<Language Code="kn-in" InMinimumRequirementSet="true" />
<Language Code="ko" InMinimumRequirementSet="true" />
<Language Code="ko-kr" InMinimumRequirementSet="true" />
<Language Code="kok" InMinimumRequirementSet="true" />
<Language Code="kok-in" InMinimumRequirementSet="true" />
<Language Code="ku-arab" InMinimumRequirementSet="true" />
<Language Code="ku-arab-iq" InMinimumRequirementSet="true" />
<Language Code="ky-cyrl" InMinimumRequirementSet="true" />
<Language Code="ky-kg" InMinimumRequirementSet="true" />
<Language Code="lb" InMinimumRequirementSet="true" />
<Language Code="lb-lu" InMinimumRequirementSet="true" />
<Language Code="lo" InMinimumRequirementSet="true" />
<Language Code="lo-la" InMinimumRequirementSet="true" />
<Language Code="lt" InMinimumRequirementSet="true" />
<Language Code="lt-lt" InMinimumRequirementSet="true" />
<Language Code="lv" InMinimumRequirementSet="true" />
<Language Code="lv-lv" InMinimumRequirementSet="true" />
<Language Code="mi" InMinimumRequirementSet="true" />
<Language Code="mi-latn" InMinimumRequirementSet="true" />
<Language Code="mi-nz" InMinimumRequirementSet="true" />
<Language Code="mk" InMinimumRequirementSet="true" />
<Language Code="mk-mk" InMinimumRequirementSet="true" />
<Language Code="ml" InMinimumRequirementSet="true" />
<Language Code="ml-in" InMinimumRequirementSet="true" />
<Language Code="mn-cyrl" InMinimumRequirementSet="true" />
<Language Code="mn-mn" InMinimumRequirementSet="true" />
<Language Code="mn-mong" InMinimumRequirementSet="true" />
<Language Code="mn-phag" InMinimumRequirementSet="true" />
<Language Code="mr" InMinimumRequirementSet="true" />
<Language Code="mr-in" InMinimumRequirementSet="true" />
<Language Code="ms" InMinimumRequirementSet="true" />
<Language Code="ms-bn" InMinimumRequirementSet="true" />
<Language Code="ms-my" InMinimumRequirementSet="true" />
<Language Code="mt" InMinimumRequirementSet="true" />
<Language Code="mt-mt" InMinimumRequirementSet="true" />
<Language Code="nb" InMinimumRequirementSet="true" />
<Language Code="nb-no" InMinimumRequirementSet="true" />
<Language Code="ne" InMinimumRequirementSet="true" />
<Language Code="ne-np" InMinimumRequirementSet="true" />
<Language Code="nl" InMinimumRequirementSet="true" />
<Language Code="nl-be" InMinimumRequirementSet="true" />
<Language Code="nl-nl" InMinimumRequirementSet="true" />
<Language Code="nn" InMinimumRequirementSet="true" />
<Language Code="nn-no" InMinimumRequirementSet="true" />
<Language Code="no" InMinimumRequirementSet="true" />
<Language Code="no-no" InMinimumRequirementSet="true" />
<Language Code="nso" InMinimumRequirementSet="true" />
<Language Code="nso-za" InMinimumRequirementSet="true" />
<Language Code="or" InMinimumRequirementSet="true" />
<Language Code="or-in" InMinimumRequirementSet="true" />
<Language Code="pa" InMinimumRequirementSet="true" />
<Language Code="pa-arab" InMinimumRequirementSet="true" />
<Language Code="pa-arab-pk" InMinimumRequirementSet="true" />
<Language Code="pa-deva" InMinimumRequirementSet="true" />
<Language Code="pa-in" InMinimumRequirementSet="true" />
<Language Code="pl" InMinimumRequirementSet="true" />
<Language Code="pl-pl" InMinimumRequirementSet="true" />
<Language Code="prs" InMinimumRequirementSet="true" />
<Language Code="prs-af" InMinimumRequirementSet="true" />
<Language Code="prs-arab" InMinimumRequirementSet="true" />
<Language Code="pt" InMinimumRequirementSet="true" />
<Language Code="pt-br" InMinimumRequirementSet="true" />
<Language Code="pt-pt" InMinimumRequirementSet="true" />
<Language Code="quc-latn" InMinimumRequirementSet="true" />
<Language Code="qut-gt" InMinimumRequirementSet="true" />
<Language Code="qut-latn" InMinimumRequirementSet="true" />
<Language Code="quz" InMinimumRequirementSet="true" />
<Language Code="quz-bo" InMinimumRequirementSet="true" />
<Language Code="quz-ec" InMinimumRequirementSet="true" />
<Language Code="quz-pe" InMinimumRequirementSet="true" />
<Language Code="ro" InMinimumRequirementSet="true" />
<Language Code="ro-ro" InMinimumRequirementSet="true" />
<Language Code="ru" InMinimumRequirementSet="true" />
<Language Code="ru-ru" InMinimumRequirementSet="true" />
<Language Code="rw" InMinimumRequirementSet="true" />
<Language Code="rw-rw" InMinimumRequirementSet="true" />
<Language Code="sd-arab" InMinimumRequirementSet="true" />
<Language Code="sd-arab-pk" InMinimumRequirementSet="true" />
<Language Code="sd-deva" InMinimumRequirementSet="true" />
<Language Code="si" InMinimumRequirementSet="true" />
<Language Code="si-lk" InMinimumRequirementSet="true" />
<Language Code="sk" InMinimumRequirementSet="true" />
<Language Code="sk-sk" InMinimumRequirementSet="true" />
<Language Code="sl" InMinimumRequirementSet="true" />
<Language Code="sl-si" InMinimumRequirementSet="true" />
<Language Code="sq" InMinimumRequirementSet="true" />
<Language Code="sq-al" InMinimumRequirementSet="true" />
<Language Code="sr" InMinimumRequirementSet="true" />
<Language Code="sr-cyrl" InMinimumRequirementSet="true" />
<Language Code="sr-cyrl-ba" InMinimumRequirementSet="true" />
<Language Code="sr-cyrl-cs" InMinimumRequirementSet="true" />
<Language Code="sr-cyrl-me" InMinimumRequirementSet="true" />
<Language Code="sr-cyrl-rs" InMinimumRequirementSet="true" />
<Language Code="sr-latn" InMinimumRequirementSet="true" />
<Language Code="sr-latn-ba" InMinimumRequirementSet="true" />
<Language Code="sr-latn-cs" InMinimumRequirementSet="true" />
<Language Code="sr-latn-me" InMinimumRequirementSet="true" />
<Language Code="sr-latn-rs" InMinimumRequirementSet="true" />
<Language Code="sv" InMinimumRequirementSet="true" />
<Language Code="sv-fi" InMinimumRequirementSet="true" />
<Language Code="sv-se" InMinimumRequirementSet="true" />
<Language Code="sw" InMinimumRequirementSet="true" />
<Language Code="sw-ke" InMinimumRequirementSet="true" />
<Language Code="ta" InMinimumRequirementSet="true" />
<Language Code="ta-in" InMinimumRequirementSet="true" />
<Language Code="te" InMinimumRequirementSet="true" />
<Language Code="te-in" InMinimumRequirementSet="true" />
<Language Code="tg-arab" InMinimumRequirementSet="true" />
<Language Code="tg-cyrl" InMinimumRequirementSet="true" />
<Language Code="tg-cyrl-tj" InMinimumRequirementSet="true" />
<Language Code="tg-latn" InMinimumRequirementSet="true" />
<Language Code="th" InMinimumRequirementSet="true" />
<Language Code="th-th" InMinimumRequirementSet="true" />
<Language Code="ti" InMinimumRequirementSet="true" />
<Language Code="ti-et" InMinimumRequirementSet="true" />
<Language Code="tk-cyrl" InMinimumRequirementSet="true" />
<Language Code="tk-cyrl-tr" InMinimumRequirementSet="true" />
<Language Code="tk-latn" InMinimumRequirementSet="true" />
<Language Code="tk-latn-tr" InMinimumRequirementSet="true" />
<Language Code="tk-tm" InMinimumRequirementSet="true" />
<Language Code="tn" InMinimumRequirementSet="true" />
<Language Code="tn-bw" InMinimumRequirementSet="true" />
<Language Code="tn-za" InMinimumRequirementSet="true" />
<Language Code="tr" InMinimumRequirementSet="true" />
<Language Code="tr-tr" InMinimumRequirementSet="true" />
<Language Code="tt-arab" InMinimumRequirementSet="true" />
<Language Code="tt-cyrl" InMinimumRequirementSet="true" />
<Language Code="tt-latn" InMinimumRequirementSet="true" />
<Language Code="tt-ru" InMinimumRequirementSet="true" />
<Language Code="ug-arab" InMinimumRequirementSet="true" />
<Language Code="ug-cn" InMinimumRequirementSet="true" />
<Language Code="ug-cyrl" InMinimumRequirementSet="true" />
<Language Code="ug-latn" InMinimumRequirementSet="true" />
<Language Code="uk" InMinimumRequirementSet="true" />
<Language Code="uk-ua" InMinimumRequirementSet="true" />
<Language Code="ur" InMinimumRequirementSet="true" />
<Language Code="ur-pk" InMinimumRequirementSet="true" />
<Language Code="uz" InMinimumRequirementSet="true" />
<Language Code="uz-cyrl" InMinimumRequirementSet="true" />
<Language Code="uz-latn" InMinimumRequirementSet="true" />
<Language Code="uz-latn-uz" InMinimumRequirementSet="true" />
<Language Code="vi" InMinimumRequirementSet="true" />
<Language Code="vi-vn" InMinimumRequirementSet="true" />
<Language Code="wo" InMinimumRequirementSet="true" />
<Language Code="wo-sn" InMinimumRequirementSet="true" />
<Language Code="xh" InMinimumRequirementSet="true" />
<Language Code="xh-za" InMinimumRequirementSet="true" />
<Language Code="yo-latn" InMinimumRequirementSet="true" />
<Language Code="yo-ng" InMinimumRequirementSet="true" />
<Language Code="zh" InMinimumRequirementSet="true" />
<Language Code="zh-cn" InMinimumRequirementSet="true" />
<Language Code="zh-hans" InMinimumRequirementSet="true" />
<Language Code="zh-hans-cn" InMinimumRequirementSet="true" />
<Language Code="zh-hans-sg" InMinimumRequirementSet="true" />
<Language Code="zh-hant" InMinimumRequirementSet="true" />
<Language Code="zh-hant-hk" InMinimumRequirementSet="true" />
<Language Code="zh-hant-mo" InMinimumRequirementSet="true" />
<Language Code="zh-hant-tw" InMinimumRequirementSet="true" />
<Language Code="zh-hk" InMinimumRequirementSet="true" />
<Language Code="zh-mo" InMinimumRequirementSet="true" />
<Language Code="zh-sg" InMinimumRequirementSet="true" />
<Language Code="zh-tw" InMinimumRequirementSet="true" />
<Language Code="zu" InMinimumRequirementSet="true" />
<Language Code="zu-za" InMinimumRequirementSet="true" />
</SupportedLocales>
<ProductReservedInfo>
<MainPackageIdentityName>36131AndrFiedler.NextcloudApp</MainPackageIdentityName>
<ReservedNames>
<ReservedName>Nextcloud App</ReservedName>
</ReservedNames>
</ProductReservedInfo>
<AccountPackageIdentityNames />
<PackageInfoList LandingUrl="https://developer.microsoft.com/dashboard/Application?appId=9NBLGGH532XQ" />
</StoreAssociation>

Просмотреть файл

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="36131AndrFiedler.NextcloudApp" Publisher="CN=917F995D-B866-486B-AAD5-A2B63E22FF51" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="6cfb0110-8cde-4e3f-9aab-0c54e98b3b3d" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Nextcloud App</DisplayName>
<PublisherDisplayName>André Fiedler</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Nextcloud.App">
<uap:VisualElements DisplayName="Nextcloud App" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Nextcloud App" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="#0082C9" />
<uap:InitialRotationPreference>
<uap:Rotation Preference="portrait" />
<uap:Rotation Preference="landscape" />
<uap:Rotation Preference="portraitFlipped" />
<uap:Rotation Preference="landscapeFlipped" />
</uap:InitialRotationPreference>
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="picturesLibrary" />
</Capabilities>
</Package>

Просмотреть файл

@ -0,0 +1,13 @@
namespace NextcloudApp
{
public enum PageTokens
{
Login,
DirectoryList,
FileInfo,
Settings,
SingleFileDownload,
BulkFileDownload,
FileUpload
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,32 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Nextcloud App")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Nextcloud App")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en")]

Просмотреть файл

@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>

Просмотреть файл

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NextcloudApp.Services
{
public class ClientService
{
private static NextcloudClient.NextcloudClient _client;
public static NextcloudClient.NextcloudClient GetClient()
{
if (_client != null)
{
return _client;
}
if (!string.IsNullOrEmpty(SettingsService.Instance.Settings.ServerAddress) &&
!string.IsNullOrEmpty(SettingsService.Instance.Settings.Username) &&
!string.IsNullOrEmpty(SettingsService.Instance.Settings.Password))
{
_client = new NextcloudClient.NextcloudClient(
SettingsService.Instance.Settings.ServerAddress,
SettingsService.Instance.Settings.Username,
SettingsService.Instance.Settings.Password
);
}
SettingsService.Instance.Settings.PropertyChanged += (sender, args) =>
{
if (
string.IsNullOrEmpty(SettingsService.Instance.Settings.ServerAddress) ||
string.IsNullOrEmpty(SettingsService.Instance.Settings.Username) ||
string.IsNullOrEmpty(SettingsService.Instance.Settings.Password)
)
{
return;
}
_client = new NextcloudClient.NextcloudClient(
SettingsService.Instance.Settings.ServerAddress,
SettingsService.Instance.Settings.Username,
SettingsService.Instance.Settings.Password
);
};
return _client;
}
}
}

Просмотреть файл

@ -0,0 +1,34 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Windows.UI.Popups;
using Windows.UI.Xaml.Controls;
namespace NextcloudApp.Services
{
public class DialogService
{
private static SemaphoreSlim _semaphore;
public DialogService()
{
_semaphore = new SemaphoreSlim(1);
}
public async Task<ContentDialogResult> ShowAsync(ContentDialog dialog)
{
await _semaphore.WaitAsync();
var result = await dialog.ShowAsync();
_semaphore.Release();
return result;
}
public async Task<IUICommand> ShowAsync(MessageDialog dialog)
{
await _semaphore.WaitAsync();
var result = await dialog.ShowAsync();
_semaphore.Release();
return result;
}
}
}

Просмотреть файл

@ -0,0 +1,294 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Windows.Networking.Connectivity;
using Windows.UI.Xaml.Media.Imaging;
using NextcloudApp.Annotations;
using NextcloudApp.Models;
using NextcloudApp.Utils;
using NextcloudClient.Exceptions;
using NextcloudClient.Types;
namespace NextcloudApp.Services
{
public class DirectoryService : INotifyPropertyChanged
{
private static DirectoryService _instance;
private DirectoryService()
{
_groupedFilesAndFolders = new ObservableGroupingCollection<string, FileOrFolder>(FilesAndFolders);
GroupByNameAscending();
}
public static DirectoryService Instance => _instance ?? (_instance = new DirectoryService());
public ObservableCollection<PathInfo> PathStack { get; } = new ObservableCollection<PathInfo>
{
new PathInfo
{
ResourceInfo = new ResourceInfo()
{
Name = "Nextcloud",
Path = "/"
},
IsRoot = true
}
};
public ObservableCollection<FileOrFolder> FilesAndFolders { get; } = new ObservableCollection<FileOrFolder>();
private readonly ObservableGroupingCollection<string, FileOrFolder> _groupedFilesAndFolders;
private bool _isSorting;
private bool _continueListing;
public ObservableCollection<Grouping<string, FileOrFolder>> GroupedFilesAndFolders => _groupedFilesAndFolders.Items;
public void GroupByNameAscending()
{
IsSorting = true;
_groupedFilesAndFolders.ArrangeItems(new NameSorter(SortMode.Asc), x => x.Name.First().ToString().ToUpper());
OnPropertyChanged(nameof(GroupedFilesAndFolders));
IsSorting = false;
}
public void GroupByNameDescending()
{
IsSorting = true;
_groupedFilesAndFolders.ArrangeItems(new NameSorter(SortMode.Desc), x => x.Name.First().ToString().ToUpper());
OnPropertyChanged(nameof(GroupedFilesAndFolders));
IsSorting = false;
}
public void GroupByDateAscending()
{
IsSorting = true;
_groupedFilesAndFolders.ArrangeItems(new DateSorter(SortMode.Asc), x => x.LastModified.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern));
OnPropertyChanged(nameof(GroupedFilesAndFolders));
IsSorting = false;
}
public void GroupByDateDescending()
{
IsSorting = true;
_groupedFilesAndFolders.ArrangeItems(new DateSorter(SortMode.Desc), x => x.LastModified.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern));
OnPropertyChanged(nameof(GroupedFilesAndFolders));
IsSorting = false;
}
public void GroupBySizeAscending()
{
IsSorting = true;
_groupedFilesAndFolders.ArrangeItems(new SizeSorter(SortMode.Asc), GetSizeHeader);
OnPropertyChanged(nameof(GroupedFilesAndFolders));
IsSorting = false;
}
public void GroupBySizeDescending()
{
IsSorting = true;
_groupedFilesAndFolders.ArrangeItems(new SizeSorter(SortMode.Desc), GetSizeHeader);
OnPropertyChanged(nameof(GroupedFilesAndFolders));
IsSorting = false;
}
private static string GetSizeHeader(ResourceInfo fileOrFolder)
{
var size = fileOrFolder.Size;
string[] sizes = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
var order = 0;
while (size >= 1024 && ++order < sizes.Length)
{
size = size / 1024;
}
return sizes[order];
}
public async Task Refresh()
{
await StartDirectoryListing();
}
public async Task StartDirectoryListing()
{
var client = ClientService.GetClient();
if (client == null)
{
return;
}
_continueListing = true;
var path = PathStack.Count > 0 ? PathStack[PathStack.Count - 1].ResourceInfo.Path : "/";
List<ResourceInfo> list = null;
try
{
list = await client.List(path);
}
catch (ResponseError e)
{
ResponseErrorHandlerService.HandleException(e);
}
FilesAndFolders.Clear();
if (list != null)
{
foreach (var item in list)
{
FilesAndFolders.Add(new FileOrFolder(item));
}
}
switch (SettingsService.Instance.Settings.PreviewImageDownloadMode)
{
case PreviewImageDownloadMode.Always:
DownloadPreviewImages();
break;
case PreviewImageDownloadMode.WiFiOnly:
var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
// connectionProfile can be null (e.g. airplane mode)
if (connectionProfile != null && connectionProfile.IsWlanConnectionProfile)
{
DownloadPreviewImages();
}
break;
case PreviewImageDownloadMode.Never:
break;
default:
throw new ArgumentOutOfRangeException();
}
}
private async void DownloadPreviewImages()
{
var client = ClientService.GetClient();
if (client == null)
{
return;
}
foreach (var currentFile in FilesAndFolders.ToArray())
{
if (!_continueListing)
{
break;
}
try
{
Stream stream = null;
try
{
stream = await client.GetThumbnail(currentFile, 120, 120);
}
catch (ResponseError e)
{
ResponseErrorHandlerService.HandleException(e);
}
if (stream == null)
{
continue;
}
var bitmap = new BitmapImage();
using (var memStream = new MemoryStream())
{
await stream.CopyToAsync(memStream);
memStream.Position = 0;
bitmap.SetSource(memStream.AsRandomAccessStream());
}
currentFile.Thumbnail = bitmap;
}
catch (ResponseError)
{
currentFile.Thumbnail = new BitmapImage
{
UriSource = new Uri("ms-appx:///Assets/Images/ThumbnailNotFound.png")
};
}
}
}
public bool IsSorting
{
get { return _isSorting; }
set
{
if (_isSorting == value)
{
return;
}
_isSorting = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public void StopDirectoryListing()
{
_continueListing = false;
}
public async Task<bool> CreateDirectory(string directoryName)
{
var client = ClientService.GetClient();
if (client == null)
{
return false;
}
var path = PathStack.Count > 0 ? PathStack[PathStack.Count - 1].ResourceInfo.Path : "";
var success = false;
try
{
success = await client.CreateDirectory(path + "/" + directoryName);
}
catch (ResponseError e)
{
if (e.StatusCode != "400") // ProtocolError
{
ResponseErrorHandlerService.HandleException(e);
}
}
if (success)
{
await StartDirectoryListing();
}
return success;
}
public async Task<bool> DeleteResource(ResourceInfo resourceInfo)
{
var client = ClientService.GetClient();
if (client == null)
{
return false;
}
var path = resourceInfo.ContentType.Equals("dav/directory")
? resourceInfo.Path
: resourceInfo.Path + "/" + resourceInfo.Name;
var success = await client.Delete(path);
await StartDirectoryListing();
return success;
}
}
}

Просмотреть файл

@ -0,0 +1,298 @@
using System;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Core;
using Windows.ApplicationModel.Email;
using Windows.Foundation;
using Windows.Graphics.Imaging;
using Windows.Networking.Connectivity;
using Windows.Storage;
using Windows.Storage.Streams;
using Windows.System.Profile;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Imaging;
using Microsoft.Practices.Unity;
using Prism.Windows.AppModel;
namespace NextcloudApp.Services
{
public class ExceptionReportService
{
private static ContentDialog _dlg;
public static async Task Handle(string exceptionType, string exceptionMessage, string exceptionStackTrace,
string innerExceptionType, string exceptionHashCode)
{
if (_dlg != null)
{
return;
}
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
var app = Application.Current as App;
if (app == null)
{
return;
}
var resourceLoader = app.Container.Resolve<IResourceLoader>();
var dialogService = app.Container.Resolve< DialogService>();
_dlg = new ContentDialog
{
Title = resourceLoader.GetString("ApplicationError"),
Content = new TextBlock
{
Text = resourceLoader.GetString("ApplicationError_Description"),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = resourceLoader.GetString("Yes"),
SecondaryButtonText = resourceLoader.GetString("No")
};
_dlg.IsPrimaryButtonEnabled = _dlg.IsSecondaryButtonEnabled = true;
try
{
var result = await dialogService.ShowAsync(_dlg);
if (result != ContentDialogResult.Primary)
{
return;
}
var stringBuilder = new StringBuilder();
stringBuilder.AppendFormat("[AppId]:[{0}]", Package.Current.Id.Name);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[Type]:[{0}]", exceptionType);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[ExceptionMessage]:[{0}]", exceptionMessage);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[StackTrace]:[\n{0}\n]", exceptionStackTrace);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[InnerException]:[{0}]", innerExceptionType);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[OccurrenceDate]:[{0:yyyy-MM-dd hh:mm:ss} GMT]",
DateTime.Now.ToUniversalTime());
stringBuilder.AppendLine();
var packages =
Windows.Phone.Management.Deployment.InstallationManager.FindPackagesForCurrentPublisher();
var package =
packages.FirstOrDefault(
p => p.Id.ProductId == string.Concat("{", Package.Current.Id.Name.ToUpper(), "}"));
if (package != null)
{
stringBuilder.AppendFormat("[AppInstallDate]:[{0:yyyy-MM-dd hh:mm:ss} GMT]",
package.InstallDate.ToUniversalTime());
stringBuilder.AppendLine();
}
stringBuilder.AppendFormat("[AppTotalRuns]:[{0}]",
SettingsService.Instance.Settings.AppTotalRuns);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[AppRunsAfterLastUpdate]:[{0}]",
SettingsService.Instance.Settings.AppRunsAfterLastUpdate);
stringBuilder.AppendLine();
stringBuilder.Append(
$"[AppVersion]:[{Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}.{Package.Current.Id.Version.Revision}]");
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[Culture]:[{0}]", CultureInfo.CurrentCulture.Name);
stringBuilder.AppendLine();
var dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
if (dispatcher.HasThreadAccess && Window.Current.Content != null)
{
var rootFrame = Window.Current.Content as Frame;
if (rootFrame?.CurrentSourcePageType != null)
{
stringBuilder.AppendFormat("[CurrentPageSource]:[{0}]",
rootFrame.CurrentSourcePageType.FullName);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[NavigationStack]:[{0}]", GetNavigationStackInfo(rootFrame));
stringBuilder.AppendLine();
}
}
var deviceInfo =
new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();
stringBuilder.AppendFormat("[DeviceManufacturer]:[{0}]", deviceInfo.SystemManufacturer);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[DeviceModel]:[{0}]", deviceInfo.SystemProductName);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[DeviceHardwareVersion]:[{0}]", deviceInfo.SystemHardwareVersion);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[DeviceFirmwareVersion]:[{0}]", deviceInfo.SystemFirmwareVersion);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[DeviceId]:[{0}]", deviceInfo.Id);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[OperatingSystem]:[{0}]", deviceInfo.OperatingSystem);
stringBuilder.AppendLine();
var deviceFamilyVersion = AnalyticsInfo.VersionInfo.DeviceFamilyVersion;
var version = ulong.Parse(deviceFamilyVersion);
var major = (version & 0xFFFF000000000000L) >> 48;
var minor = (version & 0x0000FFFF00000000L) >> 32;
var build = (version & 0x00000000FFFF0000L) >> 16;
var revision = (version & 0x000000000000FFFFL);
stringBuilder.AppendFormat("[OSVersion]:[{0}]", $"{major}.{minor}.{build}.{revision}");
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[Architecture]:[{0}]", Package.Current.Id.Architecture);
stringBuilder.AppendLine();
var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
if (connectionProfile != null)
{
stringBuilder.AppendFormat("[NetworkType]:[{0}]", connectionProfile.ProfileName);
stringBuilder.AppendLine();
}
stringBuilder.AppendFormat("[FriendlyName]:[{0}]", deviceInfo.FriendlyName);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[DeviceTotalMemory(Mb)]:[{0}]",
Windows.System.MemoryManager.AppMemoryUsageLimit/1048576f);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[AppCurrentMemoryUsage(Mb)]:[{0}]",
Windows.System.MemoryManager.AppMemoryUsage/1048576f);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[IsoStorageAvailableSpaceLocal(Mb)]:[{0}]",
await GetFreeSpace(ApplicationData.Current.LocalFolder)/1048576f);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[IsoStorageAvailableSpaceTemporary(Mb)]:[{0}]",
await GetFreeSpace(ApplicationData.Current.TemporaryFolder)/1048576f);
stringBuilder.AppendLine();
stringBuilder.AppendFormat("[IsoStorageAvailableSpaceRoaming(Mb)]:[{0}]",
await GetFreeSpace(ApplicationData.Current.RoamingFolder)/1048576f);
stringBuilder.AppendLine();
if (dispatcher.HasThreadAccess && Window.Current.Content != null)
{
var rootFrame = Window.Current.Content as Frame;
var visualTreeBitmap = new RenderTargetBitmap();
await visualTreeBitmap.RenderAsync(rootFrame);
var pixels = (await visualTreeBitmap.GetPixelsAsync()).ToArray();
using (var memoryStream = new InMemoryRandomAccessStream())
{
// Set target compression quality
var propertySet = new BitmapPropertySet();
var qualityValue = new BitmapTypedValue(0.75, PropertyType.Single);
propertySet.Add("ImageQuality", qualityValue);
var encoder =
await
BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, memoryStream, propertySet);
encoder.SetPixelData(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Straight,
(uint) visualTreeBitmap.PixelWidth, (uint) visualTreeBitmap.PixelHeight, 96, 96,
pixels);
// Downsize
const uint baselinesize = 480;
double h = visualTreeBitmap.PixelHeight;
double w = visualTreeBitmap.PixelWidth;
uint scaledHeight, scaledWidth;
if (h >= w)
{
scaledHeight = baselinesize;
scaledWidth = (uint) (baselinesize*(w/h));
}
else
{
scaledWidth = baselinesize;
scaledHeight = (uint) (baselinesize*(h/w));
}
encoder.BitmapTransform.ScaledHeight = scaledHeight;
encoder.BitmapTransform.ScaledWidth = scaledWidth;
await encoder.FlushAsync();
memoryStream.Seek(0L);
// Read the bytes
var reader = new DataReader(memoryStream.GetInputStreamAt(0));
var bytes = new byte[memoryStream.Size];
await reader.LoadAsync((uint) memoryStream.Size);
reader.ReadBytes(bytes);
stringBuilder.AppendFormat("[ScreenshotBase64String]:[\n{0}\n]", Convert.ToBase64String(bytes));
stringBuilder.AppendLine();
}
}
var mail = new EmailMessage
{
Subject =
$"Error report: [{Package.Current.Id.Name}] [{Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}.{Package.Current.Id.Version.Revision}]. Hashcode: [{exceptionHashCode}]",
Body = "see attachment"
};
mail.To.Add(new EmailRecipient("nextcloud.app@andrefiedler.de"));
var file =
await
ApplicationData.Current.LocalFolder.CreateFileAsync("crash-log.txt",
CreationCollisionOption.ReplaceExisting);
await FileIO.WriteTextAsync(file, stringBuilder.ToString());
var attachment = new EmailAttachment(file.Name, file);
mail.Attachments.Add(attachment);
await EmailManager.ShowComposeNewEmailAsync(mail);
}
// ReSharper disable once EmptyGeneralCatchClause
catch
{
}
_dlg = null;
});
}
private static string GetNavigationStackInfo(Frame rootFrame)
{
if (rootFrame == null)
{
return string.Empty;
}
var stringBuilder = new StringBuilder();
foreach (var journalEntry in rootFrame.BackStack)
{
stringBuilder.AppendLine();
stringBuilder.Append(journalEntry.SourcePageType.FullName);
}
stringBuilder.AppendLine();
return stringBuilder.ToString();
}
public static async Task<ulong> GetFreeSpace(StorageFolder folder)
{
var retrivedProperties = await folder.Properties.RetrievePropertiesAsync(new[] {"System.FreeSpace"});
return (ulong) retrivedProperties["System.FreeSpace"];
}
}
}

Просмотреть файл

@ -0,0 +1,45 @@
using Windows.ApplicationModel;
using Microsoft.Practices.Unity;
using Prism.Unity.Windows;
using Prism.Windows.AppModel;
namespace NextcloudApp.Services
{
public class LocalizationService
{
private readonly IResourceLoader _resourceLoader;
private static LocalizationService _instance;
public LocalizationService()
{
if (DesignMode.DesignModeEnabled) return;
var app = PrismUnityApplication.Current as App;
if (app != null)
{
_resourceLoader = app.Container.Resolve<IResourceLoader>();
}
}
public static LocalizationService Instance => _instance ?? (_instance = new LocalizationService());
public string GetString(string key)
{
return _resourceLoader?.GetString(key);
}
public string GetString(string key, object arg0)
{
return string.Format(_resourceLoader?.GetString(key), arg0);
}
public string GetString(string key, object arg0, object arg1)
{
return string.Format(_resourceLoader?.GetString(key), arg0, arg1);
}
public string GetString(string key, object arg0, object arg1, object arg2)
{
return string.Format(_resourceLoader?.GetString(key), arg0, arg1, arg2);
}
}
}

Просмотреть файл

@ -0,0 +1,65 @@
using System.Net;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Microsoft.Practices.Unity;
using NextcloudClient.Exceptions;
using Prism.Windows.AppModel;
using Prism.Windows.Navigation;
namespace NextcloudApp.Services
{
public class ResponseErrorHandlerService
{
private static bool _isHandlingException;
public static async void HandleException(ResponseError e)
{
if (_isHandlingException)
{
return;
}
_isHandlingException = true;
var app = Application.Current as App;
if (app == null)
{
return;
}
var resourceLoader = app.Container.Resolve<IResourceLoader>();
var dialogService = app.Container.Resolve<DialogService>();
var navigationService = app.Container.Resolve<INavigationService>();
ContentDialog dialog;
if (e.StatusCode == "401")
{
dialog = new ContentDialog
{
Title = resourceLoader.GetString("NotAuthorized"),
Content = new TextBlock
{
Text = resourceLoader.GetString("NotAuthorized_Description"),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = resourceLoader.GetString("OK")
};
await dialogService.ShowAsync(dialog);
navigationService.Navigate(PageTokens.Login.ToString(), null);
return;
}
dialog = new ContentDialog
{
Title = resourceLoader.GetString("AnErrorHasOccurred"),
Content = new TextBlock
{
Text = e.Message,
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = resourceLoader.GetString("OK")
};
await dialogService.ShowAsync(dialog);
_isHandlingException = false;
}
}
}

Просмотреть файл

@ -0,0 +1,85 @@
using System.ComponentModel;
using System.Reflection;
using Windows.Storage;
using Newtonsoft.Json;
using NextcloudApp.Models;
using NextcloudApp.Utils;
namespace NextcloudApp.Services
{
public class SettingsService
{
private static SettingsService _instance;
private readonly ApplicationDataContainer _localSettings;
private SettingsService()
{
_localSettings = ApplicationData.Current.LocalSettings;
var appTotalRuns = _localSettings.Values["AppTotalRuns"];
if (appTotalRuns == null)
{
Settings.AppTotalRuns = 0;
}
else
{
Settings.AppTotalRuns = (int) appTotalRuns;
}
Settings.AppRunsAfterLastUpdateVersion = (string)_localSettings.Values["AppRunsAfterLastUpdateVersion"];
var appRunsAfterLastUpdate = _localSettings.Values["AppRunsAfterLastUpdate"];
if (appRunsAfterLastUpdate == null)
{
Settings.AppRunsAfterLastUpdate = 0;
}
else
{
Settings.AppRunsAfterLastUpdate = (int)appRunsAfterLastUpdate;
}
Settings.ServerAddress = (string)_localSettings.Values["ServerAddress"];
Settings.Username = (string)_localSettings.Values["Username"];
Settings.Password = (string)_localSettings.Values["Password"]; // there's no SecureString by now :(
var showFileAndFolderGroupingHeader = _localSettings.Values["ShowFileAndFolderGroupingHeader"];
if (showFileAndFolderGroupingHeader == null)
{
Settings.ShowFileAndFolderGroupingHeader = true;
}
else
{
Settings.ShowFileAndFolderGroupingHeader =
(bool)_localSettings.Values["ShowFileAndFolderGroupingHeader"];
}
var previewImageDownloadMode = (string)_localSettings.Values["PreviewImageDownloadMode"];
Settings.PreviewImageDownloadMode = previewImageDownloadMode == null ? PreviewImageDownloadMode.Always : JsonConvert.DeserializeObject<PreviewImageDownloadMode>(previewImageDownloadMode);
Settings.PropertyChanged += SettingsOnPropertyChanged;
}
private void SettingsOnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
var newValue = sender.GetType().GetProperty(e.PropertyName).GetValue(sender);
if (e.PropertyName == "PreviewImageDownloadMode")
{
_localSettings.Values["PreviewImageDownloadMode"] =
JsonConvert.SerializeObject(newValue);
}
else
{
_localSettings.Values[e.PropertyName] = newValue;
}
}
public static SettingsService Instance => _instance ?? (_instance = new SettingsService());
public Settings Settings { get; } = new Settings();
public void Reset()
{
_localSettings.Values["serverAddress"] = null;
_localSettings.Values["username"] = null;
_localSettings.Values["password"] = null;
_localSettings.Values["ShowFileAndFolderGroupingHeader"] = true;
_localSettings.Values["PreviewImageDownloadMode"] =
JsonConvert.SerializeObject(PreviewImageDownloadMode.Always);
}
}
}

Просмотреть файл

@ -0,0 +1,53 @@
using System;
using Windows.Foundation.Metadata;
using Windows.UI.ViewManagement;
namespace NextcloudApp.Services
{
public class StatusBarService
{
private static StatusBarService _instance;
private int _waitCounter;
private StatusBarService() { }
public static StatusBarService Instance => _instance ?? (_instance = new StatusBarService());
public async void ShowProgressIndicator()
{
_waitCounter++;
if (!ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
return;
}
var statusBar = StatusBar.GetForCurrentView();
var asyncAction = statusBar?.ProgressIndicator.ShowAsync();
if (asyncAction != null)
{
await asyncAction;
}
}
public async void HideProgressIndicator()
{
_waitCounter--;
if (_waitCounter > 0)
{
return;
}
if (!ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
return;
}
var statusBar = StatusBar.GetForCurrentView();
var asyncAction = statusBar?.ProgressIndicator.HideAsync();
if (asyncAction != null)
{
await asyncAction;
}
}
}
}

Просмотреть файл

@ -0,0 +1,335 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AllFiles" xml:space="preserve">
<value>Alle Dateien</value>
</data>
<data name="Always" xml:space="preserve">
<value>Immer</value>
</data>
<data name="AnErrorHasOccurred" xml:space="preserve">
<value>Ein Fehler ist aufgetreten</value>
</data>
<data name="AppBarAdd.Label" xml:space="preserve">
<value>Hinzufügen</value>
</data>
<data name="AppBarAdd_Flyout_CreateFolder.Text" xml:space="preserve">
<value>Ordner erstellen</value>
</data>
<data name="AppBarAdd_Flyout_TakePicture.Text" xml:space="preserve">
<value>Bild aufnehmen</value>
</data>
<data name="AppBarAdd_Flyout_UploadFiles.Text" xml:space="preserve">
<value>Dateien hochladen</value>
</data>
<data name="AppBarAdd_Flyout_UploadPhotos.Text" xml:space="preserve">
<value>Fotos hochladen</value>
</data>
<data name="AppBarDownload.Label" xml:space="preserve">
<value>Herunterladen</value>
</data>
<data name="AppBarRefresh.Label" xml:space="preserve">
<value>Aktualisieren</value>
</data>
<data name="AppBarSort.Label" xml:space="preserve">
<value>Sortieren</value>
</data>
<data name="AppBarSort_Flyout_ByDateASC" xml:space="preserve">
<value>Datum (Älteste nach oben)</value>
</data>
<data name="AppBarSort_Flyout_ByDateDESC" xml:space="preserve">
<value>Datum (Neueste nach oben)</value>
</data>
<data name="AppBarSort_Flyout_ByNameASC" xml:space="preserve">
<value>Name (A nach oben)</value>
</data>
<data name="AppBarSort_Flyout_ByNameDESC" xml:space="preserve">
<value>Name (Z nach oben)</value>
</data>
<data name="AppBarSort_Flyout_BySizeASC" xml:space="preserve">
<value>Größe (Kleinste nach oben)</value>
</data>
<data name="AppBarSort_Flyout_BySizeDESC" xml:space="preserve">
<value>Größe (Größte nach oben)</value>
</data>
<data name="ApplicationError" xml:space="preserve">
<value>Anwendungsfehler</value>
</data>
<data name="ApplicationError_Description" xml:space="preserve">
<value>In der Anwendung ist ein Problem aufgetreten. Wir entschuldigen uns für die Unannehmlichkeiten. Wenn Sie in der Mitte von etwas waren, sind die Informationen, an denen Sie gearbeitet haben, verloren.
Möchten Sie die Anwendungsentwickler informieren und den vorbereiteten Fehlerbericht übermitteln? Dies hilft das Problem schneller zu beseitigen.</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Abbrechen</value>
</data>
<data name="CanNotCreateFolder" xml:space="preserve">
<value>Ordnererstellung nicht möglich</value>
</data>
<data name="Connect.Content" xml:space="preserve">
<value>Verbinden</value>
</data>
<data name="ContentType.Text" xml:space="preserve">
<value>Content-Type</value>
</data>
<data name="Create" xml:space="preserve">
<value>Erstellen</value>
</data>
<data name="Created.Text" xml:space="preserve">
<value>Erstellt</value>
</data>
<data name="CreateNewFolder" xml:space="preserve">
<value>Neuen Ordner erstellen</value>
</data>
<data name="DownloadingTheFile.Text" xml:space="preserve">
<value>Herunterladen der Datei…</value>
</data>
<data name="DownloadPreviewImages.Header" xml:space="preserve">
<value>Bildvorschau herunterladen</value>
</data>
<data name="ETag.Text" xml:space="preserve">
<value>ETag</value>
</data>
<data name="FileSizeString" xml:space="preserve">
<value>{0} ({1} Byte)</value>
</data>
<data name="FolderNeme" xml:space="preserve">
<value>Ordnername</value>
</data>
<data name="Information.Text" xml:space="preserve">
<value>Informationen</value>
</data>
<data name="LastModified.Text" xml:space="preserve">
<value>Zuletzt geändert</value>
</data>
<data name="Name.Text" xml:space="preserve">
<value>Name</value>
</data>
<data name="Never" xml:space="preserve">
<value>Nie</value>
</data>
<data name="NewFolder" xml:space="preserve">
<value>Neuer Ordner</value>
</data>
<data name="No" xml:space="preserve">
<value>Nein</value>
</data>
<data name="NotAuthorized" xml:space="preserve">
<value>Nicht berechtigt</value>
</data>
<data name="NotAuthorized_Description" xml:space="preserve">
<value>Der Server hat einen Fehlercode 401 (Unauthorized) zurückgegeben. Bitte melden Sie sich erneut an.</value>
</data>
<data name="OK" xml:space="preserve">
<value>OK</value>
</data>
<data name="Password.Header" xml:space="preserve">
<value>Passwort</value>
</data>
<data name="Path.Text" xml:space="preserve">
<value>Pfad</value>
</data>
<data name="QuotaUsedOfTotal" xml:space="preserve">
<value>{0} von {1} verwendet</value>
</data>
<data name="ReseTthisApp.Content" xml:space="preserve">
<value>Diese App zurücksetzen</value>
</data>
<data name="Retry" xml:space="preserve">
<value>Wiederholen</value>
</data>
<data name="ServerAddress.Header" xml:space="preserve">
<value>Serveradresse</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Einstellungen</value>
</data>
<data name="Settings2.Text" xml:space="preserve">
<value>Einstellungen</value>
</data>
<data name="ShowGrouping.Header" xml:space="preserve">
<value>Gruppierung von Datei- und Ordner-Liste anzeigen</value>
</data>
<data name="Size.Text" xml:space="preserve">
<value>Größe</value>
</data>
<data name="SpecifyDifferentName" xml:space="preserve">
<value>Es gibt bereits ein Element mit diesem Namen. Geben Sie einen anderen Namen an.</value>
</data>
<data name="Type.Text" xml:space="preserve">
<value>Typ</value>
</data>
<data name="Username.Header" xml:space="preserve">
<value>Benutzername</value>
</data>
<data name="Version" xml:space="preserve">
<value>Version {0}</value>
</data>
<data name="WiFiOnly" xml:space="preserve">
<value>Nur über WLAN</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Ja</value>
</data>
<data name="Delete_Text.Text" xml:space="preserve">
<value>Löschen</value>
</data>
<data name="DeleteFile" xml:space="preserve">
<value>Datei löschen</value>
</data>
<data name="DeleteFile_Description" xml:space="preserve">
<value>Sind Sie sicher, dass Sie die Datei {0} löschen möchten?</value>
</data>
<data name="DeleteFolder" xml:space="preserve">
<value>Ordner löschen</value>
</data>
<data name="DeleteFolder_Description" xml:space="preserve">
<value>Sind Sie sicher, dass Sie den Ordner {0} löschen möchten?</value>
</data>
<data name="UploadingFileProgress" xml:space="preserve">
<value>{0} von {1} hochgeladen</value>
</data>
<data name="UploadingFiles" xml:space="preserve">
<value>Lade Datei {0} von {1} hoch…</value>
</data>
<data name="UploadingTheFile.Text" xml:space="preserve">
<value>Hochladen der Datei…</value>
</data>
<data name="DownloadingFileProgress" xml:space="preserve">
<value>{0} von {1} heruntergeladen</value>
</data>
<data name="Auth_MaintenanceEnabled" xml:space="preserve">
<value>Der Maintenance-Mode ist auf dem Server aktiviert.</value>
</data>
<data name="Auth_Unauthorized" xml:space="preserve">
<value>Falscher Benutzername oder Passwort</value>
</data>
<data name="ClientVersion" xml:space="preserve">
<value>Client-Version {0}</value>
</data>
<data name="ServerNameOrAddressCouldNotBeResolved" xml:space="preserve">
<value>Der Servername oder die Adresse konnten nicht aufgelöst werden.</value>
</data>
<data name="ServerVersion" xml:space="preserve">
<value>Server-Version {0}</value>
</data>
<data name="Delete_Label.Label" xml:space="preserve">
<value>Löschen</value>
</data>
</root>

Просмотреть файл

@ -0,0 +1,335 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AllFiles" xml:space="preserve">
<value>All files</value>
</data>
<data name="Always" xml:space="preserve">
<value>Always</value>
</data>
<data name="AnErrorHasOccurred" xml:space="preserve">
<value>An error has occurred</value>
</data>
<data name="AppBarAdd.Label" xml:space="preserve">
<value>Add</value>
</data>
<data name="AppBarAdd_Flyout_CreateFolder.Text" xml:space="preserve">
<value>Create folder</value>
</data>
<data name="AppBarAdd_Flyout_TakePicture.Text" xml:space="preserve">
<value>Take picture</value>
</data>
<data name="AppBarAdd_Flyout_UploadFiles.Text" xml:space="preserve">
<value>Upload files</value>
</data>
<data name="AppBarAdd_Flyout_UploadPhotos.Text" xml:space="preserve">
<value>Upload photos</value>
</data>
<data name="AppBarDownload.Label" xml:space="preserve">
<value>Download</value>
</data>
<data name="AppBarRefresh.Label" xml:space="preserve">
<value>Refresh</value>
</data>
<data name="AppBarSort.Label" xml:space="preserve">
<value>Sort</value>
</data>
<data name="AppBarSort_Flyout_ByDateASC" xml:space="preserve">
<value>Date (oldest to the top)</value>
</data>
<data name="AppBarSort_Flyout_ByDateDESC" xml:space="preserve">
<value>Date (newest to the top)</value>
</data>
<data name="AppBarSort_Flyout_ByNameASC" xml:space="preserve">
<value>Name (A to the top)</value>
</data>
<data name="AppBarSort_Flyout_ByNameDESC" xml:space="preserve">
<value>Name (Z to the top)</value>
</data>
<data name="AppBarSort_Flyout_BySizeASC" xml:space="preserve">
<value>Size (smallest to the top)</value>
</data>
<data name="AppBarSort_Flyout_BySizeDESC" xml:space="preserve">
<value>Size (largest to the top)</value>
</data>
<data name="ApplicationError" xml:space="preserve">
<value>Application error</value>
</data>
<data name="ApplicationError_Description" xml:space="preserve">
<value>The application has encountered a problem. We apologize for the inconvenience. If you were in the middle of something, the information you have been working on is lost.
Would you like to inform the application developers and submit the prepared error report? This helps to eliminate the problem more quickly.</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="CanNotCreateFolder" xml:space="preserve">
<value>Can not create folder</value>
</data>
<data name="Connect.Content" xml:space="preserve">
<value>Connect</value>
</data>
<data name="ContentType.Text" xml:space="preserve">
<value>Content-Type</value>
</data>
<data name="Create" xml:space="preserve">
<value>Create</value>
</data>
<data name="Created.Text" xml:space="preserve">
<value>Created</value>
</data>
<data name="CreateNewFolder" xml:space="preserve">
<value>Create a new folder</value>
</data>
<data name="DownloadingTheFile.Text" xml:space="preserve">
<value>Downloading the file…</value>
</data>
<data name="DownloadPreviewImages.Header" xml:space="preserve">
<value>Download preview images</value>
</data>
<data name="ETag.Text" xml:space="preserve">
<value>ETag</value>
</data>
<data name="FileSizeString" xml:space="preserve">
<value>{0} ({1} byte)</value>
</data>
<data name="FolderNeme" xml:space="preserve">
<value>Folder name</value>
</data>
<data name="Information.Text" xml:space="preserve">
<value>Information</value>
</data>
<data name="LastModified.Text" xml:space="preserve">
<value>Last modified</value>
</data>
<data name="Name.Text" xml:space="preserve">
<value>Name</value>
</data>
<data name="Never" xml:space="preserve">
<value>Never</value>
</data>
<data name="NewFolder" xml:space="preserve">
<value>New folder</value>
</data>
<data name="No" xml:space="preserve">
<value>No</value>
</data>
<data name="NotAuthorized" xml:space="preserve">
<value>Not authorized</value>
</data>
<data name="NotAuthorized_Description" xml:space="preserve">
<value>The server returned an error code 401 (Unauthorized). Please log in again.</value>
</data>
<data name="OK" xml:space="preserve">
<value>OK</value>
</data>
<data name="Password.Header" xml:space="preserve">
<value>Password</value>
</data>
<data name="Path.Text" xml:space="preserve">
<value>Path</value>
</data>
<data name="QuotaUsedOfTotal" xml:space="preserve">
<value>{0} of {1} used</value>
</data>
<data name="ReseTthisApp.Content" xml:space="preserve">
<value>Reset this app</value>
</data>
<data name="Retry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="ServerAddress.Header" xml:space="preserve">
<value>Server address</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Settings</value>
</data>
<data name="Settings2.Text" xml:space="preserve">
<value>Settings</value>
</data>
<data name="ShowGrouping.Header" xml:space="preserve">
<value>Show file and folder list grouping</value>
</data>
<data name="Size.Text" xml:space="preserve">
<value>Size</value>
</data>
<data name="SpecifyDifferentName" xml:space="preserve">
<value>There is already an element with this name. Specify a different name.</value>
</data>
<data name="Type.Text" xml:space="preserve">
<value>Type</value>
</data>
<data name="Username.Header" xml:space="preserve">
<value>Username</value>
</data>
<data name="Version" xml:space="preserve">
<value>Version {0}</value>
</data>
<data name="WiFiOnly" xml:space="preserve">
<value>Only when I'm on Wi-Fi</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Yes</value>
</data>
<data name="Delete_Text.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="DeleteFile" xml:space="preserve">
<value>Delete file</value>
</data>
<data name="DeleteFile_Description" xml:space="preserve">
<value>Are you sure, you want to delete the file {0}</value>
</data>
<data name="DeleteFolder" xml:space="preserve">
<value>Delete folder</value>
</data>
<data name="DeleteFolder_Description" xml:space="preserve">
<value>Are you sure, you want to delete the folder {0}</value>
</data>
<data name="UploadingFileProgress" xml:space="preserve">
<value>{0} of {1} uploaded</value>
</data>
<data name="UploadingFiles" xml:space="preserve">
<value>Uploading file {0} of {1}…</value>
</data>
<data name="UploadingTheFile.Text" xml:space="preserve">
<value>Uploading the file…</value>
</data>
<data name="DownloadingFileProgress" xml:space="preserve">
<value>{0} of {1} downloaded</value>
</data>
<data name="Auth_MaintenanceEnabled" xml:space="preserve">
<value>The maintenance mode is enabled on the server.</value>
</data>
<data name="Auth_Unauthorized" xml:space="preserve">
<value>Wrong username or password.</value>
</data>
<data name="ClientVersion" xml:space="preserve">
<value>Client version {0}</value>
</data>
<data name="ServerNameOrAddressCouldNotBeResolved" xml:space="preserve">
<value>The server name or address could not be resolved.</value>
</data>
<data name="ServerVersion" xml:space="preserve">
<value>Server version {0}</value>
</data>
<data name="Delete_Label.Label" xml:space="preserve">
<value>Delete</value>
</data>
</root>

Просмотреть файл

@ -0,0 +1,9 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:NextcloudApp">
<FontFamily x:Key="NextcloudIcons">/Assets/Fonts/nextcloud.ttf#nextcloud</FontFamily>
<x:String x:Key="NextclousLogoWithSlogan">&#xE900;</x:String>
<x:String x:Key="NextclousLogo">&#xE901;</x:String>
</ResourceDictionary>

Просмотреть файл

@ -0,0 +1,92 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:NextcloudApp">
<Style x:Key="MenuFlyoutIconItemStyle" TargetType="MenuFlyoutItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="Padding" Value="{ThemeResource MenuFlyoutItemThemePadding}"/>
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="UseSystemFocusVisuals" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuFlyoutItem">
<Grid x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="TextBlock"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="LayoutRoot">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="TextBlock">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
</ObjectAnimationUsingKeyFrames>
<PointerUpThemeAnimation Storyboard.TargetName="TextBlock"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="LayoutRoot">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="TextBlock">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
</ObjectAnimationUsingKeyFrames>
<PointerDownThemeAnimation Storyboard.TargetName="TextBlock"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="TextBlock">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckPlaceholderStates">
<VisualState x:Name="NoPlaceholder"/>
<VisualState x:Name="CheckPlaceholder">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="TextBlock">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="PaddingSizeStates">
<VisualState x:Name="DefaultPadding"/>
<VisualState x:Name="NarrowPadding">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Padding" Storyboard.TargetName="LayoutRoot">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<StackPanel Orientation="Horizontal">
<SymbolIcon
Margin="0,0,12,0"
Symbol="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<TextBlock
x:Name="TextBlock"
Foreground="{TemplateBinding Foreground}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Text="{TemplateBinding Text}"
TextTrimming="Clip"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</StackPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

Просмотреть файл

@ -0,0 +1,190 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:NextcloudApp">
<Style x:Key="SplitViewMenuButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Height" Value="48" />
<Setter Property="UseSystemFocusVisuals" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid" Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(Grid.Background)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
</ObjectAnimationUsingKeyFrames>
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledTransparentBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter
x:Name="ContentPresenter"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
Padding="{TemplateBinding Padding}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SplitViewMenuFontIconStyle" TargetType="FontIcon">
<Setter Property="FontSize" Value="20" />
<Setter Property="Margin" Value="14,0,0,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="IsHitTestVisible" Value="True" />
</Style>
<Style x:Key="SplitViewMenuItemTextStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="16" />
<Setter Property="Margin" Value="15,0,20,0" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="MenuSplitViewStyle" TargetType="SplitView">
<Setter Property="IsTabStop" Value="False" />
</Style>
<Style x:Key="SplitViewTogglePaneButtonStyle" TargetType="ToggleButton">
<Setter Property="FontSize" Value="20" />
<Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
<Setter Property="MinHeight" Value="48" />
<Setter Property="MinWidth" Value="48" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="Content" Value="&#xE700;" />
<Setter Property="AutomationProperties.Name" Value="Menu" />
<Setter Property="UseSystemFocusVisuals" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Grid.Background)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Grid.Background)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Checked" />
<VisualState x:Name="CheckedPointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Grid.Background)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="CheckedPressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Grid.Background)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="CheckedDisabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter
x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"
Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

Просмотреть файл

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NextcloudApp.Models;
namespace NextcloudApp.Utils
{
public class DateSorter : Comparer<FileOrFolder>
{
private readonly SortMode _sortMode;
public DateSorter(SortMode sortMode)
{
_sortMode = sortMode;
}
public override int Compare(FileOrFolder x, FileOrFolder y)
{
return _sortMode == SortMode.Asc
? x.LastModified.CompareTo(y.LastModified)
: y.LastModified.CompareTo(x.LastModified);
}
}
}

Просмотреть файл

@ -0,0 +1,19 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace NextcloudApp.Utils
{
public class Grouping<TK, T> : ObservableCollection<T>
{
public TK Key { get; private set; }
public Grouping(TK key, IEnumerable<T> items)
{
Key = key;
foreach (var item in items)
{
Items.Add(item);
}
}
}
}

Просмотреть файл

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NextcloudApp.Utils
{
public interface IRevertState
{
bool CanRevertState();
void RevertState();
}
}

Просмотреть файл

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NextcloudApp.Models;
namespace NextcloudApp.Utils
{
public class NameSorter : Comparer<FileOrFolder>
{
private readonly SortMode _sortMode;
public NameSorter(SortMode sortMode)
{
_sortMode = sortMode;
}
public override int Compare(FileOrFolder x, FileOrFolder y)
{
int result;
if (_sortMode == SortMode.Asc)
{
result = x.Name.First().CompareTo(y.Name.First());
if (result != 0)
{
return result;
}
result = string.Compare(x.Name, y.Name, StringComparison.Ordinal);
return result != 0 ? result : string.Compare(x.Name, y.Name, StringComparison.Ordinal);
}
result = y.Name.First().CompareTo(x.Name.First());
if (result != 0)
{
return result;
}
result = string.Compare(y.Name, x.Name, StringComparison.Ordinal);
return result != 0 ? result : string.Compare(y.Name, x.Name, StringComparison.Ordinal);
}
}
}

Просмотреть файл

@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
namespace NextcloudApp.Utils
{
public class ObservableGroupingCollection<TK, T> where TK : IComparable
{
private readonly ObservableCollection<T> _rootCollection;
private Func<T, TK> _groupFunction;
private IComparer<T> _sortOrder;
public ObservableGroupingCollection(ObservableCollection<T> collection)
{
_rootCollection = collection;
_rootCollection.CollectionChanged += _rootCollection_CollectionChanged;
}
public ObservableCollection<Grouping<TK, T>> Items { get; private set; }
private void _rootCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
HandleCollectionChanged(e);
}
public void ArrangeItems(IComparer<T> sortorder, Func<T, TK> group)
{
_sortOrder = sortorder;
_groupFunction = group;
var temp = _rootCollection
.OrderBy(i => i, _sortOrder)
.GroupBy(_groupFunction)
.ToList()
.Select(g => new Grouping<TK, T>(g.Key, g));
Items = new ObservableCollection<Grouping<TK, T>>(temp);
}
private void HandleCollectionChanged(NotifyCollectionChangedEventArgs e)
{
switch (e.Action)
{
case NotifyCollectionChangedAction.Add:
{
var item = (T) e.NewItems[0];
var value = _groupFunction.Invoke(item);
// find matching group if exists
var existingGroup = Items.FirstOrDefault(g => g.Key.Equals(value));
if (existingGroup == null)
{
var newlist = new List<T> {item};
// find first group where Key is greater than this key
var insertBefore = Items.FirstOrDefault(g => g.Key.CompareTo(value) > 0);
if (insertBefore == null)
{
// not found - add new group to end of list
Items.Add(new Grouping<TK, T>(value, newlist));
}
else
{
// insert new group at this index
Items.Insert(Items.IndexOf(insertBefore), new Grouping<TK, T>(value, newlist));
}
}
else
{
// find index to insert new item in existing group
var index = existingGroup.ToList().BinarySearch(item, _sortOrder);
if (index < 0)
{
existingGroup.Insert(~index, item);
}
}
}
break;
case NotifyCollectionChangedAction.Remove:
{
var item = (T) e.OldItems[0];
var value = _groupFunction.Invoke(item);
var existingGroup = Items.FirstOrDefault(g => g.Key.Equals(value));
if (existingGroup != null)
{
// find existing item and remove
var targetIndex = existingGroup.IndexOf(item);
existingGroup.RemoveAt(targetIndex);
// remove group if zero items
if (existingGroup.Count == 0)
{
Items.Remove(existingGroup);
}
}
}
break;
case NotifyCollectionChangedAction.Move:
break;
case NotifyCollectionChangedAction.Replace:
break;
case NotifyCollectionChangedAction.Reset:
Items.Clear();
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
namespace NextcloudApp.Utils
{
public enum PreviewImageDownloadMode
{
Always,
WiFiOnly,
Never
}
}

Просмотреть файл

@ -0,0 +1,48 @@
using System;
using System.Windows.Input;
namespace NextcloudApp.Utils
{
public class RelayCommand : ICommand, IDisposable
{
public event EventHandler CanExecuteChanged;
private readonly Func<bool> _canExecuteFunc;
private readonly Action<object> _executeAction;
public RelayCommand(Action<object> action) : this(action, () => true)
{
}
public RelayCommand(Action<object> action, Func<bool> canExecuteFunc)
{
_executeAction = action;
_canExecuteFunc = canExecuteFunc;
}
public bool CanExecute(object parameter)
{
return _canExecuteFunc();
}
public void Dispose()
{
RemoveAllEvents();
}
public void Execute(object parameter)
{
_executeAction(parameter);
}
public void RemoveAllEvents()
{
CanExecuteChanged = null;
}
public void RaiseCanExecuteChanged()
{
CanExecuteChanged?.Invoke(this, EventArgs.Empty);
}
}
}

Просмотреть файл

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NextcloudApp.Models;
using NextcloudClient.Types;
namespace NextcloudApp.Utils
{
public class SizeSorter : Comparer<FileOrFolder>
{
private readonly SortMode _sortMode;
public SizeSorter(SortMode sortMode)
{
_sortMode = sortMode;
}
public override int Compare(FileOrFolder x, FileOrFolder y)
{
return _sortMode == SortMode.Asc
? x.Size.CompareTo(y.Size)
: y.Size.CompareTo(x.Size);
}
}
}

Просмотреть файл

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NextcloudApp.Utils
{
public enum SortMode
{
Asc,
Desc
}
}

Просмотреть файл

@ -0,0 +1,340 @@
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Windows.Input;
using Windows.Storage.Pickers;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using NextcloudApp.Models;
using NextcloudApp.Services;
using NextcloudApp.Utils;
using NextcloudClient.Types;
using Prism.Commands;
using Prism.Windows.AppModel;
using Prism.Windows.Navigation;
namespace NextcloudApp.ViewModels
{
public class DirectoryListPageViewModel : ViewModel
{
private Settings _settngs;
private DirectoryService _directoryService;
private ResourceInfo _selectedFileOrFolder;
private int _selectedPathIndex = -1;
private readonly INavigationService _navigationService;
private readonly IResourceLoader _resourceLoader;
private readonly DialogService _dialogService;
private bool _isNavigatingBack;
public ICommand GroupByNameAscendingCommand { get; private set; }
public ICommand GroupByNameDescendingCommand { get; private set; }
public ICommand GroupByDateAscendingCommand { get; private set; }
public ICommand GroupByDateDescendingCommand { get; private set; }
public ICommand GroupBySizeAscendingCommand { get; private set; }
public ICommand GroupBySizeDescendingCommand { get; private set; }
public ICommand RefreshCommand { get; private set; }
public ICommand CreateDirectoryCommand { get; private set; }
public ICommand UploadFilesCommand { get; private set; }
public ICommand UploadPhotosCommand { get; private set; }
public ICommand DeleteResourceCommand { get; private set; }
public DirectoryListPageViewModel(INavigationService navigationService, IResourceLoader resourceLoader, DialogService dialogService)
{
_navigationService = navigationService;
_resourceLoader = resourceLoader;
_dialogService = dialogService;
Settings = SettingsService.Instance.Settings;
GroupByNameAscendingCommand = new DelegateCommand(() =>
{
Directory.GroupByNameAscending();
SelectedFileOrFolder = null;
});
GroupByNameDescendingCommand = new DelegateCommand(() =>
{
Directory.GroupByNameDescending();
SelectedFileOrFolder = null;
});
GroupByDateAscendingCommand = new DelegateCommand(() =>
{
Directory.GroupByDateAscending();
SelectedFileOrFolder = null;
});
GroupByDateDescendingCommand = new DelegateCommand(() =>
{
Directory.GroupByDateDescending();
SelectedFileOrFolder = null;
});
GroupBySizeAscendingCommand = new DelegateCommand(() =>
{
Directory.GroupBySizeAscending();
SelectedFileOrFolder = null;
});
GroupBySizeDescendingCommand = new DelegateCommand(() =>
{
Directory.GroupBySizeDescending();
SelectedFileOrFolder = null;
});
RefreshCommand = new DelegateCommand(async () =>
{
ShowProgressIndicator();
await Directory.Refresh();
HideProgressIndicator();
});
CreateDirectoryCommand = new DelegateCommand(CreateDirectory);
UploadFilesCommand = new DelegateCommand(UploadFiles);
UploadPhotosCommand = new DelegateCommand(UploadPhotos);
DeleteResourceCommand = new RelayCommand(DeleteResource);
}
private async void DeleteResource(object parameter)
{
var resourceInfo = parameter as ResourceInfo;
if (resourceInfo == null)
{
return;
}
var dialog = new ContentDialog
{
Title = _resourceLoader.GetString(resourceInfo.ContentType.Equals("dav/directory") ? "DeleteFolder" : "DeleteFile"),
Content = new TextBlock()
{
Text = string.Format(_resourceLoader.GetString(resourceInfo.ContentType.Equals("dav/directory") ? "DeleteFolder_Description" : "DeleteFile_Description"), resourceInfo.Name),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = _resourceLoader.GetString("Yes"),
SecondaryButtonText = _resourceLoader.GetString("No")
};
var dialogResult = await _dialogService.ShowAsync(dialog);
if (dialogResult != ContentDialogResult.Primary)
{
return;
}
ShowProgressIndicator();
await Directory.DeleteResource(resourceInfo);
HideProgressIndicator();
}
private void UploadFiles()
{
var parameters = new FileUploadPageParameters
{
ResourceInfo = Directory.PathStack.Count > 0
? Directory.PathStack[Directory.PathStack.Count - 1].ResourceInfo
: new ResourceInfo()
};
_navigationService.Navigate(PageTokens.FileUpload.ToString(), parameters.Serialize());
}
private void UploadPhotos()
{
var parameters = new FileUploadPageParameters
{
ResourceInfo = Directory.PathStack.Count > 0
? Directory.PathStack[Directory.PathStack.Count - 1].ResourceInfo
: new ResourceInfo(),
PickerLocationId = PickerLocationId.PicturesLibrary
};
_navigationService.Navigate(PageTokens.FileUpload.ToString(), parameters.Serialize());
}
private async void CreateDirectory()
{
while (true)
{
var dialog = new ContentDialog
{
Title = _resourceLoader.GetString("CreateNewFolder"),
Content = new TextBox()
{
Header = _resourceLoader.GetString("FolderName"),
PlaceholderText = _resourceLoader.GetString("NewFolder"),
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = _resourceLoader.GetString("Create"),
SecondaryButtonText = _resourceLoader.GetString("Cancel")
};
var dialogResult = await _dialogService.ShowAsync(dialog);
if (dialogResult != ContentDialogResult.Primary)
{
return;
}
var textBox = dialog.Content as TextBox;
if (textBox == null)
{
return;
}
var folderName = textBox.Text;
if (string.IsNullOrEmpty(folderName))
{
folderName = _resourceLoader.GetString("NewFolder");
}
ShowProgressIndicator();
var success = await Directory.CreateDirectory(folderName);
HideProgressIndicator();
if (success)
{
return;
}
dialog = new ContentDialog
{
Title = _resourceLoader.GetString("CanNotCreateFolder"),
Content = new TextBlock
{
Text = _resourceLoader.GetString("SpecifyDifferentName"),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = _resourceLoader.GetString("Retry"),
SecondaryButtonText = _resourceLoader.GetString("Cancel")
};
dialogResult = await _dialogService.ShowAsync(dialog);
if (dialogResult != ContentDialogResult.Primary)
{
return;
}
}
}
public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary<string, object> viewModelState)
{
base.OnNavigatedTo(e, viewModelState);
Directory = DirectoryService.Instance;
StartDirectoryListing();
_isNavigatingBack = false;
}
public override void OnNavigatingFrom(NavigatingFromEventArgs e, Dictionary<string, object> viewModelState, bool suspending)
{
_isNavigatingBack = true;
if (!suspending)
{
Directory.StopDirectoryListing();
Directory = null;
_selectedFileOrFolder = null;
}
base.OnNavigatingFrom(e, viewModelState, suspending);
}
public DirectoryService Directory
{
get { return _directoryService; }
private set { SetProperty(ref _directoryService, value); }
}
public Settings Settings
{
get { return _settngs; }
private set { SetProperty(ref _settngs, value); }
}
public ResourceInfo SelectedFileOrFolder
{
get { return _selectedFileOrFolder; }
set
{
if (_isNavigatingBack)
{
return;
}
try
{
if (!SetProperty(ref _selectedFileOrFolder, value))
{
return;
}
}
catch
{
_selectedPathIndex = -1;
return;
}
if (value == null)
{
return;
}
if (Directory?.PathStack == null)
{
return;
}
if (Directory.IsSorting)
{
return;
}
if (value.IsDirectory())
{
Directory.PathStack.Add(new PathInfo
{
ResourceInfo = value
});
SelectedPathIndex = Directory.PathStack.Count - 1;
}
else
{
var parameters = new FileInfoPageParameters
{
ResourceInfo = value
};
_navigationService.Navigate(PageTokens.FileInfo.ToString(), parameters.Serialize());
}
}
}
public int SelectedPathIndex
{
get { return _selectedPathIndex; }
set
{
try
{
if (!SetProperty(ref _selectedPathIndex, value))
{
return;
}
}
catch
{
_selectedPathIndex = -1;
return;
}
if (Directory?.PathStack == null)
{
return;
}
while (Directory.PathStack.Count > 0 && Directory.PathStack.Count > _selectedPathIndex + 1)
{
Directory.PathStack.RemoveAt(Directory.PathStack.Count - 1);
}
StartDirectoryListing();
}
}
private async void StartDirectoryListing()
{
ShowProgressIndicator();
await Directory.StartDirectoryListing();
HideProgressIndicator();
}
public override bool CanRevertState()
{
return SelectedPathIndex > 0;
}
public override void RevertState()
{
SelectedPathIndex--;
}
}
}

Просмотреть файл

@ -0,0 +1,263 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.Windows.Input;
using Windows.Networking.Connectivity;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Imaging;
using NextcloudApp.Converter;
using NextcloudApp.Models;
using NextcloudApp.Services;
using NextcloudApp.Utils;
using NextcloudClient.Exceptions;
using Prism.Commands;
using Prism.Windows.Navigation;
using NextcloudClient.Types;
using Prism.Windows.AppModel;
namespace NextcloudApp.ViewModels
{
public class FileInfoPageViewModel : ViewModel
{
private readonly INavigationService _navigationService;
private readonly IResourceLoader _resourceLoader;
private readonly DialogService _dialogService;
private DirectoryService _directoryService;
private ResourceInfo _resourceInfo;
private string _fileExtension;
private string _fileName;
private string _fileSizeString;
private int _selectedPathIndex = -1;
private BitmapImage _thumbnail;
public ICommand DownloadCommand { get; private set; }
public ICommand DeleteResourceCommand { get; private set; }
public FileInfoPageViewModel(INavigationService navigationService, IResourceLoader resourceLoader, DialogService dialogService)
{
_navigationService = navigationService;
_resourceLoader = resourceLoader;
_dialogService = dialogService;
Directory = DirectoryService.Instance;
//DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();
//dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(ShareImageHandler);
DownloadCommand = new DelegateCommand(() =>
{
var parameters = new SingleFileDownloadPageParameters
{
ResourceInfo = ResourceInfo
};
_navigationService.Navigate(PageTokens.SingleFileDownload.ToString(), parameters.Serialize());
});
DeleteResourceCommand = new DelegateCommand(DeleteResource);
}
public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary<string, object> viewModelState)
{
base.OnNavigatedTo(e, viewModelState);
foreach(var path in Directory.PathStack)
{
PathStack.Add(path);
}
var parameters = FileInfoPageParameters.Deserialize(e.Parameter);
var resourceInfo = parameters?.ResourceInfo;
if (resourceInfo == null)
{
return;
}
PathStack.Add(new PathInfo
{
ResourceInfo = resourceInfo
});
ResourceInfo = resourceInfo;
FileExtension = Path.GetExtension(ResourceInfo.Name);
FileName = Path.GetFileNameWithoutExtension(ResourceInfo.Name);
var converter = new BytesToHumanReadableConverter();
FileSizeString = LocalizationService.Instance.GetString(
"FileSizeString",
converter.Convert(ResourceInfo.Size, typeof(string), null, CultureInfo.CurrentCulture.ToString()),
ResourceInfo.Size
);
DownloadPreviewImages();
}
public override void OnNavigatingFrom(NavigatingFromEventArgs e, Dictionary<string, object> viewModelState, bool suspending)
{
if (!suspending)
{
Directory.StopDirectoryListing();
Directory = null;
}
base.OnNavigatingFrom(e, viewModelState, suspending);
}
private async void DownloadPreviewImages()
{
var client = ClientService.GetClient();
if (client == null)
{
return;
}
switch (SettingsService.Instance.Settings.PreviewImageDownloadMode)
{
case PreviewImageDownloadMode.Always:
break;
case PreviewImageDownloadMode.WiFiOnly:
var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
// connectionProfile can be null (e.g. airplane mode)
if (connectionProfile == null || !connectionProfile.IsWlanConnectionProfile)
{
return;
}
break;
case PreviewImageDownloadMode.Never:
return;
default:
throw new ArgumentOutOfRangeException();
}
try
{
Stream stream = null;
try
{
stream = await client.GetThumbnail(ResourceInfo, 120, 120);
}
catch (ResponseError e)
{
ResponseErrorHandlerService.HandleException(e);
}
if (stream == null)
{
return;
}
var bitmap = new BitmapImage();
using (var memStream = new MemoryStream())
{
await stream.CopyToAsync(memStream);
memStream.Position = 0;
bitmap.SetSource(memStream.AsRandomAccessStream());
}
Thumbnail = bitmap;
}
catch (ResponseError)
{
Thumbnail = new BitmapImage
{
UriSource = new Uri("ms-appx:///Assets/Images/ThumbnailNotFound.png")
};
}
}
public BitmapImage Thumbnail
{
get { return _thumbnail; }
set
{
if (_thumbnail == value)
{
return;
}
_thumbnail = value;
OnPropertyChanged();
}
}
public string FileSizeString
{
get { return _fileSizeString; }
private set { SetProperty(ref _fileSizeString, value); }
}
public string FileExtension
{
get { return _fileExtension; }
private set { SetProperty(ref _fileExtension, value); }
}
public string FileName
{
get { return _fileName; }
private set { SetProperty(ref _fileName, value); }
}
public ResourceInfo ResourceInfo
{
get { return _resourceInfo; }
private set { SetProperty(ref _resourceInfo, value); }
}
public DirectoryService Directory
{
get { return _directoryService; }
private set { SetProperty(ref _directoryService, value); }
}
public ObservableCollection<PathInfo> PathStack { get; } = new ObservableCollection<PathInfo>();
public int SelectedPathIndex
{
get { return _selectedPathIndex; }
set
{
if (!SetProperty(ref _selectedPathIndex, value))
{
return;
}
if (_selectedPathIndex == PathStack.Count - 1)
{
// file name was selected, just return
return;
}
while (Directory.PathStack.Count > 0 && Directory.PathStack.Count > _selectedPathIndex + 1)
{
Directory.PathStack.RemoveAt(Directory.PathStack.Count - 1);
}
_navigationService.GoBack();
}
}
private async void DeleteResource()
{
if (ResourceInfo == null)
{
return;
}
var dialog = new ContentDialog
{
Title = _resourceLoader.GetString(ResourceInfo.ContentType.Equals("dav/directory") ? "DeleteFolder" : "DeleteFile"),
Content = new TextBlock()
{
Text = string.Format(_resourceLoader.GetString(ResourceInfo.ContentType.Equals("dav/directory") ? "DeleteFolder_Description" : "DeleteFile_Description"), ResourceInfo.Name),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = _resourceLoader.GetString("Yes"),
SecondaryButtonText = _resourceLoader.GetString("No")
};
var dialogResult = await _dialogService.ShowAsync(dialog);
if (dialogResult != ContentDialogResult.Primary)
{
return;
}
ShowProgressIndicator();
var success = await DirectoryService.Instance.DeleteResource(ResourceInfo);
HideProgressIndicator();
if (success)
{
_navigationService.GoBack();
}
}
}
}

Просмотреть файл

@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using Windows.ApplicationModel.Core;
using Windows.Storage;
using Windows.Storage.Pickers;
using Windows.UI.Core;
using Windows.Web.Http;
using NextcloudApp.Converter;
using NextcloudApp.Models;
using NextcloudApp.Services;
using NextcloudClient.Exceptions;
using Prism.Windows.Navigation;
using NextcloudClient.Types;
using Prism.Windows.AppModel;
namespace NextcloudApp.ViewModels
{
public class FileUploadPageViewModel : ViewModel
{
private readonly INavigationService _navigationService;
private ResourceInfo _resourceInfo;
private string _uploadingFilesTitle;
private readonly IResourceLoader _resourceLoader;
private readonly DialogService _dialogService;
private string _uploadingFileProgressText;
private int _percentageUploaded;
private int _bytesSend;
private long _bytesTotal;
private readonly BytesToHumanReadableConverter _converter;
private CancellationTokenSource _cts;
private StorageFile _currentFile;
public FileUploadPageViewModel(INavigationService navigationService, IResourceLoader resourceLoader, DialogService dialogService)
{
_navigationService = navigationService;
_resourceLoader = resourceLoader;
_dialogService = dialogService;
_converter = new BytesToHumanReadableConverter();
}
public string UploadingFilesTitle
{
get { return _uploadingFilesTitle; }
private set { SetProperty(ref _uploadingFilesTitle, value); }
}
public string UploadingFileProgressText
{
get { return _uploadingFileProgressText; }
private set { SetProperty(ref _uploadingFileProgressText, value); }
}
public override async void OnNavigatingFrom(NavigatingFromEventArgs e, Dictionary<string, object> viewModelState, bool suspending)
{
base.OnNavigatingFrom(e, viewModelState, suspending);
if (!suspending)
{
// Let Windows know that we're finished changing the file so
// the other app can update the remote version of the file.
// Completing updates may require Windows to ask for user input.
if (_currentFile != null)
{
await CachedFileManager.CompleteUpdatesAsync(_currentFile);
}
_cts?.Cancel();
}
}
public override async void OnNavigatedTo(NavigatedToEventArgs e, Dictionary<string, object> viewModelState)
{
base.OnNavigatedTo(e, viewModelState);
var client = ClientService.GetClient();
if (client == null)
{
return;
}
_cts = new CancellationTokenSource();
var parameters = FileUploadPageParameters.Deserialize(e.Parameter);
var resourceInfo = parameters?.ResourceInfo;
if (resourceInfo == null)
{
return;
}
ResourceInfo = resourceInfo;
SuggestedStartLocation = parameters.PickerLocationId;
UploadingFilesTitle = null;
UploadingFileProgressText = null;
var i = 0;
var openPicker = new FileOpenPicker
{
SuggestedStartLocation = SuggestedStartLocation
};
openPicker.FileTypeFilter.Add("*");
var storageFiles = await openPicker.PickMultipleFilesAsync();
foreach (var localFile in storageFiles)
{
_currentFile = localFile;
// Prevent updates to the remote version of the file until
// we finish making changes and call CompleteUpdatesAsync.
CachedFileManager.DeferUpdates(localFile);
if (storageFiles.Count > 1)
{
UploadingFilesTitle = string.Format(_resourceLoader.GetString("UploadingFiles"), ++i, storageFiles.Count);
}
try
{
var properties = await localFile.GetBasicPropertiesAsync();
BytesTotal = (long) properties.Size;
var stream = await localFile.OpenAsync(FileAccessMode.ReadWrite);
IProgress<HttpProgress> progress = new Progress<HttpProgress>(ProgressHandler);
await client.Upload(ResourceInfo.Path + localFile.Name, stream, localFile.ContentType, _cts, progress);
}
catch (ResponseError e2)
{
ResponseErrorHandlerService.HandleException(e2);
}
// Let Windows know that we're finished changing the file so
// the other app can update the remote version of the file.
// Completing updates may require Windows to ask for user input.
await CachedFileManager.CompleteUpdatesAsync(localFile);
UploadingFileProgressText = null;
}
_navigationService.GoBack();
}
private PickerLocationId SuggestedStartLocation { get; set; }
private async void ProgressHandler(HttpProgress progressInfo)
{
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
if (progressInfo.TotalBytesToSend != null)
{
BytesTotal = (long)progressInfo.TotalBytesToSend;
}
BytesSend = (int)progressInfo.BytesSent;
});
}
public int PercentageUploaded
{
get { return _percentageUploaded; }
private set { SetProperty(ref _percentageUploaded, value); }
}
public int BytesSend
{
get { return _bytesSend; }
private set {
if (SetProperty(ref _bytesSend, value))
{
Update();
}
}
}
public long BytesTotal
{
get { return _bytesTotal; }
private set
{
if (SetProperty(ref _bytesTotal, value))
{
Update();
}
}
}
public ResourceInfo ResourceInfo
{
get { return _resourceInfo; }
private set { SetProperty(ref _resourceInfo, value); }
}
private void Update()
{
var percentage = (double)BytesSend / BytesTotal;
PercentageUploaded = (int)(percentage * 100);
UploadingFileProgressText = string.Format(
_resourceLoader.GetString("UploadingFileProgress"),
_converter.Convert((long)BytesSend, typeof(string), null,
CultureInfo.CurrentCulture.ToString()),
_converter.Convert(BytesTotal, typeof(string), null,
CultureInfo.CurrentCulture.ToString())
);
}
}
}

Просмотреть файл

@ -0,0 +1,219 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.Foundation.Metadata;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using NextcloudApp.Services;
using NextcloudClient.Exceptions;
using Prism.Commands;
using Prism.Windows.AppModel;
using Prism.Windows.Navigation;
namespace NextcloudApp.ViewModels
{
public class LoginPageViewModel : ViewModel
{
private readonly INavigationService _navigationService;
private string _serverAddress;
private string _username;
private string _password;
private Color? _statusBarBackgroundColor;
private Color? _statusBarForegroundColor;
private double _keyboardHeight;
private bool _isKeyboardVisible;
private bool _isLoading;
private readonly DialogService _dialogService;
private readonly IResourceLoader _resourceLoader;
public string ServerAddress
{
get { return _serverAddress; }
set { SetProperty(ref _serverAddress, value); }
}
public string Username
{
get { return _username; }
set { SetProperty(ref _username, value); }
}
public string Password
{
get { return _password; }
set { SetProperty(ref _password, value); }
}
public double KeyboardHeight
{
get { return _keyboardHeight; }
set { SetProperty(ref _keyboardHeight, value); }
}
public bool IsKeyboardVisible
{
get { return _isKeyboardVisible; }
set { SetProperty(ref _isKeyboardVisible, value); }
}
public bool IsLoading
{
get { return _isLoading; }
set { SetProperty(ref _isLoading, value); }
}
public ICommand SaveSettingsCommand { get; private set; }
public LoginPageViewModel(INavigationService navigationService, IResourceLoader resourceLoader, DialogService dialogService)
{
_navigationService = navigationService;
_resourceLoader = resourceLoader;
_dialogService = dialogService;
SaveSettingsCommand = new DelegateCommand(SaveSettings);
}
public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary<string, object> dictionary)
{
base.OnNavigatedTo(e, dictionary);
if (!ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
return;
}
var statusBar = StatusBar.GetForCurrentView();
if (statusBar == null)
{
return;
}
var applicationView = ApplicationView.GetForCurrentView();
applicationView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
_statusBarBackgroundColor = statusBar.BackgroundColor;
_statusBarForegroundColor = statusBar.ForegroundColor;
statusBar.BackgroundOpacity = 0;
statusBar.BackgroundColor = Color.FromArgb(255, 0, 130, 201);
statusBar.ForegroundColor = Colors.White;
InputPane.GetForCurrentView().Showing += OnShowing;
InputPane.GetForCurrentView().Hiding += OnHiding;
}
public override void OnNavigatingFrom(NavigatingFromEventArgs e, Dictionary<string, object> viewModelState, bool suspending)
{
base.OnNavigatingFrom(e, viewModelState, suspending);
if (!ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
return;
}
var statusBar = StatusBar.GetForCurrentView();
if (statusBar == null)
{
return;
}
statusBar.BackgroundOpacity = 1;
statusBar.BackgroundColor = _statusBarBackgroundColor;
statusBar.ForegroundColor = _statusBarForegroundColor;
var applicationView = ApplicationView.GetForCurrentView();
applicationView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible);
InputPane.GetForCurrentView().Showing -= OnShowing;
InputPane.GetForCurrentView().Hiding -= OnHiding;
}
private void OnShowing(InputPane sender, InputPaneVisibilityEventArgs args)
{
KeyboardHeight = args.OccludedRect.Height;
IsKeyboardVisible = true;
}
private void OnHiding(InputPane sender, InputPaneVisibilityEventArgs args)
{
KeyboardHeight = 0;
IsKeyboardVisible = false;
}
public async void SaveSettings()
{
IsLoading = true;
var serverIsUpAndRunning = await CheckServerStatus();
var userLoginIsValid = await CheckUserLogin();
IsLoading = false;
if (serverIsUpAndRunning && userLoginIsValid)
{
SettingsService.Instance.Settings.ServerAddress = ServerAddress;
SettingsService.Instance.Settings.Username = Username;
SettingsService.Instance.Settings.Password = Password;
_navigationService.Navigate(PageTokens.DirectoryList.ToString(), null);
}
}
private async Task<bool> CheckServerStatus()
{
try
{
var status = await NextcloudClient.NextcloudClient.GetServerStatus(ServerAddress);
if (!status.Installed)
{
var dialog = new ContentDialog
{
Title = _resourceLoader.GetString("AnErrorHasOccurred"),
Content = new TextBlock
{
Text = _resourceLoader.GetString("Auth_Unauthorized"),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = _resourceLoader.GetString("OK")
};
await _dialogService.ShowAsync(dialog);
return false;
}
if (status.Maintenance)
{
var dialog = new ContentDialog
{
Title = _resourceLoader.GetString("AnErrorHasOccurred"),
Content = new TextBlock
{
Text = _resourceLoader.GetString("Auth_MaintenanceEnabled"),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = _resourceLoader.GetString("OK")
};
await _dialogService.ShowAsync(dialog);
return false;
}
}
catch (ResponseError e)
{
ResponseErrorHandlerService.HandleException(e);
return false;
}
return true;
}
private async Task<bool> CheckUserLogin()
{
try
{
return await NextcloudClient.NextcloudClient.CheckUserLogin(ServerAddress, Username, Password);
}
catch (ResponseError)
{
return false;
}
}
}
}

Просмотреть файл

@ -0,0 +1,233 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Net;
using Windows.Networking.Connectivity;
using Windows.Storage;
using NextcloudApp.Converter;
using NextcloudApp.Models;
using NextcloudApp.Services;
using NextcloudApp.Utils;
using NextcloudClient.Exceptions;
using NextcloudClient.Types;
using Prism.Commands;
using Prism.Events;
using Prism.Windows.AppModel;
using Prism.Windows.Navigation;
namespace NextcloudApp.ViewModels
{
public class MenuViewModel : ViewModel
{
private const string CurrentPageTokenKey = "CurrentPageToken";
private readonly Dictionary<PageTokens, bool> _canNavigateLookup;
private PageTokens _currentPageToken;
private readonly INavigationService _navigationService;
private readonly ISessionStateService _sessionStateService;
private bool _showMenuButton;
private bool _isMenuOpen;
private User _user;
private Uri _userAvatarUrl;
private string _quotaUsedOfTotalString;
public MenuViewModel(IEventAggregator eventAggregator, INavigationService navigationService, IResourceLoader resourceLoader, ISessionStateService sessionStateService)
{
eventAggregator.GetEvent<NavigationStateChangedEvent>().Subscribe(OnNavigationStateChanged);
_navigationService = navigationService;
_sessionStateService = sessionStateService;
Commands = new ObservableCollection<MenuItem>
{
new MenuItem
{
DisplayName = resourceLoader.GetString("AllFiles"),
FontIcon = "\uE8B7",
Command = new DelegateCommand(
() => NavigateToPage(PageTokens.DirectoryList),
() => CanNavigateToPage(PageTokens.DirectoryList)
)
},
};
ExtraCommands = new ObservableCollection<MenuItem>
{
new MenuItem
{
DisplayName = resourceLoader.GetString("Settings"),
FontIcon = "\uE713",
Command = new DelegateCommand(
() => NavigateToPage(PageTokens.Settings),
() => CanNavigateToPage(PageTokens.Settings)
)
},
};
SettingsService.Instance.Settings.PropertyChanged += (sender, args) =>
{
GetUserInformation();
};
GetUserInformation();
_canNavigateLookup = new Dictionary<PageTokens, bool>();
foreach (PageTokens pageToken in Enum.GetValues(typeof(PageTokens)))
{
_canNavigateLookup.Add(pageToken, true);
}
if (!_sessionStateService.SessionState.ContainsKey(CurrentPageTokenKey))
{
return;
}
// Resuming, so update the menu to reflect the current page correctly
PageTokens currentPageToken;
if (!Enum.TryParse(_sessionStateService.SessionState[CurrentPageTokenKey].ToString(), out currentPageToken))
{
return;
}
UpdateCanNavigateLookup(currentPageToken);
RaiseCanExecuteChanged();
}
private async void GetUserInformation()
{
var client = ClientService.GetClient();
if (client == null)
{
return;
}
var localSettings = ApplicationData.Current.LocalSettings;
var username = (string)localSettings.Values["username"];
try {
User = await client.GetUserAttributes(username);
var converter = new BytesToHumanReadableConverter();
QuotaUsedOfTotalString = LocalizationService.Instance.GetString(
"QuotaUsedOfTotal",
converter.Convert(User.Quota.Used, typeof(string), null, CultureInfo.CurrentCulture.ToString()),
converter.Convert(User.Quota.Total, typeof(string), null, CultureInfo.CurrentCulture.ToString())
);
switch (SettingsService.Instance.Settings.PreviewImageDownloadMode)
{
case PreviewImageDownloadMode.Always:
UserAvatarUrl = client.GetUserAvatarUrl(username, 120);
break;
case PreviewImageDownloadMode.WiFiOnly:
var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
// connectionProfile can be null (e.g. airplane mode)
if (connectionProfile != null && connectionProfile.IsWlanConnectionProfile)
{
UserAvatarUrl = client.GetUserAvatarUrl(username, 120);
}
break;
case PreviewImageDownloadMode.Never:
break;
default:
throw new ArgumentOutOfRangeException();
}
}
catch (ResponseError e)
{
ResponseErrorHandlerService.HandleException(e);
}
}
public string QuotaUsedOfTotalString
{
get { return _quotaUsedOfTotalString; }
set { SetProperty(ref _quotaUsedOfTotalString, value); }
}
public User User
{
get { return _user; }
set { SetProperty(ref _user, value); }
}
public Uri UserAvatarUrl
{
get { return _userAvatarUrl; }
set { SetProperty(ref _userAvatarUrl, value); }
}
public ObservableCollection<MenuItem> Commands { get; set; }
public ObservableCollection<MenuItem> ExtraCommands { get; set; }
private void OnNavigationStateChanged(NavigationStateChangedEventArgs args)
{
PageTokens currentPageToken;
if (!Enum.TryParse(args.Sender.Content.GetType().Name.Replace("Page", string.Empty), out currentPageToken))
{
return;
}
_sessionStateService.SessionState[CurrentPageTokenKey] = currentPageToken.ToString();
UpdateCanNavigateLookup(currentPageToken);
RaiseCanExecuteChanged();
}
private void NavigateToPage(PageTokens pageToken)
{
if (!CanNavigateToPage(pageToken))
{
return;
}
if (!_navigationService.Navigate(pageToken.ToString(), null))
{
return;
}
UpdateCanNavigateLookup(pageToken);
RaiseCanExecuteChanged();
}
private bool CanNavigateToPage(PageTokens pageToken)
{
return _canNavigateLookup[pageToken];
}
private void UpdateCanNavigateLookup(PageTokens navigatedTo)
{
if (navigatedTo == _currentPageToken)
{
return;
}
_canNavigateLookup[_currentPageToken] = true;
_canNavigateLookup[navigatedTo] = false;
_currentPageToken = navigatedTo;
ShowMenuButton =
_currentPageToken != PageTokens.Login &&
_currentPageToken != PageTokens.SingleFileDownload &&
_currentPageToken != PageTokens.FileUpload;
IsMenuOpen = false;
}
public bool ShowMenuButton
{
get { return _showMenuButton; }
set { SetProperty(ref _showMenuButton, value); }
}
public bool IsMenuOpen
{
get { return _isMenuOpen; }
set { SetProperty(ref _isMenuOpen, value); }
}
private void RaiseCanExecuteChanged()
{
foreach (var item in Commands)
{
var delegateCommand = item.Command as DelegateCommand;
delegateCommand?.RaiseCanExecuteChanged();
}
foreach (var item in ExtraCommands)
{
var delegateCommand = item.Command as DelegateCommand;
delegateCommand?.RaiseCanExecuteChanged();
}
}
}
}

Просмотреть файл

@ -0,0 +1,134 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Input;
using Windows.ApplicationModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using NextcloudApp.Models;
using NextcloudApp.Services;
using Prism.Commands;
using Prism.Windows.Navigation;
using Windows.UI.Xaml.Data;
using NextcloudApp.Utils;
using Prism.Windows.AppModel;
namespace NextcloudApp.ViewModels
{
public class SettingsPageViewModel : ViewModel
{
private readonly INavigationService _navigationService;
private Settings _settngs;
private int _previewImageDownloadModesSelectedIndex;
private IResourceLoader _resourceLoader;
private string _serverVersion;
public ICommand ResetCommand { get; private set; }
public SettingsPageViewModel(INavigationService navigationService, IResourceLoader resourceLoader)
{
_navigationService = navigationService;
_resourceLoader = resourceLoader;
Settings = SettingsService.Instance.Settings;
PreviewImageDownloadModes.Add(new PreviewImageDownloadModeItem
{
Name = resourceLoader.GetString("Always"),
Value = PreviewImageDownloadMode.Always
});
PreviewImageDownloadModes.Add(new PreviewImageDownloadModeItem
{
Name = resourceLoader.GetString("WiFiOnly"),
Value = PreviewImageDownloadMode.WiFiOnly
});
PreviewImageDownloadModes.Add(new PreviewImageDownloadModeItem
{
Name = resourceLoader.GetString("Never"),
Value = PreviewImageDownloadMode.Never
});
switch (Settings.PreviewImageDownloadMode)
{
case PreviewImageDownloadMode.Always:
PreviewImageDownloadModesSelectedIndex = 0;
break;
case PreviewImageDownloadMode.WiFiOnly:
PreviewImageDownloadModesSelectedIndex = 1;
break;
case PreviewImageDownloadMode.Never:
PreviewImageDownloadModesSelectedIndex = 2;
break;
default:
throw new ArgumentOutOfRangeException();
}
ResetCommand = new DelegateCommand(Reset);
GetServerVersion();
}
private async void GetServerVersion()
{
var status = await NextcloudClient.NextcloudClient.GetServerStatus(Settings.ServerAddress);
if (!string.IsNullOrEmpty(status.VersionString))
{
ServerVersion = string.Format(_resourceLoader.GetString("ServerVersion"), status.VersionString);
}
}
public string ServerVersion
{
get { return _serverVersion; }
private set { SetProperty(ref _serverVersion, value); }
}
public Settings Settings
{
get { return _settngs; }
private set { SetProperty(ref _settngs, value); }
}
public List<PreviewImageDownloadModeItem> PreviewImageDownloadModes { get; } =
new List<PreviewImageDownloadModeItem>() {};
public int PreviewImageDownloadModesSelectedIndex
{
get { return _previewImageDownloadModesSelectedIndex; }
set
{
if (!SetProperty(ref _previewImageDownloadModesSelectedIndex, value))
{
return;
}
switch (value)
{
case 0:
Settings.PreviewImageDownloadMode = PreviewImageDownloadMode.Always;
break;
case 1:
Settings.PreviewImageDownloadMode = PreviewImageDownloadMode.WiFiOnly;
break;
case 2:
Settings.PreviewImageDownloadMode = PreviewImageDownloadMode.Never;
break;
}
}
}
public string AppVersion
=>
string.Format(_resourceLoader.GetString("ClientVersion"),
$"{Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}.{Package.Current.Id.Version.Revision}")
;
private void Reset()
{
SettingsService.Instance.Reset();
_navigationService.Navigate(PageTokens.Login.ToString(), null);
}
}
}

Просмотреть файл

@ -0,0 +1,191 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Windows.ApplicationModel.Core;
using Windows.Storage;
using Windows.Storage.Pickers;
using Windows.UI.Core;
using Windows.Web.Http;
using NextcloudApp.Converter;
using NextcloudApp.Models;
using NextcloudApp.Services;
using NextcloudClient.Exceptions;
using Prism.Windows.Navigation;
using NextcloudClient.Types;
using Prism.Windows.AppModel;
namespace NextcloudApp.ViewModels
{
public class SingleFileDownloadPageViewModel : ViewModel
{
private readonly INavigationService _navigationService;
private CancellationTokenSource _cts;
private readonly BytesToHumanReadableConverter _converter;
private readonly IResourceLoader _resourceLoader;
private int _bytesDownloaded;
private int _percentageDownloaded;
private long _bytesTotal;
private ResourceInfo _resourceInfo;
private string _downloadingFileProgressText;
private StorageFile _currentFile;
public SingleFileDownloadPageViewModel(INavigationService navigationService, IResourceLoader resourceLoader)
{
_navigationService = navigationService;
_resourceLoader = resourceLoader;
_converter = new BytesToHumanReadableConverter();
}
public override async void OnNavigatingFrom(NavigatingFromEventArgs e, Dictionary<string, object> viewModelState, bool suspending)
{
base.OnNavigatingFrom(e, viewModelState, suspending);
if (!suspending)
{
// Let Windows know that we're finished changing the file so
// the other app can update the remote version of the file.
// Completing updates may require Windows to ask for user input.
if (_currentFile != null)
{
await CachedFileManager.CompleteUpdatesAsync(_currentFile);
}
_cts?.Cancel();
}
}
public override async void OnNavigatedTo(NavigatedToEventArgs e, Dictionary<string, object> viewModelState)
{
base.OnNavigatedTo(e, viewModelState);
var client = ClientService.GetClient();
if (client == null)
{
return;
}
_cts = new CancellationTokenSource();
var parameters = SingleFileDownloadPageParameters.Deserialize(e.Parameter);
var resourceInfo = parameters?.ResourceInfo;
if (resourceInfo == null)
{
return;
}
ResourceInfo = resourceInfo;
var savePicker = new FileSavePicker();
savePicker.FileTypeChoices.Add(ResourceInfo.ContentType, new List<string> { Path.GetExtension(ResourceInfo.Name) });
savePicker.SuggestedFileName = ResourceInfo.Name;
var localFile = await savePicker.PickSaveFileAsync();
if (localFile == null)
{
return;
}
_currentFile = localFile;
// Prevent updates to the remote version of the file until
// we finish making changes and call CompleteUpdatesAsync.
CachedFileManager.DeferUpdates(localFile);
try
{
IProgress<HttpProgress> progress = new Progress<HttpProgress>(ProgressHandler);
var buffer = await client.Download(ResourceInfo.Path + "/" + ResourceInfo.Name, _cts, progress);
await FileIO.WriteBufferAsync(localFile, buffer);
}
catch (ResponseError e2)
{
ResponseErrorHandlerService.HandleException(e2);
}
// Let Windows know that we're finished changing the file so
// the other app can update the remote version of the file.
// Completing updates may require Windows to ask for user input.
var status = await CachedFileManager.CompleteUpdatesAsync(localFile);
if (status == Windows.Storage.Provider.FileUpdateStatus.Complete)
{
//this.textBlock.Text = "Path " + file.Name + " was saved.";
}
else
{
//this.textBlock.Text = "Path " + file.Name + " couldn't be saved.";
}
_navigationService.GoBack();
}
private async void ProgressHandler(HttpProgress progressInfo)
{
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
if (progressInfo.TotalBytesToReceive != null)
{
BytesTotal = (long)progressInfo.TotalBytesToReceive;
}
BytesDownloaded = (int)progressInfo.BytesReceived;
});
}
public int PercentageDownloaded
{
get { return _percentageDownloaded; }
private set { SetProperty(ref _percentageDownloaded, value); }
}
public int BytesDownloaded
{
get { return _bytesDownloaded; }
private set
{
if (SetProperty(ref _bytesDownloaded, value))
{
Update();
}
}
}
public long BytesTotal
{
get { return _bytesTotal; }
private set
{
if (SetProperty(ref _bytesTotal, value))
{
Update();
}
}
}
public ResourceInfo ResourceInfo
{
get { return _resourceInfo; }
private set { SetProperty(ref _resourceInfo, value); }
}
public string DownloadingFileProgressText
{
get { return _downloadingFileProgressText; }
private set { SetProperty(ref _downloadingFileProgressText, value); }
}
private void Update()
{
var percentage = (double)BytesDownloaded / BytesTotal;
PercentageDownloaded = (int)(percentage * 100);
DownloadingFileProgressText = string.Format(
_resourceLoader.GetString("DownloadingFileProgress"),
_converter.Convert((long)BytesDownloaded, typeof(string), null,
CultureInfo.CurrentCulture.ToString()),
_converter.Convert(BytesTotal, typeof(string), null,
CultureInfo.CurrentCulture.ToString())
);
}
}
}

Просмотреть файл

@ -0,0 +1,28 @@
using NextcloudApp.Services;
using NextcloudApp.Utils;
using Prism.Windows.Mvvm;
namespace NextcloudApp.ViewModels
{
public class ViewModel : ViewModelBase, IRevertState
{
internal void ShowProgressIndicator()
{
StatusBarService.Instance.ShowProgressIndicator();
}
internal void HideProgressIndicator()
{
StatusBarService.Instance.HideProgressIndicator();
}
public virtual bool CanRevertState()
{
return false;
}
public virtual void RevertState()
{
}
}
}

Просмотреть файл

@ -0,0 +1,366 @@
<prismMvvm:SessionStateAwarePage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prismMvvm="using:Prism.Windows.Mvvm"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
xmlns:behaviors="using:NextcloudApp.Behaviors"
xmlns:actions="using:NextcloudApp.Actions"
x:Class="NextcloudApp.Views.DirectoryListPage"
x:Name="Page"
mc:Ignorable="d"
prismMvvm:ViewModelLocator.AutoWireViewModel="True"
NavigationCacheMode="Enabled">
<Page.Resources>
<CollectionViewSource
x:Key="GroupedFilesAndFolders"
Source="{Binding Directory.GroupedFilesAndFolders}"
IsSourceGrouped="{Binding Settings.ShowFileAndFolderGroupingHeader}" />
</Page.Resources>
<Grid Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="48" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListBox
x:Name="PathList"
ItemsSource="{Binding Directory.PathStack}"
SelectionMode="Single"
SelectedIndex="{Binding SelectedPathIndex, Mode=TwoWay}"
Margin="48,0,0,0">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Template>
<ControlTemplate TargetType="ItemsControl">
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ResourceInfo.Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<StackPanel
Orientation="Horizontal"
Height="48">
<FontIcon
Glyph="&#xE26B;"
FontSize="8"
Margin="0,0,8,0"
Foreground="{StaticResource SystemControlHighlightAccentBrush}"
VerticalAlignment="Center"
Visibility="{Binding IsRoot, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=true}"/>
<FontIcon
Glyph="{StaticResource NextclousLogo}"
FontFamily="{StaticResource NextcloudIcons}"
Margin="8,0,8,0"
VerticalAlignment="Center"
Visibility="{Binding IsRoot, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<ContentPresenter
VerticalAlignment="Center"
Margin="0,0,8,0"
Visibility="{Binding IsRoot, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=true}" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<interactivity:Interaction.Behaviors>
<behaviors:ScrollListBoxToEndBehavior/>
</interactivity:Interaction.Behaviors>
</ListBox>
<SemanticZoom
Grid.Row="1"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<SemanticZoom.ZoomedInView>
<ListView
Name="FileOrFolderListView"
SelectedIndex="-1"
IsHoldingEnabled="True"
ItemsSource="{Binding Source={StaticResource GroupedFilesAndFolders}}"
SelectedItem="{Binding SelectedFileOrFolder, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
SelectionMode="{Binding Directory.IsSorting, Converter={StaticResource IsSortingToSelectionModeConverter}}"
Padding="0,2,0,2"
ContinuumNavigationTransitionInfo.ExitElementContainer="True">
<ListView.Resources>
<Style x:Key="FileOrFolderHeaderItemStyle" TargetType="ListViewHeaderItem">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewHeaderItem">
<ContentPresenter
x:Name="ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
Content="{TemplateBinding Content}"
Background="#00000000"
HorizontalContentAlignment="Left"
VerticalContentAlignment="Center"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.Resources>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="4,2,4,2"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.GroupStyle>
<GroupStyle HeaderContainerStyle="{StaticResource FileOrFolderHeaderItemStyle}">
<GroupStyle.ContainerStyle>
<Style TargetType="GroupItem">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GroupItem">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ContentControl
x:Name="HeaderContent"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalContentAlignment="Stretch"
ContentTransitions="{TemplateBinding ContentTransitions}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
Content="{TemplateBinding Content}"
IsTabStop="False"
Margin="0"
TabIndex="0"/>
<ItemsControl x:Name="ItemsControl" IsTabStop="False" ItemsSource="{Binding GroupItems}" Grid.Row="1" TabIndex="1" TabNavigation="Once">
<ItemsControl.ItemContainerTransitions>
<TransitionCollection>
<AddDeleteThemeTransition/>
<ContentThemeTransition/>
<ReorderThemeTransition/>
<EntranceThemeTransition IsStaggeringEnabled="False"/>
</TransitionCollection>
</ItemsControl.ItemContainerTransitions>
</ItemsControl>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock
Style="{StaticResource TitleTextBlockStyle}"
HorizontalAlignment="Stretch"
Padding="4,0,0,0"
TextWrapping="NoWrap"
TextTrimming="CharacterEllipsis"
Text="{Binding Key}"/>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListView.GroupStyle>
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid
Grid.RowSpan="2"
Height="40"
Width="40"
Margin="0,0,4,0"
Background="{StaticResource SystemControlHighlightAccentBrush}">
<FontIcon
Glyph="{Binding Converter={StaticResource ContentTypeToIconConverter}}"
FontFamily="Segoe MDL2 Assets"
FontSize="28"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Foreground="White"/>
<Border
Background="#808080"
Visibility="{Binding Thumbnail, Converter={StaticResource NullToVisibilityConverter}}">
<Image
Source="{Binding Thumbnail}"
Stretch="UniformToFill"/>
</Border>
</Grid>
<TextBlock
Grid.Row="0"
Grid.Column="1"
Text="{Binding Name}"
TextWrapping="NoWrap"
TextTrimming="CharacterEllipsis" />
<StackPanel
Grid.Row="1"
Grid.Column="1"
Orientation="Horizontal">
<TextBlock
Text="{Binding Size, Converter={StaticResource BytesToHumanReadableConverter}}"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Margin="0,0,8,0"
Visibility="{Binding Converter={StaticResource IsFileAndNotFolderToVisibilityConverter}}"/>
<TextBlock
Text="{Binding LastModified, Converter={StaticResource DateTimeToStringConverter}}"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
</StackPanel>
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Holding">
<actions:OpenMenuFlyoutAction />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
<FlyoutBase.AttachedFlyout>
<MenuFlyout>
<MenuFlyoutItem
x:Uid="Delete_Text"
Text="Delete"
Command="{Binding DataContext.DeleteResourceCommand, ElementName=Page}"
CommandParameter="{Binding}"/>
<!--
<MenuFlyoutItem
x:Uid="Download"
Text="Download"
Command="{Binding DataContext.DownloadCommand, ElementName=Page}"
CommandParameter="{Binding}"/>
-->
</MenuFlyout>
</FlyoutBase.AttachedFlyout>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</SemanticZoom.ZoomedInView>
<SemanticZoom.ZoomedOutView>
<GridView
ItemsSource="{Binding Source={StaticResource GroupedFilesAndFolders}, Path=CollectionGroups}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center">
<GridView.ItemTemplate>
<DataTemplate>
<Border
Background="Transparent"
MinWidth="52"
MinHeight="52"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock
Text="{Binding Group.Key}"
Style="{StaticResource TitleTextBlockStyle}"
TextWrapping="NoWrap"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="8"/>
</Border>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
</SemanticZoom.ZoomedOutView>
</SemanticZoom>
<CommandBar Grid.Row="2" VerticalAlignment="Bottom">
<CommandBar.SecondaryCommands>
<AppBarButton
Icon="Sync"
Label="Refresh"
x:Uid="AppBarRefresh"
Command="{Binding RefreshCommand}"/>
</CommandBar.SecondaryCommands>
<AppBarButton Icon="Sort" Label="Sort" x:Uid="AppBarSort">
<AppBarButton.Flyout>
<MenuFlyout>
<MenuFlyoutItem
x:Uid="AppBarSort_Flyout_ByNameASC"
Text="Name (A nach oben)"
Command="{Binding GroupByNameAscendingCommand}"/>
<MenuFlyoutItem
x:Uid="AppBarSort_Flyout_ByNameDESC"
Text="Name (Z nach oben)"
Command="{Binding GroupByNameDescendingCommand}"/>
<MenuFlyoutSeparator/>
<MenuFlyoutItem
x:Uid="AppBarSort_Flyout_ByDateDESC"
Text="Datum (Neueste nach oben)"
Command="{Binding GroupByDateDescendingCommand}"/>
<MenuFlyoutItem
x:Uid="AppBarSort_Flyout_ByDateASC"
Text="Datum (Älteste nach oben)"
Command="{Binding GroupByDateAscendingCommand}"/>
<MenuFlyoutSeparator/>
<MenuFlyoutItem
x:Uid="AppBarSort_Flyout_BySizeASC"
Text="Größe (Kleinste nach oben)"
Command="{Binding GroupBySizeAscendingCommand}"/>
<MenuFlyoutItem
x:Uid="AppBarSort_Flyout_BySizeDESC"
Text="Größe (Größte nach oben)"
Command="{Binding GroupBySizeDescendingCommand}"/>
</MenuFlyout>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton Icon="Add" Label="Add" x:Uid="AppBarAdd">
<AppBarButton.Flyout>
<MenuFlyout>
<MenuFlyoutItem
Tag="NewFolder"
x:Uid="AppBarAdd_Flyout_CreateFolder"
Text="Create folder"
Style="{StaticResource MenuFlyoutIconItemStyle}"
Command="{Binding CreateDirectoryCommand}"/>
<MenuFlyoutSeparator/>
<MenuFlyoutItem
Tag="Add"
x:Uid="AppBarAdd_Flyout_UploadFiles"
Text="Upload files"
Style="{StaticResource MenuFlyoutIconItemStyle}"
Command="{Binding UploadFilesCommand}" />
<MenuFlyoutItem
Tag="Street"
x:Uid="AppBarAdd_Flyout_UploadPhotos"
Text="Upload photos"
Style="{StaticResource MenuFlyoutIconItemStyle}"
Command="{Binding UploadPhotosCommand}" />
<!--MenuFlyoutItem
Tag="Camera"
x:Uid="AppBarAdd_Flyout_TakePicture"
Text="Take picture"
Style="{StaticResource MenuFlyoutIconItemStyle}" /-->
</MenuFlyout>
</AppBarButton.Flyout>
</AppBarButton>
</CommandBar>
</Grid>
</prismMvvm:SessionStateAwarePage>

Просмотреть файл

@ -0,0 +1,12 @@
using Prism.Windows.Mvvm;
namespace NextcloudApp.Views
{
public sealed partial class DirectoryListPage : SessionStateAwarePage
{
public DirectoryListPage()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,283 @@
<prismMvvm:SessionStateAwarePage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prismMvvm="using:Prism.Windows.Mvvm"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:behaviors="using:NextcloudApp.Behaviors"
x:Class="NextcloudApp.Views.FileInfoPage"
mc:Ignorable="d"
prismMvvm:ViewModelLocator.AutoWireViewModel="True">
<Grid Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="48" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListBox
x:Name="PathList"
ItemsSource="{Binding PathStack}"
SelectionMode="Single"
SelectedIndex="{Binding SelectedPathIndex, Mode=TwoWay}"
Margin="48,0,0,0">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Template>
<ControlTemplate TargetType="ItemsControl">
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ResourceInfo.Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<StackPanel
Orientation="Horizontal"
Height="48">
<FontIcon
Glyph="&#xE26B;"
FontSize="8"
Margin="0,0,8,0"
Foreground="{StaticResource SystemControlHighlightAccentBrush}"
VerticalAlignment="Center"
Visibility="{Binding IsRoot, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=true}"/>
<FontIcon
Glyph="{StaticResource NextclousLogo}"
FontFamily="{StaticResource NextcloudIcons}"
Margin="8,0,8,0"
VerticalAlignment="Center"
Visibility="{Binding IsRoot, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<ContentPresenter
VerticalAlignment="Center"
Margin="0,0,8,0"
Visibility="{Binding IsRoot, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=true}" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<interactivity:Interaction.Behaviors>
<behaviors:ScrollListBoxToEndBehavior/>
</interactivity:Interaction.Behaviors>
</ListBox>
<ScrollViewer Grid.Row="1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Orientation="Vertical">
<Grid Margin="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid
Height="100"
Width="100"
Background="{StaticResource SystemControlHighlightAccentBrush}">
<FontIcon
Glyph="{Binding ResourceInfo, Converter={StaticResource ContentTypeToIconConverter}}"
FontFamily="Segoe MDL2 Assets"
FontSize="80"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Foreground="White"/>
<Border
Background="#808080"
Visibility="{Binding Thumbnail, Converter={StaticResource NullToVisibilityConverter}}">
<Image
Source="{Binding Thumbnail}"
Stretch="UniformToFill"/>
</Border>
</Grid>
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="8,0,0,0">
<TextBlock
Text="{Binding ResourceInfo.Name}"
TextWrapping="Wrap"/>
<StackPanel
Orientation="Horizontal">
<TextBlock
Text="{Binding ResourceInfo.Size, Converter={StaticResource BytesToHumanReadableConverter}}"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Margin="0,0,8,0"/>
<TextBlock
Text="{Binding ResourceInfo.LastModified, Converter={StaticResource DateTimeToStringConverter}}"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" />
</StackPanel>
</StackPanel>
</Grid>
<TextBlock
Text="Information"
x:Uid="Information"
Style="{StaticResource TitleTextBlockStyle}"
Margin="8"/>
<Border Margin="8,0" Background="{ThemeResource SystemControlForegroundBaseMediumBrush}" Height="1" />
<Grid Margin="8,0,8,8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock
Grid.Row="0"
Grid.Column="0"
Text="Name"
x:Uid="Name"
Margin="0,8,8,8"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
<TextBlock
Grid.Row="0"
Grid.Column="1"
Text="{Binding FileName}"
Margin="0,8"
TextWrapping="Wrap"/>
<TextBlock
Grid.Row="1"
Grid.Column="0"
Text="Path"
x:Uid="Path"
Margin="0,8,8,8"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
<TextBlock
Grid.Row="1"
Grid.Column="1"
Text="{Binding ResourceInfo.Path, Converter={StaticResource AddSlashToPathConverter}}"
Margin="0,8"
TextWrapping="Wrap"/>
<TextBlock
Grid.Row="2"
Grid.Column="0"
Text="Type"
x:Uid="Type"
Margin="0,8,8,8"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
<TextBlock
Grid.Row="2"
Grid.Column="1"
Text="{Binding FileExtension}"
Margin="0,8"
TextWrapping="Wrap"/>
<TextBlock
Grid.Row="3"
Grid.Column="0"
Text="Content-Type"
x:Uid="ContentType"
Margin="0,8,8,8"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
<TextBlock
Grid.Row="3"
Grid.Column="1"
Text="{Binding ResourceInfo.ContentType}"
Margin="0,8"
TextWrapping="Wrap"/>
<TextBlock
Grid.Row="4"
Grid.Column="0"
Text="Size"
x:Uid="Size"
Margin="0,8,8,8"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
<TextBlock
Grid.Row="4"
Grid.Column="1"
Text="{Binding FileSizeString}"
Margin="0,8"
TextWrapping="Wrap"/>
<TextBlock
Grid.Row="5"
Grid.Column="0"
Text="ETag"
x:Uid="ETag"
Margin="0,8,8,8"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
<TextBlock
Grid.Row="5"
Grid.Column="1"
Text="{Binding ResourceInfo.ETag}"
Margin="0,8"
TextWrapping="Wrap"/>
<TextBlock
Grid.Row="6"
Grid.Column="0"
Text="Last modified"
x:Uid="LastModified"
Margin="0,8,8,8"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
<TextBlock
Grid.Row="6"
Grid.Column="1"
Text="{Binding ResourceInfo.LastModified, Converter={StaticResource DateTimeToStringConverter}}"
Margin="0,8"
TextWrapping="Wrap"/>
<TextBlock
Grid.Row="7"
Grid.Column="0"
Text="Created"
x:Uid="Created"
Margin="0,8,8,8"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"/>
<TextBlock
Grid.Row="7"
Grid.Column="1"
Text="{Binding ResourceInfo.Created, Converter={StaticResource DateTimeToStringConverter}}"
Margin="0,8"
TextWrapping="Wrap"/>
</Grid>
</StackPanel>
</ScrollViewer>
<CommandBar Grid.Row="2" VerticalAlignment="Bottom">
<AppBarButton
Icon="Delete"
Label="Delete"
x:Uid="Delete_Label"
Command="{Binding DeleteResourceCommand}"/>
<AppBarButton
Icon="Download"
Label="Download"
x:Uid="AppBarDownload"
Command="{Binding DownloadCommand}"/>
</CommandBar>
</Grid>
</prismMvvm:SessionStateAwarePage>

Просмотреть файл

@ -0,0 +1,17 @@
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Prism.Windows.Mvvm;
namespace NextcloudApp.Views
{
public sealed partial class FileInfoPage : SessionStateAwarePage
{
public FileInfoPage()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,38 @@
<prismMvvm:SessionStateAwarePage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converter="using:NextcloudApp.Converter"
xmlns:prismMvvm="using:Prism.Windows.Mvvm"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:behaviors="using:NextcloudApp.Behaviors"
x:Class="NextcloudApp.Views.FileUploadPage"
mc:Ignorable="d"
prismMvvm:ViewModelLocator.AutoWireViewModel="True">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock
x:Uid="UploadingTheFile"
Text="Uploading the file…"
Style="{StaticResource TitleTextBlockStyle}"
Visibility="{Binding UploadingFilesTitle, Converter={StaticResource NullToVisibilityConverter}, ConverterParameter=true}"
Margin="24"/>
<TextBlock
Text="{Binding UploadingFilesTitle}"
Style="{StaticResource TitleTextBlockStyle}"
Visibility="{Binding UploadingFilesTitle, Converter={StaticResource NullToVisibilityConverter}}"
Margin="24"/>
<ProgressBar
Minimum="0"
Value="{Binding PercentageUploaded}"
Maximum="100"/>
<TextBlock
Text="{Binding UploadingFileProgressText}"
HorizontalAlignment="Right"
Margin="0,12,0,0"/>
</StackPanel>
</Grid>
</prismMvvm:SessionStateAwarePage>

Просмотреть файл

@ -0,0 +1,12 @@
using Prism.Windows.Mvvm;
namespace NextcloudApp.Views
{
public sealed partial class FileUploadPage : SessionStateAwarePage
{
public FileUploadPage()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,85 @@
<prismMvvm:SessionStateAwarePage
x:Class="NextcloudApp.Views.LoginPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:prismMvvm="using:Prism.Windows.Mvvm"
prismMvvm:ViewModelLocator.AutoWireViewModel="True"
RequestedTheme="Dark">
<Grid Background="#0082C9">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ScrollViewer
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
VerticalScrollBarVisibility="Hidden">
<StackPanel
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="20">
<FontIcon
Glyph="{StaticResource NextclousLogo}"
FontFamily="{StaticResource NextcloudIcons}"
FontSize="88"
Margin="0,0,0,20" />
<TextBox
x:Uid="ServerAddress"
Header="Server address"
PlaceholderText="https://..."
InputScope="Url"
Text="{Binding ServerAddress, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
BorderBrush="White"
Background="Transparent"
Margin="0,0,0,20"/>
<TextBox
x:Uid="Username"
Header="Username"
InputScope="EmailNameOrAddress"
Text="{Binding Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
BorderBrush="White"
Background="Transparent"
Margin="0,0,0,20"/>
<PasswordBox
x:Uid="Password"
Header="Password"
Password="{Binding Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
BorderBrush="White"
Background="Transparent"
Margin="0,0,0,32"/>
<Button
x:Uid="Connect"
Content="Connect"
HorizontalAlignment="Center"
Background="White"
Foreground="#0082C9"
Command="{Binding SaveSettingsCommand}"/>
</StackPanel>
</ScrollViewer>
<!-- mimic the keyboard taking up space -->
<Grid
Grid.Row="1"
Name="FooterPlaceholder"
Visibility="{Binding IsKeyboardVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
Height="{Binding KeyboardHeight}"/>
<Grid
Grid.Row="0"
Grid.RowSpan="2"
Background="#990082C9"
Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}">
<ProgressRing Foreground="White" Width="100" Height="100" IsActive="True"/>
</Grid>
</Grid>
</prismMvvm:SessionStateAwarePage>

Просмотреть файл

@ -0,0 +1,17 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Prism.Windows.Mvvm;
namespace NextcloudApp.Views
{
public sealed partial class LoginPage : SessionStateAwarePage
{
public LoginPage()
{
InitializeComponent();
}
private void ConnectButton_OnClick(object sender, RoutedEventArgs e)
{
}
}
}

Просмотреть файл

@ -0,0 +1,128 @@
<UserControl x:Class="NextcloudApp.Views.MenuView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:NextcloudApp.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prismMvvm="using:Prism.Windows.Mvvm"
xmlns:viewModels="using:NextcloudApp.ViewModels"
xmlns:models="using:NextcloudApp.Models"
prismMvvm:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d">
<UserControl.Resources>
<DataTemplate x:Key="MenuItemTemplate" x:DataType="models:MenuItem">
<Grid>
<Button
AutomationProperties.Name="{Binding DisplayName}"
Command="{Binding Command}"
Style="{StaticResource SplitViewMenuButtonStyle}"
ToolTipService.ToolTip="{Binding DisplayName}">
<StackPanel Orientation="Horizontal">
<FontIcon Glyph="{Binding FontIcon}" Style="{StaticResource SplitViewMenuFontIconStyle}" />
<TextBlock
AutomationProperties.AccessibilityView="Raw"
Style="{StaticResource SplitViewMenuItemTextStyle}"
Text="{Binding DisplayName}" />
</StackPanel>
</Button>
</Grid>
</DataTemplate>
</UserControl.Resources>
<Grid Background="{ThemeResource SystemControlBackgroundBaseLowBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="MenuStates">
<VisualState x:Name="Wide">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="1280" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="menuItemsControl.Margin" Value="0" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Medium">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="800" />
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="Narrow" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="1" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Margin="12,60,12,12" Height="52">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Ellipse
Grid.Row="0"
Grid.Column="0"
Grid.RowSpan="4"
Height="52"
Width="52"
Margin="0,0,8,0">
<Ellipse.Fill>
<ImageBrush ImageSource="{Binding UserAvatarUrl}"/>
</Ellipse.Fill>
</Ellipse>
<TextBlock
Grid.Row="0"
Grid.Column="1"
Text="{Binding User.DisplayName}"
FontSize="12"
TextTrimming="CharacterEllipsis"/>
<TextBlock
Grid.Row="1"
Grid.Column="1"
Text="{Binding User.EMail}"
FontSize="8"
Foreground="{ThemeResource SystemControlDisabledBaseLowBrush}"
TextTrimming="CharacterEllipsis"/>
<ProgressBar
Grid.Row="2"
Grid.Column="1"
Minimum="0"
Value="{Binding User.Quota.Used}"
Maximum="{Binding User.Quota.Total}"/>
<TextBlock
Grid.Row="3"
Grid.Column="1"
Text="{Binding QuotaUsedOfTotalString}"
FontSize="12"
TextTrimming="CharacterEllipsis"/>
</Grid>
<ItemsControl
Grid.Row="1"
IsTabStop="False"
ItemTemplate="{StaticResource MenuItemTemplate}"
ItemsSource="{Binding Commands}" />
<Border
Grid.Row="2"
BorderThickness="1"
Margin="12,0,12,0"
BorderBrush="{ThemeResource SystemControlBackgroundBaseMediumBrush}"
Name="Separator"/>
<ItemsControl
Grid.Row="3"
Margin="0"
IsTabStop="False"
ItemTemplate="{StaticResource MenuItemTemplate}"
ItemsSource="{Binding ExtraCommands}" />
</Grid>
</UserControl>

Просмотреть файл

@ -0,0 +1,12 @@
using Windows.UI.Xaml.Controls;
namespace NextcloudApp.Views
{
public sealed partial class MenuView : UserControl
{
public MenuView()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,80 @@
<prismMvvm:SessionStateAwarePage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converter="using:NextcloudApp.Converter"
xmlns:prismMvvm="using:Prism.Windows.Mvvm"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:behaviors="using:NextcloudApp.Behaviors"
x:Class="NextcloudApp.Views.SettingsPage"
mc:Ignorable="d"
prismMvvm:ViewModelLocator.AutoWireViewModel="True">
<Grid Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="48" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="Settings" x:Uid="Settings2" Margin="48,0,0,0" VerticalAlignment="Center"/>
<Grid Grid.Row="1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="0">
<StackPanel Orientation="Vertical" Margin="12">
<!--
<ToggleSwitch
x:Uid="ShowGrouping"
Header="Show file and folder list grouping header"
Margin="0,12"
IsOn="{Binding Settings.ShowFileAndFolderGroupingHeader, Mode=TwoWay}"/>
-->
<ComboBox
Header="Download preview images"
x:Uid="DownloadPreviewImages"
ItemsSource="{Binding PreviewImageDownloadModes}"
SelectedIndex="{Binding PreviewImageDownloadModesSelectedIndex, Mode=TwoWay}"
Margin="0,12"/>
<Border
Margin="0,12"
Background="{ThemeResource SystemControlForegroundBaseMediumBrush}"
Height="1" />
<Button
x:Uid="ReseTthisApp"
Content="Reset this app"
Margin="0,12"
Command="{Binding ResetCommand}"/>
</StackPanel>
</ScrollViewer>
<Border
Grid.Row="1"
Margin="0,12"
Background="{ThemeResource SystemControlForegroundBaseMediumBrush}"
Height="1" />
<StackPanel Grid.Row="2">
<TextBlock
Text="{Binding ServerVersion}"
Visibility="{Binding ServerVersion, Converter={StaticResource NullToVisibilityConverter}}"
Margin="0,0,0,12"
HorizontalAlignment="Center"/>
<TextBlock
Text="{Binding AppVersion}"
Margin="0,0,0,12"
HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
</Grid>
</prismMvvm:SessionStateAwarePage>

Просмотреть файл

@ -0,0 +1,17 @@
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Prism.Windows.Mvvm;
namespace NextcloudApp.Views
{
public sealed partial class SettingsPage : SessionStateAwarePage
{
public SettingsPage()
{
InitializeComponent();
}
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше