protected void ReadSimple( SearchItem [] items )
        {
            DataTable table = new SearchResult( items ) ;
            _listView.DataContext = table ;

            XDataSearchResultHeader gridView = new XDataSearchResultHeader() ;
            _listView.View = gridView ;

            Binding bind = new Binding() ;
            _listView.DataContext = table ;
            _listView.SetBinding( ListView.ItemsSourceProperty, bind ) ;
        }
        public SearchResult( SearchItem [] items )
        {
            DataColumn column = new DataColumn() ;
            column.DataType = typeof ( string ) ;
            column.Caption = Resources.Constant_Jid ;
            column.ColumnName = "jid" ;
            Columns.Add( column ) ;

            column = new DataColumn() ;
            column.DataType = typeof ( string ) ;
            column.Caption = Resources.Constant_FirstName ;
            column.ColumnName = "first" ;
            Columns.Add( column ) ;

            column = new DataColumn() ;
            column.DataType = typeof ( string ) ;
            column.Caption = Resources.Constant_LastName ;
            column.ColumnName = "last" ;
            Columns.Add( column ) ;

            column = new DataColumn() ;
            column.DataType = typeof ( string ) ;
            column.Caption = Resources.Constant_Nickname ;
            column.ColumnName = "nick" ;
            Columns.Add( column ) ;

            column = new DataColumn() ;
            column.DataType = typeof ( string ) ;
            column.Caption = Resources.Constant_Email ;
            column.ColumnName = "email" ;
            Columns.Add( column ) ;

            foreach ( SearchItem item in items )
            {
                DataRow row = NewRow() ;
                row[ "jid" ] = item.Jid ;
                row[ "first" ] = item.Firstname ;
                row[ "last" ] = item.Lastname ;
                row[ "nick" ] = item.Nickname ;
                row[ "email" ] = item.Email ;

                Rows.Add( row ) ;
            }
        }
Beispiel #3
0
 /// <summary>
 /// Retrieve the result items of a search
 /// </summary>
 //public ElementList GetItems
 //{
 //    get
 //    {
 //        return this.SelectElements("item");
 //    }
 //}
 public SearchItem[] GetItems()
 {
     ElementList nl = SelectElements(typeof(SearchItem));
     SearchItem[] items = new SearchItem[nl.Count];
     int i = 0;
     foreach (Element e in nl)
     {
         items[i] = (SearchItem)e;
         i++;
     }
     return items;
 }