// ctrlTransfer.cs
// Copyright (C) 2008 Karel Jordaan karel_jordaan@yahoo.com.au
// 
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

using System;
using System.ComponentModel;
using System.Windows.Forms;
using GUIControlLogic;
using ZANZI.ctrl;

namespace ZANZIClient
{
    /// <summary>
    /// Summary description for ctrlTransfer.
    /// </summary>
    public class ctrlTransfer : UserControl, Ictrl
    {
        private ColumnHeader columnHeader1;
        private ColumnHeader columnHeader10;
        private ColumnHeader columnHeader11;
        private ColumnHeader columnHeader12;
        private ColumnHeader columnHeader13;
        private ColumnHeader columnHeader2;
        private ColumnHeader columnHeader3;
        private ColumnHeader columnHeader4;
        private ColumnHeader columnHeader5;
        private ColumnHeader columnHeader6;
        private ColumnHeader columnHeader8;
        private ColumnHeader columnHeader9;

        private readonly clsTransfer clsManager;

        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private Container components;

        private Label lblDownloads;
        private Label lblUpload;
        public ListView listViewDowns;
        public ListView listViewUps;
        private Panel panel1;
        private Panel panel2;

        private PictureBox picIncoming;
        private PictureBox picOutgoing;


        //zzoi localized the hardcoded tabheader string
        //private string tabHeader;
        private ComponentResourceManager resources;
        // = new System.ComponentModel.ComponentResourceManager(typeof(ctrlDiscovery));

        private Splitter splitter1;



        public ctrlTransfer(clsMain  clsm)
        {

            //create a manager class for this frm
            //clsManager = new clsTransfer();

            //zzoi 10mrt 2009 load the lists from the clsmanager
            if (clsm.clst != null)
            {
                clsManager = clsm.clst;
            }
            else
            {
                clsManager = new clsTransfer(this);
                clsm.clst = clsManager;
            }



            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();


            // TODO: Add any initialization after the InitializeComponent call

            //this.listViewDowns = clsManager.DownList;
            //this.listViewUps = clsManager.UpList;
        }

        #region Ictrl Members

        public override string Text
        {
            //zzoi localized the hardcoded tabheader string
            get { return resources.GetString("tabHeader.Text"); }
            //get{ return  "Transfers";}
            //set{ m_CharValue = value;}
        }

        public  bool StaticControl
        {

            get { return true; }

        }


        /// <summary>
        /// Function for restCulture event raised when language is changed
        /// </summary>
        public void ResetCulture()
        {
            try
            {
                //zzoi 6 June 2008 impliment string replacements for text
                //zzoi 6 June 2008 impliment string replacements for text
                //zzoi 6 June 2008 added mnuitems for reset to other language
                Text = resources.GetString("tabHeader.Text");

                listViewDowns.Columns[0].Text = resources.GetString("columnHeader1.Text");
                listViewDowns.Columns[1].Text = resources.GetString("columnHeader2.Text");
                listViewDowns.Columns[2].Text = resources.GetString("columnHeader3.Text");
                listViewDowns.Columns[3].Text = resources.GetString("columnHeader4.Text");
                listViewDowns.Columns[4].Text = resources.GetString("columnHeader5.Text");
                listViewDowns.Columns[5].Text = resources.GetString("columnHeader6.Text");


                listViewDowns.Refresh();
                listViewUps.Columns[0].Text = resources.GetString("columnHeader8.Text");
                listViewUps.Columns[1].Text = resources.GetString("columnHeader9.Text");
                listViewUps.Columns[2].Text = resources.GetString("columnHeader10.Text");
                listViewUps.Columns[3].Text = resources.GetString("columnHeader11.Text");
                listViewUps.Columns[4].Text = resources.GetString("columnHeader12.Text");
                listViewDowns.Columns[5].Text = resources.GetString("columnHeader13.Text");


                listViewUps.Refresh();
            }
            catch (Exception )
            {
                 //new clsExeption(ex);
                //ErrByte = 1;
            }
        }





        #endregion

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        private void lblUpload_Click(object sender, EventArgs e)
        {
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            //ZZoi changed the variable to class scope
            //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ctrlDiscovery));
            resources = new System.ComponentModel.ComponentResourceManager(typeof (ctrlTransfer));
            //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ctrlTransfer));
            this.lblUpload = new System.Windows.Forms.Label();
            this.lblDownloads = new System.Windows.Forms.Label();
            this.panel1 = new System.Windows.Forms.Panel();
            
            //this.listViewDowns = new System.Windows.Forms.ListView();

            this.listViewDowns = clsManager.DownList;


            this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader6 = new System.Windows.Forms.ColumnHeader();
            this.splitter1 = new System.Windows.Forms.Splitter();
            this.panel2 = new System.Windows.Forms.Panel();

            //this.listViewUps = new System.Windows.Forms.ListView();

            this.listViewUps = clsManager.UpList;

            this.columnHeader8 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader9 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader10 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader11 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader12 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader13 = new System.Windows.Forms.ColumnHeader();
            this.picIncoming = new System.Windows.Forms.PictureBox();
            this.picOutgoing = new System.Windows.Forms.PictureBox();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize) (this.picIncoming)).BeginInit();
            ((System.ComponentModel.ISupportInitialize) (this.picOutgoing)).BeginInit();
            this.SuspendLayout();
            // 
            // lblUpload
            // 
            this.lblUpload.AccessibleDescription = null;
            this.lblUpload.AccessibleName = null;
            resources.ApplyResources(this.lblUpload, "lblUpload");
            this.lblUpload.Font = null;
            this.lblUpload.Name = "lblUpload";
            this.lblUpload.Click += new System.EventHandler(this.lblUpload_Click);
            // 
            // lblDownloads
            // 
            this.lblDownloads.AccessibleDescription = null;
            this.lblDownloads.AccessibleName = null;
            resources.ApplyResources(this.lblDownloads, "lblDownloads");
            this.lblDownloads.Font = null;
            this.lblDownloads.Name = "lblDownloads";
            // 
            // panel1
            // 
            this.panel1.AccessibleDescription = null;
            this.panel1.AccessibleName = null;
            resources.ApplyResources(this.panel1, "panel1");
            this.panel1.BackgroundImage = null;
            this.panel1.Controls.Add(this.listViewDowns);
            this.panel1.Font = null;
            this.panel1.Name = "panel1";
            // 
            // listViewDowns
            // 
            this.listViewDowns.AccessibleDescription = null;
            this.listViewDowns.AccessibleName = null;
            resources.ApplyResources(this.listViewDowns, "listViewDowns");
            this.listViewDowns.AllowColumnReorder = true;
            this.listViewDowns.BackgroundImage = null;
            this.listViewDowns.Columns.AddRange(new System.Windows.Forms.ColumnHeader[]
                                                    {
                                                        this.columnHeader1,
                                                        this.columnHeader2,
                                                        this.columnHeader3,
                                                        this.columnHeader4,
                                                        this.columnHeader5,
                                                        this.columnHeader6
                                                    });
            this.listViewDowns.FullRowSelect = true;
            this.listViewDowns.HideSelection = false;
            this.listViewDowns.MultiSelect = false;
            this.listViewDowns.Name = "listViewDowns";
            this.listViewDowns.Sorting = System.Windows.Forms.SortOrder.Ascending;
            this.listViewDowns.UseCompatibleStateImageBehavior = false;
            this.listViewDowns.View = System.Windows.Forms.View.Details;
            // 
            // columnHeader1
            // 
            resources.ApplyResources(this.columnHeader1, "columnHeader1");
            // 
            // columnHeader2
            // 
            resources.ApplyResources(this.columnHeader2, "columnHeader2");
            // 
            // columnHeader3
            // 
            resources.ApplyResources(this.columnHeader3, "columnHeader3");
            // 
            // columnHeader4
            // 
            resources.ApplyResources(this.columnHeader4, "columnHeader4");
            // 
            // columnHeader5
            // 
            resources.ApplyResources(this.columnHeader5, "columnHeader5");
            // 
            // columnHeader6
            // 
            resources.ApplyResources(this.columnHeader6, "columnHeader6");
            // 
            // splitter1
            // 
            this.splitter1.AccessibleDescription = null;
            this.splitter1.AccessibleName = null;
            resources.ApplyResources(this.splitter1, "splitter1");
            this.splitter1.BackgroundImage = null;
            this.splitter1.Font = null;
            this.splitter1.Name = "splitter1";
            this.splitter1.TabStop = false;
            // 
            // panel2
            // 
            this.panel2.AccessibleDescription = null;
            this.panel2.AccessibleName = null;
            resources.ApplyResources(this.panel2, "panel2");
            this.panel2.BackgroundImage = null;
            this.panel2.Controls.Add(this.listViewUps);
            this.panel2.Controls.Add(this.lblUpload);
            this.panel2.Font = null;
            this.panel2.Name = "panel2";
            // 
            // listViewUps
            // 
            this.listViewUps.AccessibleDescription = null;
            this.listViewUps.AccessibleName = null;
            resources.ApplyResources(this.listViewUps, "listViewUps");
            this.listViewUps.AllowColumnReorder = true;
            this.listViewUps.BackgroundImage = null;
            this.listViewUps.Columns.AddRange(new System.Windows.Forms.ColumnHeader[]
                                                  {
                                                      this.columnHeader8,
                                                      this.columnHeader9,
                                                      this.columnHeader10,
                                                      this.columnHeader11,
                                                      this.columnHeader12,
                                                      this.columnHeader13
                                                  });
            this.listViewUps.FullRowSelect = true;
            this.listViewUps.HideSelection = false;
            this.listViewUps.MultiSelect = false;
            this.listViewUps.Name = "listViewUps";
            this.listViewUps.Sorting = System.Windows.Forms.SortOrder.Ascending;
            this.listViewUps.UseCompatibleStateImageBehavior = false;
            this.listViewUps.View = System.Windows.Forms.View.Details;
            // 
            // columnHeader8
            // 
            resources.ApplyResources(this.columnHeader8, "columnHeader8");
            // 
            // columnHeader9
            // 
            resources.ApplyResources(this.columnHeader9, "columnHeader9");
            // 
            // columnHeader10
            // 
            resources.ApplyResources(this.columnHeader10, "columnHeader10");
            // 
            // columnHeader11
            // 
            resources.ApplyResources(this.columnHeader11, "columnHeader11");
            // 
            // columnHeader12
            // 
            resources.ApplyResources(this.columnHeader12, "columnHeader12");
            // 
            // columnHeader13
            // 
            resources.ApplyResources(this.columnHeader13, "columnHeader13");
            // 
            // picIncoming
            // 
            this.picIncoming.AccessibleDescription = null;
            this.picIncoming.AccessibleName = null;
            resources.ApplyResources(this.picIncoming, "picIncoming");
            this.picIncoming.BackgroundImage = null;
            this.picIncoming.Font = null;
            this.picIncoming.ImageLocation = null;
            this.picIncoming.Name = "picIncoming";
            this.picIncoming.TabStop = false;
            // 
            // picOutgoing
            // 
            this.picOutgoing.AccessibleDescription = null;
            this.picOutgoing.AccessibleName = null;
            resources.ApplyResources(this.picOutgoing, "picOutgoing");
            this.picOutgoing.BackgroundImage = null;
            this.picOutgoing.Font = null;
            this.picOutgoing.ImageLocation = null;
            this.picOutgoing.Name = "picOutgoing";
            this.picOutgoing.TabStop = false;
            // 
            // ctrlTransfer
            // 
            this.AccessibleDescription = null;
            this.AccessibleName = null;
            resources.ApplyResources(this, "$this");
            this.BackgroundImage = null;
            this.Controls.Add(this.picOutgoing);
            this.Controls.Add(this.picIncoming);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.splitter1);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.lblDownloads);
            this.Font = null;
            this.Name = "ctrlTransfer";
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize) (this.picIncoming)).EndInit();
            ((System.ComponentModel.ISupportInitialize) (this.picOutgoing)).EndInit();
            this.ResumeLayout(false);
        }

        #endregion

        #region Ictrl Members

        string Ictrl.Text
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        void Ictrl.ResetCulture()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        bool Ictrl.StaticControl
        {
            get { return true; }
        }

        #endregion
    }
}