コード例 #1
0
 internal ResourceListBrowseState(IResource ownerResource, IResourceList resourceList,
                                  ResourceListDisplayOptions options)
     : base(ownerResource)
 {
     _resourceList = resourceList;
     _options      = options;
 }
コード例 #2
0
        public void ResourceNodeSelected(IResource res)
        {
            bool categoryListRecursive = res.HasProp(_categoryManager.PropShowContentsRecursively);

            if (res != _lastCategory || categoryListRecursive != _lastCategoryListRecursive)
            {
                _lastCategory = res;
                _lastCategoryListRecursive = categoryListRecursive;
                if (_lastCategoryListRecursive)
                {
                    _lastCategoryList = BuildRecursiveContentsList(res);
                }
                else
                {
                    _lastCategoryList = res.GetLinksOfTypeLive(null, _categoryManager.PropCategory);
                }
                _lastCategoryList = ResourceTypeHelper.ExcludeUnloadedPluginResources(_lastCategoryList);
                _lastCategoryList.Sort(new SortSettings(Core.Props.Date, true));
            }
            ResourceListDisplayOptions options = new ResourceListDisplayOptions();

            options.Caption = "Resources in category " + res.DisplayName;
            if (_lastCategoryListRecursive)
            {
                options.Caption += " and subcategories";
            }
            options.SeeAlsoBar = true;

            Core.ResourceBrowser.DisplayConfigurableResourceList(res, _lastCategoryList, options);
        }
コード例 #3
0
        public void Execute(IActionContext context)
        {
            if (context.SelectedResources.Count == 0)
            {
                return;
            }

            Core.UIManager.BeginUpdateSidebar();
            Core.TabManager.CurrentTabId = Core.TabManager.Tabs [0].Id;
            Core.UIManager.EndUpdateSidebar();

            IResource     mailAccount    = context.SelectedResources[0];
            IResourceList resourceList   = mailAccount.GetLinksOfTypeLive(null, Core.ContactManager.Props.LinkEmailAcctFrom);
            IResourceList resourceListTo = mailAccount.GetLinksOfTypeLive(null, Core.ContactManager.Props.LinkEmailAcctTo);
            IResourceList resourceListCC = mailAccount.GetLinksOfTypeLive(null, Core.ContactManager.Props.LinkEmailAcctCC);

            resourceList = resourceList.Union(resourceListTo);
            resourceList = resourceList.Union(resourceListCC);

            ResourceTypeHelper.ExcludeUnloadedPluginResources(resourceList);

            ResourceListDisplayOptions options = new ResourceListDisplayOptions();

            options.Caption = "Messages for " + mailAccount.DisplayName;
            options.SetTransientContainer(Core.ResourceTreeManager.ResourceTreeRoot,
                                          StandardViewPanes.ViewsCategories);
            Core.ResourceBrowser.DisplayResourceList(null, resourceList, options);
        }
コード例 #4
0
ファイル: SccPlugin.cs プロジェクト: mo5h/omeo
        public void ResourceNodeSelected(IResource res)
        {
            ResourceListDisplayOptions options = new ResourceListDisplayOptions();
            IResource repository = res;

            while (repository != null && repository.Type != Props.RepositoryResource)
            {
                repository = repository.GetLinkProp(Core.Props.Parent);
            }
            if (repository != null && repository.HasProp(Props.LastError))
            {
                options.StatusLine = repository.GetProp(Props.LastError);
            }
            options.CaptionTemplate = "Changes in %OWNER%";
            IResourceList resourceList;

            if (!res.HasProp(Props.ShowSubfolderContents))
            {
                resourceList = res.GetLinksOfType(Props.ChangeSetResource, Props.AffectsFolder);
            }
            else
            {
                resourceList = Core.ResourceStore.EmptyResourceList;
                resourceList = GatherContentsOfSubfolders(res, resourceList);
            }
            Core.ResourceBrowser.DisplayResourceList(res, resourceList, options);
        }
コード例 #5
0
        public void ResourceNodeSelected(IResource res)
        {
            if (res != _lastAB)
            {
                _lastAB     = res;
                _lastABList = _lastAB.GetLinksToLive(null, "InAddressBook");

                _lastABList.Sort(new SortSettings(ResourceProps.DisplayName, true));
            }

            ResourceListDisplayOptions options = new ResourceListDisplayOptions();

            options.DefaultGroupItems = false;
            options.CaptionTemplate   = "Address Book: %OWNER%";
            Core.ResourceBrowser.DisplayResourceList(res, _lastABList, options);
        }
コード例 #6
0
ファイル: FlagColumn.cs プロジェクト: mo5h/omeo
        public void Execute(IActionContext context)
        {
            IResource     flag    = context.SelectedResources [0];
            IResourceList resList = flag.GetLinksOfType(null, "Flag");

            Core.UIManager.BeginUpdateSidebar();
            Core.TabManager.SelectResourceTypeTab(null);
            Core.UIManager.EndUpdateSidebar();

            ResourceListDisplayOptions options = new ResourceListDisplayOptions();

            options.Caption = "Resources with " + flag.GetPropText(Core.Props.Name);
            options.SetTransientContainer(Core.ResourceTreeManager.ResourceTreeRoot,
                                          StandardViewPanes.ViewsCategories);
            Core.ResourceBrowser.DisplayResourceList(null, resList, options);
        }
コード例 #7
0
        public override void Execute(IActionContext context)
        {
            Core.UIManager.BeginUpdateSidebar();
            Core.TabManager.CurrentTabId = "IM";
            Core.UIManager.EndUpdateSidebar();

            IResource     account = context.SelectedResources [0];
            IResourceList resList = account.GetLinksOfType(null, ICQPlugin._propFromICQ);

            resList = resList.Union(account.GetLinksOfType(null, ICQPlugin._propToICQ));

            ResourceListDisplayOptions options = new ResourceListDisplayOptions();

            options.Caption = "Messages for " + account.DisplayName;
            options.SetTransientContainer(Core.ResourceTreeManager.ResourceTreeRoot,
                                          StandardViewPanes.ViewsCategories);
            Core.ResourceBrowser.DisplayResourceList(null, resList, options);
        }
コード例 #8
0
ファイル: OutlookActions.cs プロジェクト: mo5h/omeo
        internal void DisplayResourceList(IResource folder, IResourceList resourceList)
        {
            ResourceListDisplayOptions options = new ResourceListDisplayOptions();

            _folder = folder;
            bool displayUnread = folder.HasProp(Core.Props.DisplayUnread);

            if (displayUnread)
            {
                options.CaptionTemplate = "Unread messages in %OWNER%";
            }
            else
            {
                options.CaptionTemplate = "Messages in %OWNER%";
            }
            options.SelectedResource = Folder.GetSelectedMail(_folder);

            if (Folder.IsIgnored(_folder))
            {
                options.StatusLine             = "This folder is in the ignore list";
                options.StatusLine            += ". Click to remove from the ignored folders list";
                options.StatusLineClickHandler = OnClickOnBrowserStatus;
            }
            else
            {
                DateTime dateRestriction = Settings.IndexStartDate;
                if (dateRestriction.CompareTo(DateTime.MinValue) != 0 && !Folder.GetSeeAll(_folder))
                {
                    options.StatusLine             = "Showing messages since " + dateRestriction.ToShortDateString();
                    options.StatusLine            += ". Click to see all messages";
                    options.StatusLineClickHandler = OnClickOnBrowserStatus;
                }
            }

            options.SortSettings = new SortSettings(Core.Props.Date, false);
            if (_folder.HasProp(Core.Props.DisplayThreaded))
            {
                options.ThreadingHandler = Core.PluginLoader.CompositeThreadingHandler;
            }
            Core.ResourceBrowser.DisplayResourceList(_folder, resourceList, options);
        }
コード例 #9
0
ファイル: TextIndexManager.cs プロジェクト: mo5h/omeo
        public void  ProcessQuery(string query)
        {
            //-----------------------------------------------------------------
            //  Avoid perform any UI (and other, generally) work if we are
            //  shutting down - some components (like DefaultViewPane) may
            //  already be disposed.
            //-----------------------------------------------------------------
            if (Core.State != CoreState.Running)
            {
                return;
            }

            IResourceList          _resourceListBeforeQuickFind = Core.ResourceBrowser.VisibleResources;
            const string           _captionBeforeQuickFind      = "_caption";
            IHighlightDataProvider highlightDataProvider;
            TextIndexManager       man = (TextIndexManager)Core.TextIndexManager;

            IResourceList searchResults = man.ProcessQuery(query, out highlightDataProvider);

            searchResults = searchResults.Intersect(_resourceListBeforeQuickFind, true);

            string quickFindCaption = query;

            if (!quickFindCaption.StartsWith("\"") || !quickFindCaption.EndsWith("\""))
            {
                quickFindCaption = "'" + quickFindCaption + "'";
            }

            ResourceListDisplayOptions options = new ResourceListDisplayOptions();

            options.Caption = "Search results for " + quickFindCaption + " in " + _captionBeforeQuickFind;
            options.HighlightDataProvider = highlightDataProvider;
            options.SuppressContexts      = true;
            options.ShowNewspaper         = Core.ResourceBrowser.NewspaperVisible;
            IResource ownerView = Core.ResourceBrowser.OwnerResource;

            Core.ResourceBrowser.DisplayResourceList(ownerView, searchResults, options);
            Core.ResourceBrowser.FocusResourceList();
        }
コード例 #10
0
        /**
         * When the "See All..." label is clicked, displays all links of the
         * specified type in the resource browser.
         */

        private void OnSeeAllClick(object sender, EventArgs e)
        {
            if (_resourceList != null && _resourceList.Count == 1)
            {
                IResource res       = _resourceList [0];
                Control   linkLabel = (Control)sender;
                int       linkType  = (int)linkLabel.Tag;

                IResourceList links;
                if (linkType < 0)
                {
                    links = res.GetLinksToLive(null, -linkType);
                }
                else if (Core.ResourceStore.PropTypes [linkType].HasFlag(PropTypeFlags.DirectedLink))
                {
                    links = res.GetLinksFromLive(null, linkType);
                }
                else
                {
                    links = res.GetLinksOfTypeLive(null, linkType);
                }
                links = ResourceTypeHelper.ExcludeUnloadedPluginResources(links);

                Core.UIManager.BeginUpdateSidebar();
                Core.TabManager.SelectResourceTypeTab(null);
                Core.UIManager.EndUpdateSidebar();

                ResourceListDisplayOptions options = new ResourceListDisplayOptions();
                options.Caption   = _store.PropTypes.GetPropDisplayName(linkType) + " links to " + res.DisplayName;
                options.TabFilter = false;
                options.SetTransientContainer(Core.ResourceTreeManager.ResourceTreeRoot,
                                              StandardViewPanes.ViewsCategories);
                Core.ResourceBrowser.DisplayResourceList(null, links, options);
                Core.ResourceBrowser.FocusResourceList();
            }
        }
コード例 #11
0
ファイル: FilterMgrUIHandler.cs プロジェクト: mo5h/omeo
        private void ConfigureDisplayOptions(IResource view, string viewName, IResourceList result)
        {
            _displayOptions         = new ResourceListDisplayOptions();
            _displayOptions.Caption = !String.IsNullOrEmpty(viewName) ? viewName : "Unnamed view";

            string deepName = view.GetStringProp("DeepName");
            string errorMsg = view.GetStringProp(Core.Props.LastError);

            if (!String.IsNullOrEmpty(errorMsg))
            {
                _displayOptions.StatusLine             = errorMsg;
                _displayOptions.StatusLineClickHandler = RefreshViewState;
                _lastErrorView = view;
            }
            else
            if (deepName != Core.FilterRegistry.ViewNameForSearchResults)
            {
                if (!view.HasProp("DefaultSort"))
                {
                    result = SafeSort(result);
                    result.Sort(new SortSettings(Core.Props.Date, false));
                }

                string content = view.GetStringProp(Core.Props.ContentType);
                if (content == null || content.IndexOf('|') != -1)
                {
                    _displayOptions.SeeAlsoBar = true;
                }

                _displayOptions.DefaultGroupItems = !view.HasProp("DisableDefaultGroupping");
            }
            else
            {
                //  If we are in the normal mode (Running) - just show the
                //  result to the user. Otherwise, through the chain of two
                //  event handlers, wait until both events take place:
                //  1. Core is switched to state Running;
                //  2. Text Index is completely loaded.
                if (Core.State == CoreState.Running)
                {
                    _displayOptions.HighlightDataProvider = FilterEngine.Highlighter;
                    _displayOptions.SeeAlsoBar            = true;

                    string stopWordsMessage = FilterEngine.VisualizeStopWords();
                    if (FilterEngine._lastQueryError != null)
                    {
                        _displayOptions.StatusLine = FilterEngine._lastQueryError;
                    }
                    else if (stopWordsMessage.Length > 0)
                    {
                        _displayOptions.StatusLine = stopWordsMessage;
                    }

                    /* [yole] This behavior is unusable.
                     * Use case: Perform a search in a tab where there are no search results for some type. Omea
                     * remembers that the search view was selected. Then the following code switches to the tab where
                     * search results are present. Then, as soon as you try to switch to the original tab again,
                     * the search view is selected again, the following code runs again, and the selection jumps back.
                     * In effect, the original tab becomes unreachable.
                     *
                     * if( view.HasProp( "RunToTabIfSingleTyped" ) )
                     * {
                     *      string[] types = ResourceTypeHelper.GetUnderlyingResourceTypes( result );
                     *      if( types != null && types.Length == 1 )
                     *      {
                     *              string tabID = Core.TabManager.FindResourceTypeTab( types[ 0 ] );
                     *              if( tabID != null )
                     *                      Core.TabManager.ActivateTab( tabID );
                     *      }
                     * }
                     */
                }
                else
                {
                    _displayOptions.EmptyText          = "Loading information from text index... Please wait or switch to another view.";
                    Core.TextIndexManager.IndexLoaded += ExecSearchViewLateMarshaller;
                }
            }
        }