C# Class Electro.ElectroController

显示文件 Open project: HackerDom/ructfe-2015 Class Usage Examples

Public Methods

Method Description
DumpElections ( ) : IEnumerable
ElectroController ( IEnumerable elections, PrivateKey>.IEnumerable keys, AuthController authController, StatePersister statePersister ) : System
FindElectionForUser ( System.Guid electionId, User user ) : Election
GetFinishedElections ( int top = int.MaxValue ) : IEnumerable
GetUnfinishedPublicElections ( int top = int.MaxValue ) : IEnumerable
NominateCandidate ( System.Guid electionId, User user ) : Election
StartElection ( string electionName, User firstCandidate, bool isPublic, System.DateTime nominateTill, System.DateTime till ) : System.Guid
TryDecryptElectionResultIfFinished ( Election election ) : bool
Vote ( System.Guid electionId, User user, System.Numerics.BigInteger voteArray ) : bool

Private Methods

Method Description
LoadState ( IEnumerable e, PrivateKey>.IEnumerable k ) : void
TryMerge ( System.Numerics.BigInteger voteResults, Vote v ) : System.Numerics.BigInteger[]

Method Details

DumpElections() public method

public DumpElections ( ) : IEnumerable
return IEnumerable

ElectroController() public method

public ElectroController ( IEnumerable elections, PrivateKey>.IEnumerable keys, AuthController authController, StatePersister statePersister ) : System
elections IEnumerable
keys PrivateKey>.IEnumerable
authController AuthController
statePersister StatePersister
return System

FindElectionForUser() public method

public FindElectionForUser ( System.Guid electionId, User user ) : Election
electionId System.Guid
user Electro.Model.User
return Electro.Model.Election

GetFinishedElections() public method

public GetFinishedElections ( int top = int.MaxValue ) : IEnumerable
top int
return IEnumerable

GetUnfinishedPublicElections() public method

public GetUnfinishedPublicElections ( int top = int.MaxValue ) : IEnumerable
top int
return IEnumerable

NominateCandidate() public method

public NominateCandidate ( System.Guid electionId, User user ) : Election
electionId System.Guid
user Electro.Model.User
return Electro.Model.Election

StartElection() public method

public StartElection ( string electionName, User firstCandidate, bool isPublic, System.DateTime nominateTill, System.DateTime till ) : System.Guid
electionName string
firstCandidate Electro.Model.User
isPublic bool
nominateTill System.DateTime
till System.DateTime
return System.Guid

TryDecryptElectionResultIfFinished() public method

public TryDecryptElectionResultIfFinished ( Election election ) : bool
election Electro.Model.Election
return bool

Vote() public method

public Vote ( System.Guid electionId, User user, System.Numerics.BigInteger voteArray ) : bool
electionId System.Guid
user Electro.Model.User
voteArray System.Numerics.BigInteger
return bool