Nexus.Client.MainFormVM.ViewIsShown C# (CSharp) Method

ViewIsShown() public method

Notifies the view model that the view has been displayed.
public ViewIsShown ( ) : void
return void
		public void ViewIsShown()
		{
			if (EnvironmentInfo.Settings.CheckForUpdatesOnStartup)
			{
				if (String.IsNullOrEmpty(EnvironmentInfo.Settings.LastUpdateCheckDate))
				{
					UpdateProgramme(true);
					EnvironmentInfo.Settings.LastUpdateCheckDate = DateTime.Today.ToShortDateString();
					EnvironmentInfo.Settings.Save();
				}
				else
				{
					try
					{
						if ((DateTime.Today - Convert.ToDateTime(EnvironmentInfo.Settings.LastUpdateCheckDate)).TotalDays >= EnvironmentInfo.Settings.UpdateCheckInterval)
						{
							UpdateProgramme(true);
							EnvironmentInfo.Settings.LastUpdateCheckDate = DateTime.Today.ToShortDateString();
							EnvironmentInfo.Settings.Save();
						}
					}
					catch
					{
						EnvironmentInfo.Settings.LastUpdateCheckDate = "";
						EnvironmentInfo.Settings.Save();
					}
				}
			}
		}