mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-28 23:19:53 +08:00
my auth
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
using System.IO;
|
||||
#if NET35
|
||||
using WinFormsApplication = System.Windows.Forms.Application;
|
||||
#endif
|
||||
|
||||
namespace System.Application
|
||||
{
|
||||
@@ -25,7 +28,12 @@ namespace System.Application
|
||||
//}
|
||||
//appDataRootPath = Path.Combine(appDataRootPath, BuildConfig.APPLICATION_ID);
|
||||
|
||||
var appDataRootPath = AppContext.BaseDirectory;
|
||||
var appDataRootPath =
|
||||
#if NET35
|
||||
WinFormsApplication.StartupPath;
|
||||
#else
|
||||
AppContext.BaseDirectory;
|
||||
#endif
|
||||
|
||||
var appDataPath = Path.Combine(appDataRootPath, AppDataDirName);
|
||||
var cachePath = Path.Combine(appDataRootPath, CacheDirName);
|
||||
|
||||
@@ -1,10 +1,34 @@
|
||||
using ReactiveUI;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace System.Application.Models
|
||||
{
|
||||
public class MyAuthenticator : ReactiveObject
|
||||
{
|
||||
public MyAuthenticator(IGAPAuthenticatorDTO data)
|
||||
{
|
||||
AuthenticatorData = data;
|
||||
}
|
||||
|
||||
public IGAPAuthenticatorDTO AuthenticatorData { get; set; }
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return AuthenticatorData.Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
AuthenticatorData.Name = value;
|
||||
this.RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void Sync() => AuthenticatorData.Value.Sync();
|
||||
|
||||
public static List<MyAuthenticator> Get(IEnumerable<IGAPAuthenticatorDTO> items)
|
||||
=> items.Select(x => new MyAuthenticator(x)).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -12,20 +12,20 @@ namespace System.Application.Models
|
||||
public class ClockInResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获得的经验值
|
||||
/// 经验值
|
||||
/// </summary>
|
||||
[MPKey(0)]
|
||||
[N_JsonProperty("0")]
|
||||
[S_JsonProperty("0")]
|
||||
public uint AddExperience { get; set; }
|
||||
public uint Experience { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得的体力值
|
||||
/// 体力值
|
||||
/// </summary>
|
||||
[MPKey(1)]
|
||||
[N_JsonProperty("1")]
|
||||
[S_JsonProperty("1")]
|
||||
public int AddStrength { get; set; }
|
||||
public int Strength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 等级
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.IO;
|
||||
#if !NET35
|
||||
using Xamarin.Essentials;
|
||||
#endif
|
||||
|
||||
namespace System
|
||||
{
|
||||
@@ -107,7 +109,11 @@ namespace System
|
||||
{
|
||||
if (getAppDataDirectory != null)
|
||||
return getAppDataDirectory();
|
||||
#if NET35
|
||||
throw new PlatformNotSupportedException();
|
||||
#else
|
||||
return FileSystem.AppDataDirectory;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +124,11 @@ namespace System
|
||||
{
|
||||
if (getCacheDirectory != null)
|
||||
return getCacheDirectory();
|
||||
#if NET35
|
||||
throw new PlatformNotSupportedException();
|
||||
#else
|
||||
return FileSystem.CacheDirectory;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,8 +189,12 @@ namespace System
|
||||
/// <returns></returns>
|
||||
public static bool IsDirectory(string ioPath)
|
||||
{
|
||||
#if NET35
|
||||
throw new PlatformNotSupportedException();
|
||||
#else
|
||||
var attr = File.GetAttributes(ioPath);
|
||||
return attr.HasFlag(FileAttributes.Directory);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user