Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #region README
  2.  
  3.         //_____________________________________________________________________________
  4.         //
  5.         //Sample C# code, .NET Framework 1.1, contributed to the Info-Zip project by
  6.         //Adrian Maull, April 2005.
  7.         //
  8.         //If you have questions or comments, contact me at adrian.maull@sprintpcs.com.  Though
  9.         //I will try to respond to coments/questions, I do not guarantee such response.
  10.         //
  11.         //THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  12.         //KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  13.         //IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  14.         //PARTICULAR PURPOSE.
  15.         //
  16.         //_____________________________________________________________________________
  17.  
  18.  
  19. #endregion
  20.  
  21. using System;
  22. using System.Drawing;
  23. using System.Collections;
  24. using System.ComponentModel;
  25. using System.Windows.Forms;
  26.  
  27. namespace CSharpInfoZip_UnZipSample
  28. {
  29.         /// <summary>
  30.         /// Summary description for frmShowContents.
  31.         /// </summary>
  32.         public class frmShowContents : System.Windows.Forms.Form
  33.         {
  34.                 private System.Windows.Forms.DataGrid dataGrid1;
  35.                 private System.Windows.Forms.Label label1;
  36.                 private System.Windows.Forms.Label label2;
  37.                 private System.Windows.Forms.TextBox txtComment;
  38.  
  39.                 private ZipFileEntries m_ZipFileEntries;
  40.                 private string m_Comment;
  41.  
  42.                 /// <summary>
  43.                 /// Required designer variable.
  44.                 /// </summary>
  45.                 private System.ComponentModel.Container components = null;
  46.  
  47.  
  48.                 public ZipFileEntries UnzippedFileCollection
  49.                 {
  50.                         set
  51.                         {
  52.                                 m_ZipFileEntries = value;
  53.                                 dataGrid1.DataSource = m_ZipFileEntries;
  54.                                 label1.Text = m_ZipFileEntries.Count + " files in this zip.";
  55.                         }
  56.                 }
  57.  
  58.                 public string Comment
  59.                 {
  60.                         set
  61.                         {
  62.                                 m_Comment = value;
  63.                                 txtComment.Text = m_Comment;
  64.                         }
  65.                 }
  66.  
  67.                 public frmShowContents()
  68.                 {
  69.                         //
  70.                         // Required for Windows Form Designer support
  71.                         //
  72.                         InitializeComponent();
  73.  
  74.                         //
  75.                         // TODO: Add any constructor code after InitializeComponent call
  76.                         //
  77.                 }
  78.  
  79.                 /// <summary>
  80.                 /// Clean up any resources being used.
  81.                 /// </summary>
  82.                 protected override void Dispose( bool disposing )
  83.                 {
  84.                         if( disposing )
  85.                         {
  86.                                 if(components != null)
  87.                                 {
  88.                                         components.Dispose();
  89.                                 }
  90.                         }
  91.                         base.Dispose( disposing );
  92.                 }
  93.  
  94.                 #region Windows Form Designer generated code
  95.                 /// <summary>
  96.                 /// Required method for Designer support - do not modify
  97.                 /// the contents of this method with the code editor.
  98.                 /// </summary>
  99.                 private void InitializeComponent()
  100.                 {
  101.                         this.dataGrid1 = new System.Windows.Forms.DataGrid();
  102.                         this.label1 = new System.Windows.Forms.Label();
  103.                         this.label2 = new System.Windows.Forms.Label();
  104.                         this.txtComment = new System.Windows.Forms.TextBox();
  105.                         ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
  106.                         this.SuspendLayout();
  107.                         //
  108.                         // dataGrid1
  109.                         //
  110.                         this.dataGrid1.DataMember = "";
  111.                         this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
  112.                         this.dataGrid1.Location = new System.Drawing.Point(8, 16);
  113.                         this.dataGrid1.Name = "dataGrid1";
  114.                         this.dataGrid1.Size = new System.Drawing.Size(592, 192);
  115.                         this.dataGrid1.TabIndex = 0;
  116.                         //
  117.                         // label1
  118.                         //
  119.                         this.label1.Location = new System.Drawing.Point(8, 216);
  120.                         this.label1.Name = "label1";
  121.                         this.label1.Size = new System.Drawing.Size(320, 16);
  122.                         this.label1.TabIndex = 1;
  123.                         this.label1.Text = "label1";
  124.                         //
  125.                         // label2
  126.                         //
  127.                         this.label2.Location = new System.Drawing.Point(8, 256);
  128.                         this.label2.Name = "label2";
  129.                         this.label2.Size = new System.Drawing.Size(160, 16);
  130.                         this.label2.TabIndex = 2;
  131.                         this.label2.Text = "Zip file comment:";
  132.                         //
  133.                         // txtComment
  134.                         //
  135.                         this.txtComment.Location = new System.Drawing.Point(8, 272);
  136.                         this.txtComment.Multiline = true;
  137.                         this.txtComment.Name = "txtComment";
  138.                         this.txtComment.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
  139.                         this.txtComment.Size = new System.Drawing.Size(592, 72);
  140.                         this.txtComment.TabIndex = 3;
  141.                         this.txtComment.Text = "";
  142.                         //
  143.                         // frmShowContents
  144.                         //
  145.                         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  146.                         this.ClientSize = new System.Drawing.Size(616, 400);
  147.                         this.Controls.Add(this.txtComment);
  148.                         this.Controls.Add(this.label2);
  149.                         this.Controls.Add(this.label1);
  150.                         this.Controls.Add(this.dataGrid1);
  151.                         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
  152.                         this.MaximizeBox = false;
  153.                         this.MinimizeBox = false;
  154.                         this.Name = "frmShowContents";
  155.                         this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  156.                         this.Text = "frmShowContents";
  157.                         this.Load += new System.EventHandler(this.frmShowContents_Load);
  158.                         ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
  159.                         this.ResumeLayout(false);
  160.  
  161.                 }
  162.                 #endregion
  163.  
  164.                 private void frmShowContents_Load(object sender, System.EventArgs e)
  165.                 {
  166.  
  167.                 }
  168.         }
  169. }
  170.