Add models
This commit is contained in:
Родитель
89cb398b43
Коммит
533032e671
|
@ -53,7 +53,7 @@
|
|||
<Reference Include="System.Numerics.Vectors" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.6.0.1141" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1451" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
<Reference Include="System.Numerics.Vectors" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.6.0.1141" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1451" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
|
|
|
@ -11,7 +11,11 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.6.0.1141" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1451" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ElectionGuardCore.Ui\ElectionGuardCore.Ui.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -4,4 +4,8 @@
|
|||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ElectionGuardCore\ElectionGuardCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -8,7 +8,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElectionGuardCore.Ui.Forms.
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectionGuardCore.Ui.Forms", "ElectionGuardCore.Ui.Forms\ElectionGuardCore.Ui.Forms.csproj", "{15A45C17-4DC1-406B-9E3E-C89DBABC9615}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElectionGuardCore.Ui", "ElectionGuardCore.Ui\ElectionGuardCore.Ui.csproj", "{361529CA-4E38-461D-8366-79268921CECF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectionGuardCore.Ui", "ElectionGuardCore.Ui\ElectionGuardCore.Ui.csproj", "{361529CA-4E38-461D-8366-79268921CECF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElectionGuardCore", "ElectionGuardCore\ElectionGuardCore.csproj", "{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -68,6 +70,18 @@ Global
|
|||
{361529CA-4E38-461D-8366-79268921CECF}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{361529CA-4E38-461D-8366-79268921CECF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{361529CA-4E38-461D-8366-79268921CECF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{7BFA01C0-0525-4CF3-BA4E-3FA52F6D9F43}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public class BallotStyle
|
||||
{
|
||||
public string ObjectId { get; set; }
|
||||
public List<string> GeopoliticalUnitIds { get; set; }
|
||||
public List<string> PartyIds { get; set; }
|
||||
public string ImageUri { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using ElectionGuardCore.Models;
|
||||
|
||||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public class Candidate
|
||||
{
|
||||
public string ObjectId { get; set; }
|
||||
public InternationalizedText BallotName { get; set; }
|
||||
public string PartyId { get; set; }
|
||||
public string ImageUri { get; set; }
|
||||
public bool? IsWriteIn { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System.Collections.Generic;
|
||||
using ElectionGuardCore.Models;
|
||||
|
||||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public class ContestDescription
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string ObjectId { get; set; }
|
||||
public int SequenceOrder { get; set; }
|
||||
public List<SelectionDescription> BallotSelections { get; set; }
|
||||
public InternationalizedText BallotTitle { get; set; }
|
||||
public InternationalizedText BallotSubtitle { get; set; }
|
||||
public VoteVariationType? VoteVariation { get; set; }
|
||||
public string ElectoralDistrictId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public List<string> PrimaryPartyIds { get; set; }
|
||||
public int? NumberElected { get; set; }
|
||||
public int? VotesAllowed { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public static class ContestTypes
|
||||
{
|
||||
public static readonly string Unknown = "unknown";
|
||||
public static readonly string Candidate = "CandidateContest";
|
||||
public static readonly string Referendum = "ReferendumContest";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ElectionGuardCore.Models;
|
||||
|
||||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public class ElectionDescription
|
||||
{
|
||||
public string ElectionScopeId { get; set; }
|
||||
public InternationalizedText Name { get; set; }
|
||||
public ElectionType? Type { get; set; }
|
||||
public ContactInformation ContactInformation { get; set; }
|
||||
public DateTime? StartDate { get; set; }
|
||||
public DateTime? EndDate { get; set; }
|
||||
public List<Candidate> Candidates { get; set; }
|
||||
public List<Party> Parties { get; set; }
|
||||
public List<ContestDescription> Contests { get; set; }
|
||||
public List<BallotStyle> BallotStyles { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public enum ElectionType
|
||||
{
|
||||
Unknown = 0,
|
||||
General = 1,
|
||||
PartisanPrimaryClosed = 2,
|
||||
PartisanPrimaryOpen = 3,
|
||||
Primary = 4,
|
||||
Runoff = 5,
|
||||
Special = 6,
|
||||
Other = 7
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
using ElectionGuardCore.Models;
|
||||
|
||||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public class GeopoliticalUnit
|
||||
{
|
||||
public string ObjectId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public ReportingUnitType? Type { get; set; }
|
||||
public ContactInformation ContactInfo { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using ElectionGuardCore.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public class Party
|
||||
{
|
||||
public string ObjectId { get; set; }
|
||||
public string Abbreviation { get; set; }
|
||||
public string Color { get; set; }
|
||||
public string Uri { get; set; }
|
||||
[JsonProperty("Name")]
|
||||
public InternationalizedText BallotName { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public enum ReportingUnitType
|
||||
{
|
||||
Unknown = 0,
|
||||
BallotBatch = 1,
|
||||
BallotStyleArea = 2,
|
||||
Borough = 3,
|
||||
City = 4,
|
||||
CityCouncil = 5,
|
||||
CombinedPrecinct = 6,
|
||||
Congressional = 7,
|
||||
Country = 8,
|
||||
County = 9,
|
||||
CountyCouncil = 10,
|
||||
DropBox = 11,
|
||||
Judicial = 12,
|
||||
Municipality = 13,
|
||||
PollingPlace = 14,
|
||||
Precinct = 15,
|
||||
School = 16,
|
||||
Special = 17,
|
||||
SplitPrecinct = 18,
|
||||
State = 19,
|
||||
StateHouse = 20,
|
||||
StateSenate = 21,
|
||||
Township = 22,
|
||||
Utility = 23,
|
||||
Village = 24,
|
||||
VoteCenter = 25,
|
||||
Ward = 26,
|
||||
Water = 27,
|
||||
Other = 28
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public class SelectionDescription
|
||||
{
|
||||
public string ObjectId { get; set; }
|
||||
public string CandidateId { get; set; }
|
||||
public ulong SequenceOrder { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
namespace ElectionGuardCore.Elections
|
||||
{
|
||||
public enum VoteVariationType
|
||||
{
|
||||
Unknown = 0,
|
||||
OneOfM = 1,
|
||||
Approval = 2,
|
||||
Borda = 3,
|
||||
Cumulative = 4,
|
||||
Majority = 5,
|
||||
NOfM = 6,
|
||||
Plurality = 7,
|
||||
Proportional = 8,
|
||||
Range = 9,
|
||||
Rcv = 10,
|
||||
SuperMajority = 11,
|
||||
Other = 12
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
namespace ElectionGuardCore.Models
|
||||
{
|
||||
public class AnnotatedString
|
||||
{
|
||||
public string Annotation { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace ElectionGuardCore.Models
|
||||
{
|
||||
public class ContactInformation
|
||||
{
|
||||
public string AddressLine { get; set; }
|
||||
public string Name { get; set; }
|
||||
public List<AnnotatedString> Email { get; set; }
|
||||
public List<AnnotatedString> Phone { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace ElectionGuardCore.Models
|
||||
{
|
||||
public class InternationalizedText
|
||||
{
|
||||
public LanguageText Text { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
namespace ElectionGuardCore.Models
|
||||
{
|
||||
public class LanguageText
|
||||
{
|
||||
public string Value { get; set; }
|
||||
public string Language { get; set; }
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче