Exemplo n.º 1
0
        private void ParseTags(IXLRange range)
        {
            var innerRanges = range.GetContainingNames().ToArray();
            var cells       = from c in _cells
                              let value = c.GetString()
                                          where (value.StartsWith("<<") || value.EndsWith(">>")) &&
                                          !innerRanges.Any(nr => nr.Ranges.Contains(c.XLCell.AsRange()))
                                          select c;

            foreach (var cell in cells)
            {
                OptionTag[] tags;
                string      newValue;
                if (cell.CellType == TemplateCellType.Formula)
                {
                    tags         = _tagsEvaluator.Parse(cell.Formula, range, cell, out newValue);
                    cell.Formula = newValue;
                }
                else
                {
                    tags       = _tagsEvaluator.Parse(cell.GetString(), range, cell, out newValue);
                    cell.Value = newValue;
                }
                if (cell.Row > _rowCnt)
                {
                    _rangeTags.AddRange(tags);
                }
                else
                {
                    _tags.AddRange(tags);
                }
            }

            _rangeOption = _rangeTags.GetAll <RangeOptionTag>().FirstOrDefault();
        }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            if (TagsList == null)
            {
                TagsList = new List <AnnotationTag> (0);
            }
            else
            {
                TagsList.Clear();
            }

            var tagList = AnnCategoryTagUtil.Instance.GetTags();

            if (tagList != null)
            {
                TagsList.AddRange(tagList);
            }

            TagTableView.UsesAlternatingRowBackgroundColors               = false;
            TagTableView.EnclosingScrollView.ScrollerKnobStyle            = NSScrollerKnobStyle.Default;
            TagTableView.EnclosingScrollView.VerticalScroller.ControlSize = NSControlSize.Small;
            TagTableView.SelectionHighlightStyle             = NSTableViewSelectionHighlightStyle.Regular;
            TagTableView.EnclosingScrollView.BackgroundColor = NSColor.White;
            TagTableView.EnclosingScrollView.BorderType      = NSBorderType.BezelBorder;
            TagTableView.GridStyleMask = NSTableViewGridStyle.None;

            TagTableView.DataSource = new EditTagTableDataSource(TagsList, this);
            TagTableView.Delegate   = new EditTagTableDelegate(TagsList, this);
            TagTableView.ReloadData();

            var attributedTitle = Utility.AttributeTitle("Done", NSColor.Red, 13);

            DoneButton.AttributedTitle = attributedTitle;
            var alterTitle = Utility.AttributeTitle("Done", NSColor.Red, 13);

            DoneButton.AttributedAlternateTitle = alterTitle;

            string[] typeArray = { "NSStringPboardType" };
            TagTableView.RegisterForDraggedTypes(typeArray);

            this.CurrentTagIndex = -1;
        }
Exemplo n.º 3
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();
            }
        }