Beispiel #1
0
            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);
                }
            }
Beispiel #2
0
            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);
                }
            }
Beispiel #3
0
 private void MonitorPackageChange()
 {
     if (!IsMonitoringPackageChange)
     {
         IsMonitoringPackageChange = true;
         TapThread.Start(() =>
         {
             while (true)
             {
                 ChangeId.WaitForChangeBlocking();
                 PackageChanged();
             }
         });
     }
 }
Beispiel #4
0
        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());
                }
            }
        }
Beispiel #5
0
 internal void AnnouncePackageChange()
 {
     using (var changeId = new ChangeId(this.TapPath))
         changeId.SetChangeId(changeId.GetChangeId() + 1);
 }