/// <summary> /// Default constructor. /// Creates voting storage instance. /// </summary> public SmsVotingControlPage() { InitializeComponent(); _votingStorage = new ATT.Controls.SmsVotingFileStorage(FileName, ShortCode); controlVoting.SmsVotingStorage = _votingStorage; controlVoting.SmsShortCode = ShortCode; shortCodeValue.Text = ShortCode; }
/// <summary> /// Default constructor. /// Creates voting storage instance. /// </summary> public SmsVotingControlPage() { InitializeComponent(); _votingStorage = new ATT.Controls.SmsVotingFileStorage(FileName, ShortCode); controlVoting.SmsVotingStorage = _votingStorage; controlVoting.SmsShortCode = ShortCode; shortCodeValue.Text = ShortCode; }
/// <summary> /// Creates instance of <see cref="SmsVotingControlPresenter"/> /// </summary> /// <param name="smsVotingStorage">storage used to store incoming SMS messages</param> /// <param name="smsService">SMS service implementation</param> /// <param name="shortCode">short code to be used for getting incoming SMS messages</param> /// <param name="smsPollInterval">interval between SMS messages polling</param> public SmsVotingControlPresenter(ISmsVotingStorage smsVotingStorage, ISmsService smsService, string shortCode, int smsPollInterval = 500) { Argument.ExpectNotNullOrWhiteSpace(() => shortCode); Argument.ExpectNotNull(() => smsVotingStorage); Argument.ExpectNotNull(() => smsService); Argument.Expect(() => smsPollInterval > 0, "smsPollInterval", "smsPollInterval should be positive"); _shortCode = shortCode; _smsVotingStorage = smsVotingStorage; _smsService = smsService; _smsPollInterval = smsPollInterval; UpdateCommand = new RelayCommand(UpdateVotingStatistics); }