private void PopulateVersionInfo( string libraryUrl, string documentName, Proxy.NavigatorRef.ItemKind kind )
        {
            this.Items.Clear( );
            FileIconManager iconManager = new FileIconManager( this.SmallImageList, this.LargeImageList );

            int versionCount = Proxy.ArtifactProxy.GetVersionCount( libraryUrl, documentName );
            int i = 0;
            for( i = 0; i < versionCount; ++i )
            {
                string versionLabel = Proxy.ArtifactProxy.GetVersionLabel( libraryUrl, documentName, i );

                VersionInfo info = new VersionInfo( i, versionLabel );

                ListViewItem item = new ListViewItem( documentName );
                ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem( item, versionLabel );

                item.Tag = info;
                SetIcon( iconManager, item, documentName, kind );
                item.SubItems.Add( subItem );
                this.versionInfo = info;
                this.Items.Add( item );
            }

            this.Items[ i - 1 ].Selected = true;
        }
 private void SetIcon( FileIconManager iconManager, ListViewItem item, string documentName, Proxy.NavigatorRef.ItemKind kind )
 {
     if( kind == Proxy.NavigatorRef.ItemKind.File )
     {
         int index = iconManager.GetIconIndex( documentName );
         item.ImageIndex = index;
     }
     else if( kind == Proxy.NavigatorRef.ItemKind.WebSite )
     {
         item.ImageIndex = 2;
     }
     else if( kind == Proxy.NavigatorRef.ItemKind.DocumentLibrary )
     {
         item.ImageIndex = 1;
     }
     else
     {
         item.ImageIndex = 0;
     }
 }
Exemple #3
0
		private void InitializeFields()
		{
			Logger.LogInfo("Initializing fields"); 

			m_webServices = new WebServiceController();
			LoadFolderImages();
			m_manager = new FileIconManager(ilSmallImages, ilLargeImages);
			m_history = new Stack();
			m_buttonsMouseState = new Hashtable();
			m_knownSites = new SharePointSiteList();
			m_favourites = new FavouritesList();
			m_viewState = new ListViewState();

			ListViewColumnSorter sorter = new ListViewColumnSorter();
			this.lvBrowser.ListViewItemSorter = sorter;
			this.listViewVersions.ListViewItemSorter = sorter;

			Mode = DialogMode.Open;
			Filters = "All Files (*.*)|*.*";
			DefaultExt = "";
			this.splitContainerMain.Panel2Collapsed = true;
			this.panelDocumentProfiling.Controls.Add(this.profileControl);
			this.profileControl.Dock = DockStyle.Fill;
			breadcrumbBar = new ExplorerAddressNavigation();
			AddressBar.PathConverter = new SPPathConverter();
		}