// clsResults.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.Collections;
using System.Windows.Forms;
using ZANZILib.Protocols.ItemCharacteristic;
using ZANZILib.Protocols.ResultOne;
using System;
using System.ComponentModel;


namespace ZANZI.Test
{
    /// <summary>
    /// testclass to return a arry of result objects.
    /// </summary>
    [Serializable]
    public class clsTest
    {
        #region Variable declaration

        #endregion

        #region Structures

        #endregion

        #region Functions
        
        //public ArrayList GetResultPaneTestData()
        //{
        //    //Testcode results
        //    ArrayList al = new ArrayList();

        //    clsZanziProtResultOne retval = new clsZanziProtResultOne("None",
        //                                                             "myprodname", "Branch One", "USD", 1234, 1, 44,
        //                                                             "Karel Jordaan", "My City", "My Address", 222222,
        //                                                             33333, 444444, "Business Name", 55555);


        //    clsZanziProtResultOne retval2 = new clsZanziProtResultOne("My Alias",
        //                                                              "This Prod Name", "Branch Two", "CAD", 01234, 9,
        //                                                              841, "My Name", "new", "adress1", 0222222, 133333,
        //                                                              7444444, "Company Name", 15555);


        //    al.Add(retval);
        //    al.Add(retval2);

        //    //	DataTable dt = new DataTable();
        //    //dt.Rows.Add(retval.to);
        //    //dt.Rows.Add(retval2);
        //    //dt.


        //    return al;
        //}


        public ZanziProtResultCollection GetResultPaneTestData()
        {

            ZanziProtResultCollection col = new ZanziProtResultCollection();

            clsZanziProtResultOne result = new clsZanziProtResultOne("No Result",
                                             "ProductName", "Somewhere", "ZAR", 1234, 1, 44, "Karel Jordaan",
                                             "Cape Town", "Address", 222222, 33333, 444444, "ACME", 55555);



            clsZanziProtResultOne retval2 = new clsZanziProtResultOne("My Alias",
                                                          "This Prod Name", "Branch Two", "CAD", 01234, 9,
                                                          841, "My Name", "new", "adress1", 0222222, 133333,
                                                          7444444, "Company Name", 15555);

            col.Add(result);
            col.Add(retval2);
            return col;


        }


        public clsZanziProtResultOne GetSingleResultOneTestData()
        {
            clsZanziProtResultOne result =  new clsZanziProtResultOne("No Result",
                                             "ProductName", "Somewhere", "ZAR", 1234, 1, 44, "Karel Jordaan",
                                             "Cape Town", "Address", 222222, 33333, 444444, "ACME", 55555);

            //ZanziProtResultCollection col = new ZanziProtResultCollection();
            //col.Add(result);
            return result;

        
        }
        //public clsZanziProtResultOne GetSingleResultOneTestData()
        //{
        //    return new clsZanziProtResultOne("No Result",
        //                                     "ProductName", "Somewhere", "ZAR", 1234, 1, 44, "Karel Jordaan",
        //                                     "Cape Town", "Address", 222222, 33333, 444444, "ACME", 55555);
        //}

        
        public void GetCharacteristicsTestData(ListView lst)
        {
            clsZanziProtItemCharacteristic clsChar = new clsZanziProtItemCharacteristic("somename", "somevalue");


            ListViewItem lstitm = new ListViewItem();
            lstitm.Text = clsChar.CharName;
            lstitm.SubItems.Add(clsChar.CharValue);
            lst.Items.Add(lstitm);
        }


        public long GetCurrentSelectedRecordGUI()
        {
            return 1111;
        }


        //#region clsZanziProtResultOne Collection Wrapper

        ///// <summary>
        ///// A class to facilitate the functionality of the collection editor
        ///// In order to serialize the clsZanziProtResultOne collection 
        ///// </summary>
        //[Serializable]
        //public class ZanziProtResultCollection : CollectionBase
        //{
        //    public clsZanziProtResultOne this[int index]
        //    {
        //        get { return ((clsZanziProtResultOne)List[index]); }
        //        set { List[index] = value; }
        //    }

        //    public int Add(clsZanziProtResultOne value)
        //    {
        //        return (List.Add(value));
        //    }

        //    public int IndexOf(clsZanziProtResultOne value)
        //    {
        //        return (List.IndexOf(value));
        //    }

        //    public void Insert(int index, clsZanziProtResultOne value)
        //    {
        //        List.Insert(index, value);
        //    }

        //    public void Remove(clsZanziProtResultOne value)
        //    {
        //        List.Remove(value);
        //    }

        //    public bool Contains(clsZanziProtResultOne value)
        //    {
        //        // If value is not of type Int16, this will return false.
        //        return (List.Contains(value));
        //    }

        //    protected override void OnInsert(int index, Object value)
        //    {
        //        // Insert additional code to be run only when inserting values.
        //    }

        //    protected override void OnRemove(int index, Object value)
        //    {
        //        // Insert additional code to be run only when removing values.
        //    }

        //    protected override void OnSet(int index, Object oldValue, Object newValue)
        //    {
        //        // Insert additional code to be run only when setting values.
        //    }

        //    //			protected override void OnValidate( Object value )  
        //    //			{
        //    //				if ( value.GetType() != Type.GetType("System.Int16") )
        //    //					throw new ArgumentException( "value must be of type Int16.", "value" );
        //    //			}
        //}

        //#endregion

        #endregion

        #region Menu handlers

        #endregion

        #region Custom Windows Form Designer generated code

        #endregion

        #region Events

        #endregion
    }
}