示例#1
0
		public SourceList()
		{
			_listModel = new SourceListModel();
			
			this.Build();
			
			Gtk.TreeViewColumn titleCol = new Gtk.TreeViewColumn();
			Gtk.CellRenderer rend = new Gtk.CellRendererText();
			titleCol.Title = "Title";
			titleCol.Sizing = Gtk.TreeViewColumnSizing.Fixed;
			titleCol.PackStart(rend,true);
			titleCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderSourceTitle));
			titleCol.Resizable = true;
			rend.Width = 200;
			titleCol.MinWidth = 200;
			
			
//			Gtk.TreeViewColumn dateCol = new Gtk.TreeViewColumn();
//			rend = new Gtk.CellRendererText();
//			dateCol.Title = "Date";
//			dateCol.Sizing = Gtk.TreeViewColumnSizing.Fixed;
//			dateCol.PackStart(rend,false);
//			dateCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderSourceDate));		
//			dateCol.MinWidth = 150;
			
			SourceTreeView.AppendColumn(titleCol);
//			SourceTreeView.AppendColumn(dateCol);
			
			SourceTreeView.Model = null;
			_filterText = string.Empty;
			
			Gtk.TreeSelection selection = SourceTreeView.Selection;
			selection.Changed += new EventHandler(OnSelection_Changed);
		}
示例#2
0
 // GET api/<controller>
 public SourceListModel Get(int page, int rows)
 {
     int totalRecords = 0;
     var model = new SourceListModel();
     model.Rows = SourceRepository.Search(string.Empty, page, rows, out totalRecords);
     model.Page = page;
     model.Total = ((int)totalRecords / rows) + 1;
     model.Records = rows;
     return model;
 }
示例#3
0
        // GET api/<controller>
        public SourceListModel Get(int page, int rows)
        {
            int totalRecords = 0;
            var model        = new SourceListModel();

            model.Rows    = SourceRepository.Search(string.Empty, page, rows, out totalRecords);
            model.Page    = page;
            model.Total   = ((int)totalRecords / rows) + 1;
            model.Records = rows;
            return(model);
        }