Skip to content

Instantly share code, notes, and snippets.

@androidcn
Created May 5, 2013 13:15
Show Gist options
  • Select an option

  • Save androidcn/5520805 to your computer and use it in GitHub Desktop.

Select an option

Save androidcn/5520805 to your computer and use it in GitHub Desktop.

Revisions

  1. androidcn created this gist May 5, 2013.
    72 changes: 72 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,72 @@
    public class TableSourse<T>:UITableViewSource{
    protected List<T> listItems;

    public TableSourse(UIViewController comeView,List<T> comeListItems)
    {
    this.orgView=comeView;

    listItems=comeListItems;
    }
    public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
    {
    if (orgView.NibName.Contains ("First")) {
    //listItems as Shanghai
    //
    listItems [indexPath.Row].GoldName;
    }
    else
    {
    //listItems as Foreign

    listItems [indexPath.Row].SecName;

    }

    }
    }

    public void Main:UIViewController{
    List<Shanghai> sh=new List<ShangHai>();
    sh=getGold();
    tableSHGold.Source=new tableSource(this,sh);
    List<Foreign> fo=new List<Foreign>();
    fo=getFoGold();
    tablefoGold.Source=new tableSource(this,fo);
    }

    public class Shanghai
    {
    public Shanghai ()
    {
    }
    [SQLite.PrimaryKey]
    public string GoldType{get;set;}
    public string GoldName{get;set;}
    public DateTime NewTime{get;set;}
    public decimal HighPrice{get;set;}
    public decimal NewPrice{get;set;}
    public decimal OpenPrice{get;set;}
    public decimal LowPrice{get;set;}
    public decimal LastPrice{get;set;}
    public decimal BuyPrice{get;set;}
    public decimal SellPrice{get;set;}


    }
    public class Foreign
    {
    public Foreign ()
    {
    }
    [SQLite.PrimaryKey]
    public string SecCod{get;set;}
    public string SecName{get;set;}
    public string PriceTime{get;set;}
    public decimal BuyNum{get;set;}
    public decimal SelNum{get;set;}
    public decimal SelPri{get;set;}
    public decimal BuyPri{get;set;}
    public string Currency{get;set;}

    }