Пример #1
0
        public void GetFavoriteRefIds(ReferenceFavoriteViewModel fav, List <Int32> refIds)
        {
            if (fav == null)
            {
                return;
            }

            if (fav.IsGroup)
            {
                if (!fav.IsExpanded)
                {
                    fav.IsExpanded = true;
                }
                foreach (var vm in fav.Children)
                {
                    GetFavoriteRefIds(vm as ReferenceFavoriteViewModel, refIds);
                }
            }
            else
            {
                var refId = fav.RefID;
                if (refId > 0 && !refIds.Contains(refId))
                {
                    refIds.Add(refId);
                }
            }
        }
Пример #2
0
        private void ExportReferenceFavorite(ReferenceFavoriteViewModel favorite)
        {
            if (favorite == null)
            {
                return;
            }

            var plugin = PluginManager.Instance.GetPluginByName("Tools");
            var refIds = new List <Int32>();

            GetFavoriteRefIds(favorite, refIds);

            if (refIds.Count == 0)
            {
                return;
            }

            var report = new ReferencesReport(User, favorite.DisplayLabel, refIds);

            PluginManager.Instance.RunReport(plugin, report);
        }