public static bool ShouldWeShowRegistrationDialog()
{
//there is no point registering if we are are developer/tester
string feedbackSetting = System.Environment.GetEnvironmentVariable("FEEDBACK");
if (!string.IsNullOrEmpty(feedbackSetting) && feedbackSetting.ToLowerInvariant() != "yes" &&
feedbackSetting.ToLowerInvariant() != "true")
return false;
if (!_haveRegisteredLaunch)//in case the client app calls this more then once during a single run (like Bloom does when opening a different collection)
{
_haveRegisteredLaunch=true;
if (SIL.Windows.Forms.Registration.Registration.Default.NeedUpgrade)
{
//see http://stackoverflow.com/questions/3498561/net-applicationsettingsbase-should-i-call-upgrade-every-time-i-load
SIL.Windows.Forms.Registration.Registration.Default.Upgrade();
SIL.Windows.Forms.Registration.Registration.Default.NeedUpgrade = false;
SIL.Windows.Forms.Registration.Registration.Default.Save();
}
SIL.Windows.Forms.Registration.Registration.Default.LaunchCount++;
SIL.Windows.Forms.Registration.Registration.Default.Save();
}
return SIL.Windows.Forms.Registration.Registration.Default.LaunchCount > 2 &&
(
string.IsNullOrWhiteSpace(SIL.Windows.Forms.Registration.Registration.Default.FirstName) ||
string.IsNullOrWhiteSpace(SIL.Windows.Forms.Registration.Registration.Default.Surname) ||
string.IsNullOrWhiteSpace(SIL.Windows.Forms.Registration.Registration.Default.Organization) ||
string.IsNullOrWhiteSpace(SIL.Windows.Forms.Registration.Registration.Default.Email)
);
}