Skip to content
Open

Dev #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions FileManager.Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public static class Constants
{
public const string Resources = "FileManager.Resources";
public const string StringResources = "Resources";
public const string StringResources = "FileManager.Resources/Resources";
public const string Image = "image";
public const string Video = "video";
public const string Audio = "audio";
Expand Down Expand Up @@ -31,7 +31,6 @@ public static class Constants
public const string ConnectionError = "connectionError";
public const string ResponseError = "responseError";
public const string ConnectionErrorContent = "connectionErrorContent";
public const string Failed = "failed";
public const string AccessToken = "access_token";
public const string ExpiresIn = "expires_in";
public const string UrlencodedContentType = "application/x-www-form-urlencoded";
Expand Down Expand Up @@ -67,7 +66,7 @@ public static class Constants
public const string FreeSpaceKey = "System.FreeSpace";
public const string RamIcon = "ramIcon";
public const string DiskStorageIcon = "diskStorage";
public const string Success = "Success";
public const string Failed = "failed";
public const string RefreshToken = "refresh_token";
public const string TokenType = "token_type";
public const string Scope = "scope";
Expand All @@ -78,5 +77,9 @@ public static class Constants
public const string InformationPage = "InformationPage";
public const string GoogleDrivePage = "GoogleDrivePage";
public const string FtpPage = "FtpPage";
public const string OneDrivePage = "OneDrivePage";
public const string FileControl = "FileControl";
public const string OnlineFileControl = "OnlineFileControl";
public const string InformationControl = "InformationControl";
}
}
80 changes: 80 additions & 0 deletions FileManager.Helpers/ControlExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;

namespace FileManager.Helpers
{
public static class ControlExtensions
{
public static async Task GoToVisualStateAsync(this Control control, FrameworkElement visualStatesHost, string stateGroupName, string stateName)
{
if (control != null)
{
var taskCompletionSource = new TaskCompletionSource<Storyboard>();

var storyboard = GetStoryboardForVisualState(visualStatesHost, stateGroupName, stateName);
if (storyboard != null)
{
EventHandler<object> handler = null;
handler = (s, e) =>
{
storyboard.Completed -= handler;
taskCompletionSource.SetResult(storyboard);
};

storyboard.Completed += handler;
}

VisualStateManager.GoToState(control, stateName, true);

if (storyboard != null)
{
await taskCompletionSource.Task;
}
}
}

private static Storyboard GetStoryboardForVisualState(FrameworkElement visualStatesHost, string stateGroupName, string stateName)
{
Storyboard storyboard = null;

if (visualStatesHost != null)
{
VisualStateGroup stateGroup = null;
var stateGroups = VisualStateManager.GetVisualStateGroups(visualStatesHost);
if (!string.IsNullOrEmpty(stateGroupName))
{
stateGroup = stateGroups.FirstOrDefault(visualStateGroup => visualStateGroup.Name == stateGroupName);
}

VisualState state = null;
if (stateGroup != null)
{
state = stateGroup.States.FirstOrDefault(visualState => visualState.Name == stateName);
}

if (state == null)
{
foreach (var group in stateGroups)
{
state = group.States.FirstOrDefault(visualState => visualState.Name == stateName);
if (state != null)
{
break;
}
}
}

if (state != null)
{
storyboard = state.Storyboard;
}
}

return storyboard;
}
}
}
13 changes: 13 additions & 0 deletions FileManager.Helpers/Enums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace FileManager.Helpers
{
public enum Enums
{
Failed,
Success,
FullBattery = 100,
BitDischargedBattery = 76,
HalfBattery = 51,
ThirdBattery = 31,
LowBattery = 21,
}
}
2 changes: 2 additions & 0 deletions FileManager.Helpers/FileManager.Helpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@
<ItemGroup>
<Compile Include="Commands\RelayCommand.cs" />
<Compile Include="Constants.cs" />
<Compile Include="ControlExtensions.cs" />
<Compile Include="DoubleTapAttachedProperties.cs" />
<Compile Include="Enums.cs" />
<Compile Include="ItemClickAttachedProperties.cs" />
<Compile Include="OnNavigateWebViewAttachedProperties.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
11 changes: 11 additions & 0 deletions FileManager.Models/ColorMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Windows.ApplicationModel.Resources;
using Windows.UI;

namespace FileManager.Models
{
public class ColorMode
{
public Color BackgroundColor { get; set; }
public ResourceLoader ThemeResourceLoader { get; set; }
}
}
11 changes: 11 additions & 0 deletions FileManager.Models/Dialogs/DialogResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using FileManager.Models.Enums;

namespace FileManager.Models.Dialogs
{
public class DialogResult
{
public object Value { get; set; }

public OperationResult OperationResult { get; set; }
}
}
22 changes: 22 additions & 0 deletions FileManager.Models/Enums/OperationResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace FileManager.Models.Enums
{
public enum OperationResult
{
Canceled,

Ok,

/* storage item */

Add,

Remove,

/*rate dialog*/

Rate,

Feedback

}
}
5 changes: 5 additions & 0 deletions FileManager.Models/FileManager.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="ColorMode.cs" />
<Compile Include="Dialogs\DialogResult.cs" />
<Compile Include="DriveResult.cs" />
<Compile Include="Enums\OperationResult.cs" />
<Compile Include="FtpFile.cs" />
<Compile Include="GoogleDriveFile.cs" />
<Compile Include="Interfaces\IDialog.cs" />
<Compile Include="Interfaces\IWebViewDialog.cs" />
<Compile Include="OnlineFile.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TokenResult.cs" />
Expand Down
17 changes: 17 additions & 0 deletions FileManager.Models/Interfaces/IDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using FileManager.Models.Dialogs;
using System.Threading.Tasks;

namespace FileManager.Models.Interfaces
{
public interface IDialog<T> : IDialog
{
Task<DialogResult> ShowAsync(T parameter);
}

public interface IDialog
{
void Dismiss();

void OnEnterKeyUp();
}
}
4 changes: 4 additions & 0 deletions FileManager.Models/Interfaces/IWebViewDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace FileManager.Models.Interfaces
{
public interface IAuthWebViewDialog : IDialog<object> { }
}
14 changes: 7 additions & 7 deletions FileManager.Resources/Batteries.resw
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,24 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="battery" xml:space="preserve">
<value>/Images/Battery/battery.png</value>
<value>/Assets/Images/Battery/battery.png</value>
</data>
<data name="batteryAttention" xml:space="preserve">
<value>/Images/Battery/batteryAttention.png</value>
<value>/Assets/Images/Battery/batteryAttention.png</value>
</data>
<data name="batteryCharge" xml:space="preserve">
<value>/Images/Battery/batteryCharge.png</value>
<value>/Assets/Images/Battery/batteryCharge.png</value>
</data>
<data name="emptyBattery" xml:space="preserve">
<value>/Images/Battery/emptyBattery.png</value>
<value>/Assets/Images/Battery/emptyBattery.png</value>
</data>
<data name="fullBattery" xml:space="preserve">
<value>/Images/Battery/fullBattery.png</value>
<value>/Assets/Images/Battery/fullBattery.png</value>
</data>
<data name="halfBattery" xml:space="preserve">
<value>/Images/Battery/halfBattery.png</value>
<value>/Assets/Images/Battery/halfBattery.png</value>
</data>
<data name="lowBattery" xml:space="preserve">
<value>/Images/Battery/lowBattery.png</value>
<value>/Assets/Images/Battery/lowBattery.png</value>
</data>
</root>
6 changes: 6 additions & 0 deletions FileManager.Resources/FileManager.Resources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@
<ItemGroup>
<PRIResource Include="ImagesLight.resw" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\en-US\Resources.resw" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\ru-RU\Resources.resw" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions FileManager.Resources/ImagesDark.resw
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="audio" xml:space="preserve">
<value>/Images/FileIcons/AudioDark.png</value>
<value>/Assets/Images/FileIcons/AudioDark.png</value>
</data>
<data name="file" xml:space="preserve">
<value>/Images/FileIcons/FileDark.png</value>
<value>/Assets/Images/FileIcons/FileDark.png</value>
</data>
<data name="folder" xml:space="preserve">
<value>/Images/FileIcons/FolderDark.png</value>
<value>/Assets/Images/FileIcons/FolderDark.png</value>
</data>
<data name="image" xml:space="preserve">
<value>/Images/FileIcons/ImageDark.png</value>
<value>/Assets/Images/FileIcons/ImageDark.png</value>
</data>
<data name="video" xml:space="preserve">
<value>/Images/FileIcons/VideoDark.png</value>
<value>/Assets/Images/FileIcons/VideoDark.png</value>
</data>
</root>
14 changes: 7 additions & 7 deletions FileManager.Resources/ImagesLight.resw
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,24 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="audio" xml:space="preserve">
<value>/Images/FileIcons/AudioLight.png</value>
<value>/Assets/Images/FileIcons/AudioLight.png</value>
</data>
<data name="diskStorage" xml:space="preserve">
<value>/Images/DiskStorage/diskStorage.png</value>
<value>/Assets/Images/DiskStorage/diskStorage.png</value>
</data>
<data name="file" xml:space="preserve">
<value>/Images/FIleIcons/FileLight.png</value>
<value>/Assets/Images/FIleIcons/FileLight.png</value>
</data>
<data name="folder" xml:space="preserve">
<value>/Images/FileIcons/FolderLight.jpg</value>
<value>/Assets/Images/FileIcons/FolderLight.jpg</value>
</data>
<data name="image" xml:space="preserve">
<value>/Images/FileIcons/ImageLight.png</value>
<value>/Assets/Images/FileIcons/ImageLight.png</value>
</data>
<data name="ramIcon" xml:space="preserve">
<value>/Images/ram.png</value>
<value>/Assets/Images/ram.png</value>
</data>
<data name="video" xml:space="preserve">
<value>/Images/FileIcons/VideoLight.png</value>
<value>/Assets/Images/FileIcons/VideoLight.png</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@
<data name="newFolder" xml:space="preserve">
<value>New folder</value>
</data>
<data name="OneDrivePage" xml:space="preserve">
<value>OneDrive</value>
</data>
<data name="placeHolderFileName" xml:space="preserve">
<value>Enter file name</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@
<data name="newFolder" xml:space="preserve">
<value>Новая папка</value>
</data>
<data name="OneDrivePage" xml:space="preserve">
<value>OneDrive</value>
</data>
<data name="placeHolderFolderName" xml:space="preserve">
<value>Введите название</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions FileManager.Services/FileManager.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="ThemeService.cs" />
<Compile Include="FtpService.cs" />
<Compile Include="OneDriveService.cs" />
<Compile Include="GoogleDriveService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\FileManager.Services.rd.xml" />
Expand All @@ -132,8 +134,15 @@
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.14</Version>
</PackageReference>
<PackageReference Include="ThirdPartyServices.DCT">
<Version>1.0.0.22</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FileManager.Dependencies\FileManager.Dependencies.csproj">
<Project>{AEF42671-CCBA-4303-A8DA-1C062D1D7409}</Project>
<Name>FileManager.Dependencies</Name>
</ProjectReference>
<ProjectReference Include="..\FileManager.Helpers\FileManager.Helpers.csproj">
<Project>{73f81792-c4c2-4ec2-8805-c6d19972bc3c}</Project>
<Name>FileManager.Helpers</Name>
Expand Down
Loading