コード例 #1
0
ファイル: ViewsInitializer.cs プロジェクト: mo5h/omeo
        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();
                }
            }
        }
コード例 #2
0
ファイル: ViewsInitializer.cs プロジェクト: mo5h/omeo
        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();
        }
コード例 #3
0
ファイル: ViewsInitializer.cs プロジェクト: mo5h/omeo
        public void  Exec(IResource res, IActionParameterStore actionStore)
        {
            IResourceList categories = actionStore.ParametersAsResList();

            foreach (IResource category in categories)
            {
                Core.CategoryManager.AddResourceCategory(res, category);
            }
        }
コード例 #4
0
ファイル: RuleActions.cs プロジェクト: mo5h/omeo
 public void Exec(IResource resource, IActionParameterStore actionStore)
 {
     if (resource != null)
     {
         foreach (IResource task in actionStore.ParametersAsResList())
         {
             resource.AddLink(TasksPlugin._linkTarget, task);
         }
     }
 }
コード例 #5
0
ファイル: ViewsInitializer.cs プロジェクト: mo5h/omeo
        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);
        }
コード例 #6
0
ファイル: ViewsInitializer.cs プロジェクト: mo5h/omeo
        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);
        }
コード例 #7
0
ファイル: ContactsPlugin.cs プロジェクト: mo5h/omeo
            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);
                    }
                }
            }
コード例 #8
0
ファイル: ViewsInitializer.cs プロジェクト: mo5h/omeo
        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);
        }
コード例 #9
0
ファイル: ViewsInitializer.cs プロジェクト: mo5h/omeo
        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);
        }
コード例 #10
0
ファイル: ViewsInitializer.cs プロジェクト: mo5h/omeo
        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);
        }
コード例 #11
0
ファイル: OutlookActions.cs プロジェクト: mo5h/omeo
        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);
                }
            }
        }