private void LoadData()
        {
            listSource = db.selectTable();
            var adapter = new ListViewAdaptor(this, listSource);

            lstViewData.Adapter = adapter;
        }
 /// <summary>
 /// Fills the controls.
 /// </summary>
 private void FillControls()
 {
     lstTaskDetail.Adapter = null;
     var hourCount = this.timesheetRepository.GetTaskHours(timesheetWorkDetails);
     txtTotalTaskHourCount.Text = hourCount.ToString();
     ApplicationData.TaskHours = hourCount;
     if (timesheetWorkDetails.Count > 0)
     {
         ApplicationData.IsRedirectedFromHome = false;
         var adapter = new ListViewAdaptor(this, timesheetWorkDetails);
         adapter.SetTotalHours += SetTotalHours;
         lstTaskDetail.Adapter = adapter;
     }
     else if (ApplicationData.IsRedirectedFromHome)
     {
         ApplicationData.IsRedirectedFromHome = false;
         ApplicationData.IsRedirectedFromTaskDetail = true;
         StartActivity(typeof(TimeSheetActivity));
     }
     else
     {
         lblTaskMessage.Visibility = Android.Views.ViewStates.Visible;
     }
 }
Example #3
0
        public AssetLister(
            IControlHostService controlHostService,
            IContextService contextService,
            ICommandService commandService,
            IFileDialogService fileDialogService)
        {
            m_controlHostService = controlHostService;
            m_contextService     = contextService;
            m_commandService     = commandService;
            m_fileDialogService  = fileDialogService;

            m_treeControl                = new TreeControl();
            m_treeControl.Dock           = DockStyle.Fill;
            m_treeControl.AllowDrop      = true;
            m_treeControl.SelectionMode  = SelectionMode.MultiExtended;
            m_treeControl.ImageList      = ResourceUtil.GetImageList16();
            m_treeControl.StateImageList = ResourceUtil.GetImageList16();

            m_treeControl.DragOver        += new DragEventHandler(treeControl_DragOver);
            m_treeControl.DragDrop        += new DragEventHandler(treeControl_DragDrop);
            m_treeControl.MouseDown       += new MouseEventHandler(treeControl_MouseDown);
            m_treeControl.MouseUp         += new MouseEventHandler(treeControl_MouseUp);
            m_treeControl.NodeLabelEdited += new EventHandler <TreeControl.NodeEventArgs>(treeControl_NodeLabelEdited);

            m_listView           = new ListView();
            m_listView.View      = View.Details;
            m_listView.Dock      = DockStyle.Fill;
            m_listView.AllowDrop = true;
            m_listView.LabelEdit = false;

            m_listView.MouseDown   += new MouseEventHandler(thumbnailControl_MouseDown);
            m_listView.MouseUp     += new MouseEventHandler(thumbnailControl_MouseUp);
            m_listView.MouseMove   += new MouseEventHandler(thumbnailControl_MouseMove);
            m_listView.MouseLeave  += new EventHandler(thumbnailControl_MouseLeave);
            m_listView.DoubleClick += new EventHandler(thumbnailControl_DoubleClick);
            m_listView.DragOver    += new DragEventHandler(thumbnailControl_DragOver);
            m_listView.DragDrop    += new DragEventHandler(thumbnailControl_DragDrop);

            m_thumbnailControl = new ThumbnailControl();
            m_thumbnailControl.IndicatorImageList = ResourceUtil.GetImageList16();
            m_thumbnailControl.Dock              = DockStyle.Fill;
            m_thumbnailControl.AllowDrop         = true;
            m_thumbnailControl.BackColor         = SystemColors.Window;
            m_thumbnailControl.SelectionChanged += new EventHandler(thumbnailControl_SelectionChanged);
            m_thumbnailControl.MouseDown        += new MouseEventHandler(thumbnailControl_MouseDown);
            m_thumbnailControl.MouseMove        += new MouseEventHandler(thumbnailControl_MouseMove);
            m_thumbnailControl.MouseUp          += new MouseEventHandler(thumbnailControl_MouseUp);
            m_thumbnailControl.MouseLeave       += new EventHandler(thumbnailControl_MouseLeave);
            m_thumbnailControl.DoubleClick      += new EventHandler(thumbnailControl_DoubleClick);
            m_thumbnailControl.DragOver         += new DragEventHandler(thumbnailControl_DragOver);
            m_thumbnailControl.DragDrop         += new DragEventHandler(thumbnailControl_DragDrop);

            m_splitContainer             = new SplitContainer();
            m_splitContainer.Name        = "Asset";
            m_splitContainer.Orientation = Orientation.Vertical;
            m_splitContainer.Panel1.Controls.Add(m_treeControl);
            m_splitContainer.Panel2.Controls.Add(m_thumbnailControl);
            m_splitContainer.Panel2.Controls.Add(m_listView);

            m_listView.Hide();

            m_selection.Changed += new EventHandler(selection_Changed);

            m_treeControlAdapter          = new TreeControlAdapter(m_treeControl);
            m_assetFolderTreeView         = new AssetFolderTreeView(this);
            m_treeControlAdapter.TreeView = m_assetFolderTreeView;

            m_listViewAdaptor   = new ListViewAdaptor(m_listView);
            m_assetItemListView = new AssetItemListView(this);
        }