public RoamingData() { this.InitializeComponent(); this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += navigationHelper_LoadState; //Get quota var quota = ApplicationData.Current.RoamingStorageQuota; //Usually 100KB RoamingDataQuota.Text = String.Format("{0} KB", quota.ToString()); //Roaming data - Single value RoamingSettingsSingleValue.Text = CurrentCulture.DisplayName; //Roaming data - Composite data CurrentCultureDetailed = new CultureInfo("en-US"); GetCompositeData(); //Roaming Data - DataChanged Event Handler Windows.Storage.ApplicationData.Current.DataChanged += new TypedEventHandler <Windows.Storage.ApplicationData, object>(DataChangedHandler); var roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; roamingSettings.Values["lastRoamingSettingDate"] = DateTime.Now.ToString(); Windows.Storage.ApplicationData.Current.SignalDataChanged(); //Roaming Data - Check data version VersionHelper.CheckVersion(); AppVersion.Text = VersionHelper.AppVersion.ToString(); }
private void MainForm_Load(object sender, EventArgs e) { Text = @"NecroBot2 " + Application.ProductVersion; speedLable.Parent = gMapControl1; showMoreCheckBox.Parent = gMapControl1; followTrainerCheckBox.Parent = gMapControl1; togglePrecalRoute.Parent = gMapControl1; InitializeBot(); InitializePokemonForm(); InitializeMap(); VersionHelper.CheckVersion(); showMoreCheckBox.Enabled = false; btnRefresh.Enabled = false; if (BoolNeedsSetup) { startStopBotToolStripMenuItem.Text = "■ Exit"; Logger.Write("First time here? Go to settings to set your basic info.", LogLevel.Error); } else { GlobalSettings.Load(""); } if (VersionHelper.CheckKillSwitch()) { startStopBotToolStripMenuItem.Text = "■ Exit"; } }
private void MainForm_Load(object sender, EventArgs e) { Text = @"RocketBot v" + Application.ProductVersion; //User activity tracking, help us get more information to make RocketBot better //Everything is anonymous Analytics.Initialize("UzL1tnZa9Yw2qcJWRIbcwGFmWGuovXez"); Analytics.Client.Identify(MachineIdHelper.GetMachineId(), new Traits()); Analytics.Client.Track(MachineIdHelper.GetMachineId(), "App started"); speedLable.Parent = gMapControl1; showMoreCheckBox.Parent = gMapControl1; followTrainerCheckBox.Parent = gMapControl1; togglePrecalRoute.Parent = gMapControl1; InitializeBot(); InitializePokemonForm(); InitializeMap(); VersionHelper.CheckVersion(); if (BoolNeedsSetup) { //startStopBotToolStripMenuItem.Enabled = false; Logger.Write("First time here? Go to settings to set your basic info."); GlobalSettings.Load(""); } }
private void PerformUpdateCheck() { try { // sleep some time, to give the Visual Studio possibility to load correctly: Thread.Sleep(sleepTime); VersionHelper.CheckVersion(ReceivedVersionInfo); } catch (Exception ex) { Trace.WriteLine(ex.Message); Trace.WriteLine(ex.StackTrace); } }
public static MatchReplay Deserialize(Stream fs) { var dcs = new DataContractSerializer(typeof(MatchReplay)); // rewind to start fs.Seek(0, SeekOrigin.Begin); var replay = dcs.ReadObject(fs) as MatchReplay; if (replay == null || !VersionHelper.CheckVersion(replay.AssemblyVersion)) { return(null); } return(replay); }
public void VersionHelper_GetVersion() { Version lowestAcceptableVersion = new Version("0.17"); Assert.IsTrue(VersionHelper.CurrentVersion > lowestAcceptableVersion, "Invalid version of current add-in. It should be greater!"); VersionHelper.CheckVersion(GetVersionFromServer); manualEvent.WaitOne(10000); Trace.WriteLine(string.Format("Current version: {0}", VersionHelper.CurrentVersion)); Trace.WriteLine(string.Format("Version on the server: {0}", remoteVersion)); Assert.AreNotEqual(remoteVersion, null, "Invalid version info received from server"); Assert.IsTrue(remoteVersion > lowestAcceptableVersion, "Remote version is too old."); }
/// <summary> /// Asks remote server for version info and compares go them to give proper advice to the user. /// </summary> public void SetupUI(Bitmap logo) { try { advice = SharedStrings.AboutUpdate_DefaultAdvice; lblAdvice.Text = advice; lblLocalVersion.Text = VersionHelper.CurrentVersion.ToString(VersionHelper.NumberOfDigits); lblRemoteVersion.Text = SharedStrings.AboutUpdate_Checking; pictureBox.BackgroundImage = logo; VersionHelper.CheckVersion(VersionInfoAvailable); } catch { lblRemoteVersion.Text = SharedStrings.AboutUpdate_UnknownVersion; } }
public static Type ParseIntellect(string fullPath) { Assembly assembly = Assembly.LoadFrom(fullPath);//вытаскиваем библиотеку var referencedAssemblies = assembly.GetReferencedAssemblies(); // LOOOOOOOOOOOOL var foundIntellect = false; foreach (var referencedAssembly in referencedAssemblies) { if (referencedAssembly.Name == "WarSpot.Contracts.Intellect") { // todo rewrite this to CheckVersion if (VersionHelper.CheckVersion(referencedAssembly.Version)) { foundIntellect = true; } break; } } if (!foundIntellect) { return(null); } string iMyInterfaceName = typeof(IBeingInterface).ToString(); foreach (var t in assembly.GetTypes()) { if (t.GetInterface(iMyInterfaceName) != null) { return(t); #if false var defaultCtor = t.GetConstructor(new Type[0]); if (defaultCtor != null) { var inst = defaultCtor.Invoke(new Type[0]); return(inst as IBeingInterface); } #endif } } return(null); }