Exemple #1
0
 //  For a resource to be text-indexed its resource type must conform
 //  to the following criteria:
 //  - have valid name
 //  - be indexable
 //  - its oqner plugin must be loaded
 //  - even if its plugin is loaded (or the owner may be omitted), it
 //    must be either a file (for a FilePlugin to be able to index it) or
 //    have some ITextIndexProvider, specific for this particular
 //    resource type.
 private static bool  IsResTypeIndexingConformant(IResourceType resType)
 {
     return(!String.IsNullOrEmpty(resType.Name) && !resType.HasFlag(ResourceTypeFlags.NoIndex) &&
            resType.OwnerPluginLoaded &&
            (resType.HasFlag(ResourceTypeFlags.FileFormat) ||
             Core.PluginLoader.HasTypedTextProvider(resType.Name)));
 }
Exemple #2
0
        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();
                }
            }
        }
Exemple #3
0
 private bool IsFeasibleRT(IResourceType rt, ArrayList validNames, ResourceTypeFlags checkFlag)
 {
     //  1. Plugin must be loaded which is responsible for that res type
     //  2. If there is no restriction on particular res types
     //     (validNames.Count == 0) then allow those which are indexable and
     //     with nonempty name.
     //  3. If there is restriction on the particular res types, then only
     //     those res types are allowed.
     return(rt.OwnerPluginLoaded &&
            ((!rt.HasFlag(checkFlag) && (rt.DisplayName != null) && (validNames.Count == 0)) ||
             (validNames.IndexOf(rt.Name) != -1)));
 }
Exemple #4
0
        private void OnMouseClick(object sender, ItemMouseEventArgs e)
        {
            IResource     res  = (IResource)e.Item;
            IResourceType type = Core.ResourceStore.ResourceTypes[res.Type];

            if (type.HasFlag(ResourceTypeFlags.CanBeUnread))
            {
                bool unreadState = res.HasProp(Core.Props.IsUnread);
                SetResourceUnreadState(res, unreadState);

                //  If there is a command to propagate the reading status over
                //  the whole thread (conversation) we need to set exactly the
                //  same flag on all resources, not just toggle their flags
                //  forward.
                if ((Control.ModifierKeys & Keys.Control) > 0)
                {
                    PropagateUnreadState2Thread(res, unreadState);
                }
                e.Handled = false;
            }
        }