/// <summary>
		/// Checks and shows the trial version form if necessary.
		/// </summary>
		public static void CheckShow()
		{
			if (!ConvertHelper.ToBoolean(
				ConfigurationManager.AppSettings[@"disableExitAdvertisementForm"])
				/*&& !ZetaResourceEditorCommandLineInfo.Current.IsNonblockingGui*/)
			{
				if (HostSettings.Current.License.LicenseType == ZreLicenseType.Freeware)
				{
					var lastExitAdvertisementShownAt =
						ConvertHelper.ToDateTime(
							PersistanceHelper.RestoreValue(@"ExitAdvertisement.LastShown"));

					if (lastExitAdvertisementShownAt <= DateTime.Now.AddDays(-1) ||
					    ConvertHelper.ToBoolean(
							ConfigurationManager.AppSettings[@"forceExitAdvertisementForm"]))
					{
						PersistanceHelper.SaveValue(@"ExitAdvertisement.LastShown", DateTime.Now);

						using (var form = new ExitAdvertisementForm())
						{
							var af = ActiveForm;
							if(af!=null)
							{
								af.Visible = false;
							}
							form.ShowDialog(af);
						}
					}
				}
			}
		}
Exemplo n.º 2
0
        /// <summary>
        /// Checks and shows the trial version form if necessary.
        /// </summary>
        public static void CheckShow()
        {
            if (!ConvertHelper.ToBoolean(
                    ConfigurationManager.AppSettings[@"disableExitAdvertisementForm"])
                /*&& !ZetaResourceEditorCommandLineInfo.Current.IsNonblockingGui*/)
            {
                if (HostSettings.Current.License.LicenseType == ZreLicenseType.Freeware)
                {
                    var lastExitAdvertisementShownAt =
                        ConvertHelper.ToDateTime(
                            PersistanceHelper.RestoreValue(@"ExitAdvertisement.LastShown"));

                    if (lastExitAdvertisementShownAt <= DateTime.Now.AddDays(-1) ||
                        ConvertHelper.ToBoolean(
                            ConfigurationManager.AppSettings[@"forceExitAdvertisementForm"]))
                    {
                        PersistanceHelper.SaveValue(@"ExitAdvertisement.LastShown", DateTime.Now);

                        using (var form = new ExitAdvertisementForm())
                        {
                            var af = ActiveForm;
                            if (af != null)
                            {
                                af.Visible = false;
                            }
                            form.ShowDialog(af);
                        }
                    }
                }
            }
        }