home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipNet.msi / Data1.cab / FileListItem.cs < prev    next >
Encoding:
Text File  |  2002-02-04  |  1.4 KB  |  58 lines

  1. /*
  2.  * Xceed Zip for .NET - MiniExplorer Sample Application
  3.  * Copyright (c) 2000-2002 - Xceed Software Inc.
  4.  * 
  5.  * [FileListItem.cs]
  6.  * 
  7.  * This application demonstrates how to use the Xceed FileSystem object model
  8.  * in a generic way.
  9.  * 
  10.  * This file is part of Xceed Zip for .NET. The source code in this file 
  11.  * is only intended as a supplement to the documentation, and is provided 
  12.  * "as is", without warranty of any kind, either expressed or implied.
  13.  */
  14.  
  15. using System;
  16. using System.Windows.Forms;
  17. using System.Drawing;
  18. using Xceed.FileSystem;
  19. using Xceed.Zip;
  20.  
  21. namespace Xceed.FileSystem.Samples.MiniExplorer
  22. {
  23.     /// <summary>
  24.     /// Summary description for FileListItem.
  25.     /// </summary>
  26.     internal class FileListItem : ListViewItem 
  27.     {
  28.         public FileListItem( AbstractFile file )
  29.       : base( file.Name, 0 )
  30.         {
  31.       try { SubItems.Add( file.Size.ToString() ); }
  32.       catch { SubItems.Add( "NA" ); }
  33.  
  34.       try { SubItems.Add( file.Attributes.ToString() ); }
  35.       catch { SubItems.Add( "NA" ); }
  36.  
  37.       if( ( file is ZippedFile ) && ( ( ZippedFile )file ).Encrypted )
  38.       {
  39.         base.ForeColor = Color.Red;
  40.       }
  41.  
  42.       m_file = file;
  43.         }
  44.  
  45.     public FileListItem( string fileName )
  46.       : base( fileName, 0 )
  47.     {
  48.     }
  49.  
  50.     public AbstractFile File
  51.     {
  52.       get { return m_file; }
  53.     }
  54.  
  55.     private AbstractFile m_file = null;
  56.     }
  57. }
  58.