public override void ViewDidLoad()
        {
            ReloadTagsData();

            TagsTableView.UsesAlternatingRowBackgroundColors = false;
            TagsTableView.SelectionHighlightStyle            = NSTableViewSelectionHighlightStyle.Regular;
            TagsTableView.GridStyleMask = NSTableViewGridStyle.None;
            TagsTableView.EnclosingScrollView.BorderType = NSBorderType.BezelBorder;

            TagsTableView.DataSource = new AHLTagsTableDataSource(TagsList);
            TagsTableView.Delegate   = new AHLTagsTableDelegate(TagsList, this);
            TagsTableView.ReloadData();

            var attributedTitle = Utility.AttributeTitle("Delete", NSColor.Red, 12);

            DelNoteButton.AttributedTitle = attributedTitle;
            var alterTitle = Utility.AttributeTitle("Delete", NSColor.DarkGray, 12);

            DelNoteButton.AttributedAlternateTitle = alterTitle;

            attributedTitle = Utility.AttributeTitle("Add Note", NSColor.Red, 12);
            AddNoteButton.AttributedTitle = attributedTitle;
            alterTitle = Utility.AttributeTitle("Add Note", NSColor.DarkGray, 12);
            AddNoteButton.AttributedAlternateTitle = alterTitle;

            attributedTitle            = Utility.AttributeTitle("Edit", NSColor.Red, 12);
            EditButton.AttributedTitle = attributedTitle;
            alterTitle = Utility.AttributeTitle("Edit", NSColor.Red, 12);
            EditButton.AttributedAlternateTitle = alterTitle;
        }
Пример #2
0
        void ReleaseDesignerOutlets()
        {
            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

            if (SaveButton != null)
            {
                SaveButton.Dispose();
                SaveButton = null;
            }

            if (TagsTableView != null)
            {
                TagsTableView.Dispose();
                TagsTableView = null;
            }

            if (TextField != null)
            {
                TextField.Dispose();
                TextField = null;
            }
        }
        public void ReloadTagsData()
        {
            List <ColorTagState> backupTags = null;

            if (TagsList == null)
            {
                TagsList = new List <ColorTagState> ();
            }
            else
            {
                backupTags = new List <ColorTagState> ();
                backupTags.AddRange(TagsList);
                TagsList.Clear();
            }

            if (AnnCategoryTagUtil.Instance == null)
            {
                return;
            }

            var tagList     = AnnCategoryTagUtil.Instance.GetTags();
            var tempTagList = new List <AnnotationTag> ();

            tempTagList.AddRange(tagList);

            if (tagList != null)
            {
                foreach (var tag in tempTagList)
                {
                    var colorTag = new ColorTagState();
                    colorTag.CheckState = NSCellStateValue.Off;
                    if (backupTags != null)
                    {
                        for (int i = 0; i < backupTags.Count; i++)
                        {
                            if (tag.TagId == backupTags [i].Tag.TagId)
                            {
                                colorTag.CheckState = backupTags [i].CheckState;
                                break;
                            }
                        }
                    }

                    colorTag.Tag = tag;
                    TagsList.Add(colorTag);
                }
            }

            if (backupTags != null)
            {
                backupTags.Clear();
                backupTags = null;
            }

            if (TagsTableView != null)
            {
                TagsTableView.ReloadData();
            }
        }
Пример #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var tableViewSource = new SelectTagsTableViewSource(TagsTableView);

            tableViewSource.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectTag.Inputs)
            .DisposedBy(DisposeBag);

            var tagsReplay = ViewModel.Tags.Replay();

            tagsReplay
            .Subscribe(TagsTableView.Rx().ReloadItems(tableViewSource))
            .DisposedBy(DisposeBag);

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                tagsReplay
                .Select((tags) =>
                {
                    var count         = tags.ToList().Count();
                    var contentHeight = count > 0
                            ? count * SelectTagsTableViewSource.RowHeight
                            : placeholderHeight;
                    return(new CoreGraphics.CGSize(0, contentHeight + headerHeight));
                })
                .Subscribe(this.Rx().PreferredContentSize())
                .DisposedBy(DisposeBag);
            }

            tagsReplay.Connect();

            ViewModel.IsEmpty
            .Subscribe(EmptyStateImage.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateLabel.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.FilterText
            .Subscribe(TextField.Rx().TextObserver())
            .DisposedBy(DisposeBag);

            CloseButton.Rx().Tap()
            .Subscribe(ViewModel.CloseWithDefaultResult)
            .DisposedBy(DisposeBag);

            SaveButton.Rx()
            .BindAction(ViewModel.Save)
            .DisposedBy(DisposeBag);

            TextField.Rx().Text()
            .Subscribe(ViewModel.FilterText)
            .DisposedBy(DisposeBag);

            BottomConstraint.Active |= UIDevice.CurrentDevice.UserInterfaceIdiom != UIUserInterfaceIdiom.Pad;
        }
Пример #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CloseButton.SetTemplateColor(ColorAssets.Text2);

            SearchView.InsertSeparator();

            TitleLabel.Text       = Resources.Tags;
            TextField.Placeholder = Resources.AddFilterTags;
            EmptyStateLabel.Text  = Resources.EmptyTagText;
            SaveButton.SetTitle(Resources.Save, UIControlState.Normal);

            var tableViewSource = new SelectTagsTableViewSource(TagsTableView);

            tableViewSource.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectTag.Inputs)
            .DisposedBy(DisposeBag);

            tableViewSource.Rx().DragStarted()
            .Subscribe(_ => TextField.ResignFirstResponder())
            .DisposedBy(DisposeBag);

            var tagsReplay = ViewModel.Tags.Replay();

            tagsReplay
            .Subscribe(TagsTableView.Rx().ReloadItems(tableViewSource))
            .DisposedBy(DisposeBag);

            tagsReplay.Connect();

            ViewModel.IsEmpty
            .Subscribe(EmptyStateImage.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateLabel.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.FilterText
            .Subscribe(TextField.Rx().TextObserver())
            .DisposedBy(DisposeBag);

            CloseButton.Rx().Tap()
            .Subscribe(() => ViewModel.CloseWithDefaultResult())
            .DisposedBy(DisposeBag);

            SaveButton.Rx()
            .BindAction(ViewModel.Save)
            .DisposedBy(DisposeBag);

            TextField.Rx().Text()
            .Subscribe(ViewModel.FilterText)
            .DisposedBy(DisposeBag);

            BottomConstraint.Active |= TraitCollection.HorizontalSizeClass == UIUserInterfaceSizeClass.Compact;
        }
        void ReleaseDesignerOutlets()
        {
            if (BottomConstraint != null)
            {
                BottomConstraint.Dispose();
                BottomConstraint = null;
            }

            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

            if (EmptyStateImage != null)
            {
                EmptyStateImage.Dispose();
                EmptyStateImage = null;
            }

            if (EmptyStateLabel != null)
            {
                EmptyStateLabel.Dispose();
                EmptyStateLabel = null;
            }

            if (SaveButton != null)
            {
                SaveButton.Dispose();
                SaveButton = null;
            }

            if (TagsTableView != null)
            {
                TagsTableView.Dispose();
                TagsTableView = null;
            }

            if (TextField != null)
            {
                TextField.Dispose();
                TextField = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (SearchView != null)
            {
                SearchView.Dispose();
                SearchView = null;
            }
        }
        public override void ViewDidLoad()
        {
            ReloadTagsData();

            TagsTableView.UsesAlternatingRowBackgroundColors = false;
            TagsTableView.SelectionHighlightStyle            = NSTableViewSelectionHighlightStyle.Regular;
            TagsTableView.GridStyleMask = NSTableViewGridStyle.None;
            TagsTableView.EnclosingScrollView.BorderType = NSBorderType.BezelBorder;

            TagsTableView.DataSource = new AHLTagsTableDataSource(TagsList);
            TagsTableView.Delegate   = new AHLTagsTableDelegate(TagsList, this);
            TagsTableView.ReloadData();

            var attributedTitle = Utility.AttributeTitle("Delete", NSColor.Red, 12);

            DelNoteButton.AttributedTitle = attributedTitle;
            var alterTitle = Utility.AttributeTitle("Delete", NSColor.DarkGray, 12);

            DelNoteButton.AttributedAlternateTitle = alterTitle;


            attributedTitle            = Utility.AttributeTitle("Edit", NSColor.Red, 12);
            EditButton.AttributedTitle = attributedTitle;
            alterTitle = Utility.AttributeTitle("Edit", NSColor.Red, 12);
            EditButton.AttributedAlternateTitle = alterTitle;

            attributedTitle            = Utility.AttributeTitle("Note", NSColor.Brown, 12);
            NoteButton.AttributedTitle = attributedTitle;
            alterTitle = Utility.AttributeTitle("Note", NSColor.DarkGray, 12);
            NoteButton.AttributedAlternateTitle = alterTitle;

            attributedTitle = Utility.AttributeTitle("Delete Annotation", NSColor.Brown, 12);
            DelAnnotationBtn.AttributedTitle = attributedTitle;
            alterTitle = Utility.AttributeTitle("Delete Annotation", NSColor.DarkGray, 12);
            DelAnnotationBtn.AttributedAlternateTitle = alterTitle;

            NoteBkgView.WantsLayer            = true;
            NoteBkgView.Layer.BackgroundColor = Utility.ColorWithRGB(253, 251, 176, 1.0f).CGColor;

            HSeprator.WantsLayer            = true;
            HSeprator.Layer.BackgroundColor = NSColor.Grid.CGColor;

            VSeprator.WantsLayer            = true;
            VSeprator.Layer.BackgroundColor = NSColor.Grid.CGColor;

            NoteTextView.BackgroundColor = Utility.ColorWithRGB(253, 251, 176, 1.0f);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var tableViewSource = new SelectTagsTableViewSource(TagsTableView);

            tableViewSource.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectTag.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.Tags
            .Subscribe(TagsTableView.Rx().ReloadItems(tableViewSource))
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateImage.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateLabel.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.FilterText
            .Subscribe(TextField.Rx().TextObserver())
            .DisposedBy(DisposeBag);

            CloseButton.Rx()
            .BindAction(ViewModel.Close)
            .DisposedBy(DisposeBag);

            SaveButton.Rx()
            .BindAction(ViewModel.Save)
            .DisposedBy(DisposeBag);

            TextField.Rx().Text()
            .Subscribe(ViewModel.FilterText)
            .DisposedBy(DisposeBag);
        }
Пример #9
0
        public void ReloadAnnotationData()
        {
            if (AnnCategoryTagUtil.Instance == null)
            {
                return;
            }
            if (TagsList == null)
            {
                TagsList = new List <AnnotationTag> ();
            }
            else
            {
                TagsList.Clear();
            }

            var tag = new AnnotationTag();

            tag.Color = string.Empty;
            tag.Title = "All Tags";
            tag.TagId = Guid.Empty;
            TagsList.Add(tag);

            var noTag = new AnnotationTag();

            noTag.Color = string.Empty;
            noTag.Title = "No tag";
            noTag.TagId = Guid.Empty;
            TagsList.Add(noTag);

            var tags = AnnCategoryTagUtil.Instance.GetTags();

            TagsList.AddRange(tags);

            if (TagsTableView != null)
            {
                TagsTableView.ReloadData();
            }
        }
Пример #10
0
        void ReleaseDesignerOutlets()
        {
            if (AddNoteButton != null)
            {
                AddNoteButton.Dispose();
                AddNoteButton = null;
            }

            if (AssignLabelTF != null)
            {
                AssignLabelTF.Dispose();
                AssignLabelTF = null;
            }

            if (DelNoteButton != null)
            {
                DelNoteButton.Dispose();
                DelNoteButton = null;
            }

            if (EditButton != null)
            {
                EditButton.Dispose();
                EditButton = null;
            }

            if (TagsTableView != null)
            {
                TagsTableView.Dispose();
                TagsTableView = null;
            }

            if (TitleLabelTF != null)
            {
                TitleLabelTF.Dispose();
                TitleLabelTF = null;
            }
        }
Пример #11
0
        void ReleaseDesignerOutlets()
        {
            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

            if (SaveButton != null)
            {
                SaveButton.Dispose();
                SaveButton = null;
            }

            if (TagsTableView != null)
            {
                TagsTableView.Dispose();
                TagsTableView = null;
            }

            if (TextField != null)
            {
                TextField.Dispose();
                TextField = null;
            }

            if (EmptyStateImage != null)
            {
                EmptyStateImage.Dispose();
                EmptyStateImage = null;
            }

            if (EmptyStateLabel != null)
            {
                EmptyStateLabel.Dispose();
                EmptyStateLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AllButton != null)
            {
                AllButton.Dispose();
                AllButton = null;
            }

            if (AnnotationCustomView != null)
            {
                AnnotationCustomView.Dispose();
                AnnotationCustomView = null;
            }

            if (AnnotationTableView != null)
            {
                AnnotationTableView.Dispose();
                AnnotationTableView = null;
            }

            if (FunctionButtonView != null)
            {
                FunctionButtonView.Dispose();
                FunctionButtonView = null;
            }

            if (HighlightsButton != null)
            {
                HighlightsButton.Dispose();
                HighlightsButton = null;
            }

            if (NotesButton != null)
            {
                NotesButton.Dispose();
                NotesButton = null;
            }

            if (OrphansButton != null)
            {
                OrphansButton.Dispose();
                OrphansButton = null;
            }

            if (TagsTableView != null)
            {
                TagsTableView.Dispose();
                TagsTableView = null;
            }

            if (TagsView != null)
            {
                TagsView.Dispose();
                TagsView = null;
            }

            if (InfoLabelTF != null)
            {
                InfoLabelTF.Dispose();
                InfoLabelTF = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AssignLabelTF != null)
            {
                AssignLabelTF.Dispose();
                AssignLabelTF = null;
            }

            if (DateLabelTF != null)
            {
                DateLabelTF.Dispose();
                DateLabelTF = null;
            }

            if (DelAnnotationBtn != null)
            {
                DelAnnotationBtn.Dispose();
                DelAnnotationBtn = null;
            }

            if (DelNoteButton != null)
            {
                DelNoteButton.Dispose();
                DelNoteButton = null;
            }

            if (EditButton != null)
            {
                EditButton.Dispose();
                EditButton = null;
            }

            if (HSeprator != null)
            {
                HSeprator.Dispose();
                HSeprator = null;
            }

            if (NoteBkgView != null)
            {
                NoteBkgView.Dispose();
                NoteBkgView = null;
            }

            if (NoteButton != null)
            {
                NoteButton.Dispose();
                NoteButton = null;
            }

            if (NoteTextView != null)
            {
                NoteTextView.Dispose();
                NoteTextView = null;
            }

            if (TagsTableView != null)
            {
                TagsTableView.Dispose();
                TagsTableView = null;
            }

            if (TitleLabelTF != null)
            {
                TitleLabelTF.Dispose();
                TitleLabelTF = null;
            }

            if (VSeprator != null)
            {
                VSeprator.Dispose();
                VSeprator = null;
            }
        }