Пример #1
0
        public void UpdateTableViewDataByBookID(int bookID)
        {
            if (AnnotationList == null)
            {
                AnnotationList = new List <Annotation> ();
            }
            else
            {
                AnnotationList.Clear();
            }

            var annotationList = AnnotationUtil.Instance.GetAnnotations();

            if (annotationList != null)
            {
                var sameTitleList = annotationList.FindAll((item) => item.BookId == bookID);
                AnnotationList.AddRange(sameTitleList);
            }

            if (AnnotationList == null || AnnotationList.Count == 0)
            {
                InfoView.Hidden = false;
                AnnotationTableView.EnclosingScrollView.Hidden = true;
            }
            else
            {
                InfoView.Hidden = true;
                AnnotationTableView.EnclosingScrollView.Hidden = false;

                AnnotationTableView.ReloadData();
            }
        }
Пример #2
0
        private void InitProperties()
        {
            AnnotationTableView.UsesAlternatingRowBackgroundColors = false;
            AnnotationTableView.SelectionHighlightStyle            = NSTableViewSelectionHighlightStyle.Regular;
            AnnotationTableView.GridStyleMask = NSTableViewGridStyle.None;
            AnnotationTableView.EnclosingScrollView.BorderType                   = NSBorderType.BezelBorder;
            AnnotationTableView.EnclosingScrollView.ScrollerKnobStyle            = NSScrollerKnobStyle.Light;
            AnnotationTableView.EnclosingScrollView.VerticalScroller.ControlSize = NSControlSize.Small;

            //AnnotationTableView.DataSource = new AnnotationsTableDataSource (AnnotationList);
            //AnnotationTableView.Delegate = new AnnotationsTableDelegate (AnnotationList, this);
            AnnotationTableView.ReloadData();

            InfoLabelTF.StringValue = "No annotations match your search criteria.";
        }