Beispiel #1
0
        private void AddThumbnail(Uri resourceUri)
        {
            if (m_thumbnailControl.Visible)
            {
                m_requestedThumbs.Add(resourceUri);
                m_thumbnailService.ResolveThumbnail(resourceUri);
                string assetPath     = resourceUri.LocalPath;
                string assetFileName = Path.GetFileName(assetPath);
                Icon   shellIcon     = FileIconUtil.GetFileIcon(assetFileName, FileIconUtil.IconSize.Large, false);
                Bitmap tempThumbnail = shellIcon.ToBitmap();

                ThumbnailControlItem item = GetItem(resourceUri);
                if (item == null)
                {
                    item = NewItem(resourceUri, tempThumbnail);
                    m_thumbnailControl.Items.Add(item);
                }
                else
                {
                    item.Image = tempThumbnail;
                }
            }
            else if (m_listView.Visible)
            {
                string assetPath = resourceUri.OriginalString;
                string path      = resourceUri.LocalPath;
            }
        }
Beispiel #2
0
        private void RefreshThumbnails()
        {
            foreach (var item in m_thumbnailControl.Items)
            {
                if (item.Image != null)
                {
                    item.Image.Dispose();
                }
            }

            m_thumbnailControl.Selection.Clear();
            m_thumbnailControl.Items.Clear();
            m_thumbnailControl.Invalidate();
            if (m_treeContext != null)
            {
                IResourceFolder currentAssetFolder = m_treeContext.GetLastSelected <IResourceFolder>();
                if (currentAssetFolder == null || !m_thumbnailControl.Visible)
                {
                    return;
                }

                foreach (Uri resourceUri in currentAssetFolder.ResourceUris)
                {
                    m_thumbnailService.ResolveThumbnail(resourceUri);
                    string assetPath     = resourceUri.LocalPath;
                    string assetFileName = Path.GetFileName(assetPath);
                    Icon   shellIcon     = FileIconUtil.GetFileIcon(assetFileName, FileIconUtil.IconSize.Large, false);
                    Bitmap tempThumbnail = shellIcon.ToBitmap();
                    shellIcon.Dispose();
                    ThumbnailControlItem item = NewItem(resourceUri, tempThumbnail);
                    m_thumbnailControl.Items.Add(item);
                }
                m_thumbnailControl.RecalculateClientSize();
            }
        }
Beispiel #3
0
        private void RightPaneAddItem(IResource resource)
        {
            if (m_thumbnailControl.Visible)
            {
                m_requestedThumbs.Add(resource);
                m_thumbnailService.ResolveThumbnail(resource);
                string assetPath     = resource.GetPathName();
                string assetFileName = Path.GetFileName(assetPath);
                Icon   shellIcon     = FileIconUtil.GetFileIcon(assetFileName, FileIconUtil.IconSize.Large, false);
                Bitmap tempThumbnail = shellIcon.ToBitmap();

                ThumbnailControlItem item = GetItem(resource);
                if (item == null)
                {
                    item = NewItem(resource, tempThumbnail);
                    m_thumbnailControl.Items.Add(item);
                }
                else
                {
                    item.Image = tempThumbnail;
                }
            }
            else if (m_listView.Visible)
            {
                string assetPath = resource.Uri.OriginalString;
                string indicator = null;
                if (m_sourceControlService != null)
                {
                    SourceControlStatus status = m_sourceControlService.GetStatus(resource.Uri);
                    indicator = SetSourceControlIndicator(resource.Uri, status);
                }
                string path = resource.GetPathName();
            }
        }
Beispiel #4
0
        private void RefreshThumbnail(IResource asset)
        {
            m_requestedThumbs.Add(asset);
            m_thumbnailService.ResolveThumbnail(asset);
            string assetPath          = asset.GetPathName();
            string assetFileName      = Path.GetFileName(assetPath);
            Icon   shellIcon          = FileIconUtil.GetFileIcon(assetFileName, FileIconUtil.IconSize.Large, false);
            Bitmap tempThumbnail      = shellIcon.ToBitmap();
            ThumbnailControlItem item = GetItem(asset);

            if (item == null)
            {
                item = NewItem(asset, tempThumbnail);
                m_thumbnailControl.Items.Add(item);
            }
            else
            {
                item.Image = tempThumbnail;
            }
        }