internal virtual void LoadCoverPageGraphicsSync(TaskScheduler uiScheduler, TabPage tabPage, string coverPageTitleForDefault)
        {
            string itemsByHeaderTypeSortBySortOrder =
                "<View><Query><Where><Eq><FieldRef Name='" + Constants.SharePointFields.HeaderType +
                "' /> <Value Type='Choice'>" + HeaderType + "</Value></Eq></Query><OrderBy><FieldRef Name='" +
                Constants.SharePointFields.SortOrder + "'/></OrderBy></View></Where>";

            string contextUrl = Settings.Default.SharePointContextUrl;
            string listTitle  = Settings.Default.GraphicsPictureLibraryTitle;

            var    sharePointPictureLibry = new SharePointPictureLibrary(contextUrl, listTitle, false, itemsByHeaderTypeSortBySortOrder);
            var    presenter = new SharePointPictureLibraryPresenter(sharePointPictureLibry, this);
            string cacheName = HeaderType + Constants.ControlNames.TabPageCoverPagesName;

            List <IThumbnail> th;

            if (Cache.Contains(cacheName))
            {
                th = ((List <IThumbnail>)Cache.Get(cacheName));
            }
            else
            {
                th = presenter.GetPictureLibraryCoverPageThumnails();
                Cache.Add(cacheName, th, new CacheItemPolicy());
            }

            DisplayGraphics(uiScheduler, tabPage, coverPageTitleForDefault, th, false);
        }
Beispiel #2
0
        internal virtual void LoadLogoGraphicsSync(TaskScheduler uiScheduler, TabPage tabPage, string logoTitleForDefault)
        {
            string contextUrl = Settings.Default.SharePointContextUrl;
            string listTitle  = Settings.Default.GraphicsPictureLibraryTitleLogos;

            var sharePointPictureLibry = new SharePointPictureLibrary(contextUrl, listTitle, true, BusinessLogic.Helpers.Constants.SharePointQueries.AllItemsSortBySortOrder);
            var presenter = new SharePointPictureLibraryPresenter(sharePointPictureLibry, this);

            List <IThumbnail> logoStreams;

            var cacheName = HeaderType + "LogoStreams";

            if (Cache.Contains(cacheName))
            {
                logoStreams = presenter.GetPictureLibraryLogoThumbnails();
                //logoStreams = (List<IThumbnail>)_cache.Get(cacheName);
            }
            else
            {
                logoStreams = presenter.GetPictureLibraryLogoThumbnails();
                Cache.Add(cacheName, logoStreams, new CacheItemPolicy());
            }

            DisplayGraphics(uiScheduler, tabPage, logoTitleForDefault, logoStreams, true);
        }