示例#1
0
        private bool determineIsUpgrade(ApplicationDataContainer container, PackageVersion packageVersion)
        {
            var persistedAppVersion = LastApplicationVersion;

            if (persistedAppVersion == null)
            {
                return(false);
            }

            var currentAppVersion = ApplicationInfoBuilder.GetAppVersion(packageVersion);

            return(!(currentAppVersion.Equals(persistedAppVersion)));
        }
示例#2
0
        public void Initialize(PackageVersion packageVersion)
        {
            dataContainer =
                ApplicationData.Current.LocalSettings.CreateContainer(options.DataContainer, ApplicationDataCreateDisposition.Always);

            IsFirstRun = determineIsFirstRun(dataContainer);
            if (IsFirstRun)
            {
                FirstRunTimeMillis = DateTimeOffset.Now.ToUnixTimeMilliseconds();
            }

            IsUpgrade = determineIsUpgrade(dataContainer, packageVersion);
            LastApplicationVersion = ApplicationInfoBuilder.GetAppVersion(packageVersion);
        }