private void OnContainerChanged(object sender, ResourcePropIndexEventArgs args) { IPropertyChangeSet set = args.ChangeSet; if (set.IsPropertyChanged(_itemLink) || (_folderLink >= 0 && set.IsPropertyChanged(_folderLink))) { if (DecorationChanged != null) { DecorationChanged(this, new ResourceEventArgs(args.Resource)); } } }
internal override PredicateMatch MatchResource(IResource res, IPropertyChangeSet cs) { if (Array.IndexOf(_resTypeIds, res.TypeId) >= 0) { return((cs != null && (cs.IsNewResource || cs.IsPropertyChanged(ResourceProps.Type))) ? PredicateMatch.Add : PredicateMatch.Match); } else if (cs != null && cs.IsPropertyChanged(ResourceProps.Type) && Array.IndexOf(_resTypeIds, (int)cs.GetOldValue(ResourceProps.Type)) >= 0) { return(PredicateMatch.Del); } return(PredicateMatch.None); }
public void NotifyResourceSaved(IResource resource, IPropertyChangeSet changeSet) { Interlocked.Increment(ref _reentryLevel); ArrayList list; lock ( _typedUpdateListeners ) { list = (ArrayList)_typedUpdateListeners [resource.TypeId]; } if (list != null) { NotifyList(list, resource, changeSet, false); } if (changeSet != null && changeSet.IsPropertyChanged(ResourceProps.Type)) { int oldType = (int)changeSet.GetOldValue(ResourceProps.Type); lock ( _typedUpdateListeners ) { list = (ArrayList)_typedUpdateListeners [oldType]; } if (list != null) { NotifyList(list, resource, changeSet, false); } } NotifyList(_priorityUpdateListeners, resource, changeSet, false); NotifyList(_untypedUpdateListeners, resource, changeSet, false); Interlocked.Decrement(ref _reentryLevel); }
public void ResourceChanged(IResource res, IPropertyChangeSet cs) { Core.UIManager.QueueUIJob(new ResourceDelegate(DoUpdateResource), res); if (cs.IsPropertyChanged(Core.Props.UserResourceOrder)) { Core.UserInterfaceAP.QueueJob("Rearrange Children", new RearrangeChildrenDelegate(_owner.RearrangeChildren), res); } }
internal override PredicateMatch MatchResource(IResource res, IPropertyChangeSet cs) { if (MatchValue(res.GetProp(_propId))) { if (cs != null && cs.IsPropertyChanged(_propId) && !MatchValue(cs.GetOldValue(_propId))) { return(CheckSnapshotAdd(res.Id)); } return(PredicateMatch.Match); } else if (cs != null && MatchValue(cs.GetOldValue(_propId))) { return(CheckSnapshotRemove(res.Id)); } return(CheckSnapshotNoMatch(res.Id)); }
private void WeblinkOrFolderChanged(object sender, ResourcePropIndexEventArgs e) { IResource webLink = e.Resource; IPropertyChangeSet set = e.ChangeSet; int propLastModified = Core.ResourceStore.PropTypes["LastModified"].Id; if (BookmarkService.DownloadMethod != 2 && webLink == _lastDisplayedWeblink && ((set.IsPropertyChanged(propLastModified) && webLink.HasProp("Source")) || (set.IsPropertyChanged(Core.Props.LastError) && webLink.HasProp(Core.Props.LastError)))) { // if the displayed web link has changed, redisplay it IResourceBrowser browser = Core.ResourceBrowser; if ((webLink == _favoritesTreePane.SelectedNode && Core.TabManager.CurrentTabId == "Web") || (browser.SelectedResources.Count == 1 && webLink == browser.SelectedResources[0])) { Core.UserInterfaceAP.QueueJobAt(DateTime.Now.AddSeconds(1), "RedisplaySelectedResource", browser.RedisplaySelectedResource); } } string URL = webLink.GetPropText(_propURL); if (URL.Length > 0) { if (set.IsPropertyChanged(_propLastUpdated) || set.IsPropertyChanged(_propUpdateFreq)) { BookmarkService.QueueWeblink(webLink, URL, BookmarkService.BookmarkSynchronizationTime(webLink)); } if (set.IsPropertyChanged(_propURL)) { BookmarkService.ImmediateQueueWeblink(webLink, URL); } } if (set.IsPropertyChanged(Core.PropIds.Name) || set.IsPropertyChanged(_propURL)) { IBookmarkProfile profile = _bookmarkService.GetOwnerProfile(webLink); string error; if (profile != null && profile.CanCreate(webLink, out error)) { profile.Create(webLink); } } }
public static void CheckResource(IResource res, IPropertyChangeSet changeSet) { if (_active) { lock ( _restrictions ) { HashSet restrictionsSet = (HashSet)_restrictions[res.Type]; if (restrictionsSet != null) { foreach (HashSet.Entry E in restrictionsSet) { ResourceRestriction restriction = (ResourceRestriction)E.Key; if ((restriction.PropId != ResourceProps.Id && changeSet.IsNewResource) || changeSet.IsPropertyChanged(restriction.PropId)) { restriction.CheckResource(res, changeSet); } } } } } }
public virtual bool IsThreadChanged(IResource res, IPropertyChangeSet changeSet) { return(changeSet.IsPropertyChanged(_threadReplyProp)); }
public bool IsThreadChanged(IResource res, IPropertyChangeSet changeSet) { return(changeSet.IsPropertyChanged(Core.Props.Reply) || changeSet.IsPropertyChanged(PROP.Attachment)); }