public static void WaitForChangeBlocking() { var changeId = new ChangeId(Path.GetDirectoryName(typeof(SharedState).Assembly.Location)); var id = changeId.GetChangeId(); while (changeId.GetChangeId() == id) { Thread.Sleep(500); } }
public static async Task WaitForChange() { var changeId = new ChangeId(Path.GetDirectoryName(typeof(SharedState).Assembly.Location)); var id = changeId.GetChangeId(); while (changeId.GetChangeId() == id) { await Task.Delay(500); } }
private void MonitorPackageChange() { if (!IsMonitoringPackageChange) { IsMonitoringPackageChange = true; TapThread.Start(() => { while (true) { ChangeId.WaitForChangeBlocking(); PackageChanged(); } }); } }
public string Post(ChangeId request) { using (StreamReader dat = new StreamReader(request.RequestStream)) { string str = dat.ReadToEnd(); if (Photo.IdChange(str)) { return(new OkResponse("Id change ok").ToString()); } else { return(new FailResponse("id change fail").ToString()); } } }
internal void AnnouncePackageChange() { using (var changeId = new ChangeId(this.TapPath)) changeId.SetChangeId(changeId.GetChangeId() + 1); }