コード例 #1
0
 private void Synchronize(NotifyInfo info)
 {
     if (info.Name == Name)
     {
         Invalid = true;
     }
 }
コード例 #2
0
        private void Synchronize(NotifyInfo info)
        {
            if (info.Name == Name)
            {
                switch (info.Operation)
                {
                case NotifyInfo.OperationEnum.Insert:
                case NotifyInfo.OperationEnum.Change:
                    var found = Lookup.Find(info.URI);
                    foreach (var f in found)
                    {
                        Data.TryAdd(f.URI, f);
                    }
                    break;

                case NotifyInfo.OperationEnum.Delete:
                    TValue value;
                    foreach (var u in info.URI)
                    {
                        Data.TryRemove(u, out value);
                    }
                    break;

                case NotifyInfo.OperationEnum.Update:
                    var remaining = Lookup.Find(info.URI);
                    foreach (var r in remaining)
                    {
                        Data.AddOrUpdate(r.URI, r, (_, __) => r);
                    }
                    break;
                }
            }
        }
コード例 #3
0
 private void CheckInvalidate(NotifyInfo info)
 {
     if (info.Name == Name && info.Operation != NotifyInfo.OperationEnum.Insert)
     {
         foreach (var uri in info.URI)
         {
             Cache.Remove(uri + Suffix);
         }
     }
 }