public void Exec(IResource res, IActionParameterStore actionStore) { IResourceList categories = actionStore.ParametersAsResList(); IResourceList authors = res.GetLinksOfType(null, Core.ContactManager.Props.LinkFrom); foreach (IResource author in authors) { IResourceType type = Core.ResourceStore.ResourceTypes[author.TypeId]; // Do not assign categories for resource types which are // internal in the sence - they are not showable in the // traditional ResourceListView pane. Thus, user can not // benefit from setting a category to these internal types. if (!type.HasFlag(ResourceTypeFlags.Internal)) { ResourceProxy proxy = new ResourceProxy(author); proxy.BeginUpdate(); foreach (IResource category in categories) { proxy.AddLink("Category", category); } proxy.EndUpdate(); } } }
public void Exec(IResource res, IActionParameterStore actionStore) { IResourceList flags = actionStore.ParametersAsResList(); ResourceProxy proxy = new ResourceProxy(res); proxy.BeginUpdate(); proxy.SetProp("Flag", flags[0]); proxy.EndUpdate(); }
public void Exec(IResource res, IActionParameterStore actionStore) { IResourceList categories = actionStore.ParametersAsResList(); foreach (IResource category in categories) { Core.CategoryManager.AddResourceCategory(res, category); } }
public void Exec(IResource resource, IActionParameterStore actionStore) { if (resource != null) { foreach (IResource task in actionStore.ParametersAsResList()) { resource.AddLink(TasksPlugin._linkTarget, task); } } }
public bool MatchResource(IResource res, IActionParameterStore actionStore) { IResourceList contacts = actionStore.ParametersAsResList(); IResourceList linked = res.GetLinksOfType(null, Core.ContactManager.Props.LinkFrom); linked = linked.Union(res.GetLinksOfType(null, Core.ContactManager.Props.LinkTo), true); linked = linked.Intersect(contacts, true); return(linked.Count > 0); }
public bool MatchResource(IResource res, IActionParameterStore actionStore) { IResourceList threadHeads = actionStore.ParametersAsResList(); IResource msg = res; while (msg != null && threadHeads.IndexOf(msg) == -1) { msg = msg.GetLinkProp(Core.Props.Reply); } return(msg != null); }
public void Exec(IResource res, IActionParameterStore actionStore) { IResourceList authors = res.GetLinksOfType("Contact", Core.ContactManager.Props.LinkFrom); foreach (IResource contact in authors) { IResourceList addrBooks = actionStore.ParametersAsResList(); foreach (IResource addrBook in addrBooks) { new AddressBook(addrBook).AddContact(contact); } } }
public IResourceList Filter(string resType, IActionParameterStore actionStore) { IResourceList contacts = actionStore.ParametersAsResList(); IResourceList result = Core.ResourceStore.EmptyResourceList; lock ( contacts ) { foreach (IResource contact in contacts) { result = result.Union(ContactManager.LinkedCorrespondenceDirect(contact)); } } return(result); }
public IResourceList Filter(string resType, IActionParameterStore actionStore) { IResourceList categories = actionStore.ParametersAsResList(); categories = CategoriesTree(categories); IResourceList result = Core.ResourceStore.EmptyResourceList; foreach (IResource category in categories) { result = result.Union(category.GetLinksOfType(null, "Category")); } result = result.Minus(Core.ResourceStore.GetAllResources("Category")); return(result); }
public bool MatchResource(IResource res, IActionParameterStore actionStore) { bool match = false; if (res.Type != "Category") { IResourceList linkedCategories = res.GetLinksOfType("Category", "Category"); if (linkedCategories.Count > 0) { IResourceList matchCats = actionStore.ParametersAsResList(); matchCats = CategoriesTree(matchCats); match = (matchCats.Intersect(linkedCategories, true).Count > 0); } } return(match); }
public void Exec(IResource resource, IActionParameterStore actionStore) { Tracer._Trace("Execute rule: MoveToFolderRuleAction"); if (resource == null || resource.Type != STR.Email) { return; } IResourceList folders = actionStore.ParametersAsResList(); if (folders != null && folders.Count > 0) { IResource folder = folders[0]; if (folder.Type == STR.MAPIFolder) { OutlookSession.OutlookProcessor.QueueJob(JobPriority.Normal, "Move message to folder rule action", new ResourceList_ResourceDelegate(ExecImpl), resource.ToResourceList(), folder); } } }