Reimplemented using MVVMCross (SearchResultWindow & DownloadWindow WIP)
This commit is contained in:
parent
c7308cfc29
commit
aada82693d
33 changed files with 1609 additions and 1758 deletions
30
auto-creamapi/Models/CreamConfigModel.cs
Normal file
30
auto-creamapi/Models/CreamConfigModel.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using auto_creamapi.Utils;
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
|
||||
namespace auto_creamapi.Models
|
||||
{
|
||||
public class CreamConfig
|
||||
{
|
||||
public int AppId { get; set; }
|
||||
public string Language { get; set; }
|
||||
public bool UnlockAll { get; set; }
|
||||
public bool ExtraProtection { get; set; }
|
||||
public bool ForceOffline { get; set; }
|
||||
public List<SteamApp> DlcList { get; set; }
|
||||
|
||||
public CreamConfig()
|
||||
{
|
||||
DlcList = new List<SteamApp>();
|
||||
}
|
||||
}
|
||||
public sealed class CreamConfigModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
37
auto-creamapi/Models/CreamDllModel.cs
Normal file
37
auto-creamapi/Models/CreamDllModel.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading.Tasks;
|
||||
using auto_creamapi.Services;
|
||||
using auto_creamapi.Utils;
|
||||
|
||||
namespace auto_creamapi.Models
|
||||
{
|
||||
internal class CreamDll
|
||||
{
|
||||
public readonly string Filename;
|
||||
public readonly string OrigFilename;
|
||||
public readonly string Hash;
|
||||
|
||||
public CreamDll(string filename, string origFilename)
|
||||
{
|
||||
Filename = filename;
|
||||
OrigFilename = origFilename;
|
||||
Hash = "";
|
||||
|
||||
using var md5 = MD5.Create();
|
||||
if (File.Exists(Filename))
|
||||
{
|
||||
using var stream = File.OpenRead(Filename);
|
||||
Hash = BitConverter
|
||||
.ToString(md5.ComputeHash(stream))
|
||||
.Replace("-", string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
public class CreamDllModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
38
auto-creamapi/Models/SteamAppModel.cs
Normal file
38
auto-creamapi/Models/SteamAppModel.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace auto_creamapi.Models
|
||||
{
|
||||
public class SteamApp
|
||||
{
|
||||
[JsonPropertyName("appid")]
|
||||
public int AppId { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
//return $"AppId: {AppId}, Name: {Name}";
|
||||
return $"{AppId}={Name}";
|
||||
}
|
||||
|
||||
public bool CompareId(SteamApp steamApp)
|
||||
{
|
||||
return AppId.Equals(steamApp.AppId);
|
||||
}
|
||||
}
|
||||
|
||||
public class AppList
|
||||
{
|
||||
[JsonPropertyName("apps")]
|
||||
public List<SteamApp> Apps { get; set; }
|
||||
}
|
||||
|
||||
public class SteamApps
|
||||
{
|
||||
[JsonPropertyName("applist")]
|
||||
public AppList AppList { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue