Exemplo n.º 1
0
        public WrappedTagBlockEntry GetTopLevelWrapper(TagBlockData block, WrappedTagBlockEntry wrapper)
        {
            FlattenedTagBlock flattened;

            if (_flattenInfo.TryGetValue(block, out flattened))
            {
                return(flattened.GetTopLevelWrapper(wrapper));
            }
            return(null);
        }
Exemplo n.º 2
0
        public WrappedTagBlockEntry WrapField(MetaField field, double width, bool last)
        {
            _loadedFields.Add(field);
            _fieldVisibility.Add(true);
            _tracker.AttachTo(field);

            var wrapper = new WrappedTagBlockEntry(_loadedFields, _wrappers.Count, width, last);

            _wrappers.Add(wrapper);
            return(wrapper);
        }
Exemplo n.º 3
0
        public WrappedTagBlockEntry GetTopLevelWrapper(WrappedTagBlockEntry wrapper)
        {
            WrappedTagBlockEntry result = wrapper;
            FlattenedTagBlock    block  = _parent;

            while (block != null)
            {
                int index = block._template.Template.IndexOf(result);
                result = block._wrappers[index];
                block  = block._parent;
            }
            return(result);
        }
Exemplo n.º 4
0
        public void VisitTagBlockEntry(WrappedTagBlockEntry field)
        {
            // Save our state and recurse into it
            double oldTotal = _totalWidth;

            _totalWidth = 0;
            Add(field.WrappedField);

            double entryWidth = _totalWidth;

            _totalWidth = oldTotal;

            AddWidth(entryWidth + TagBlockSubEntryExtraWidth);
        }
Exemplo n.º 5
0
        public void VisitTagBlock(TagBlockData field)
        {
            // Create flatten information for the block and attach event handlers to it
            var flattened = new FlattenedTagBlock(_flatParent, field, _topLevelFields, _tracker, _changes);

            AttachToTagBlock(field, flattened);

            FlattenedTagBlock oldParent = _flatParent;

            _flatParent = flattened;
            Flatten(field.Template);
            field.UpdateWidth();
            _flatParent = oldParent;

            for (int i = 0; i < field.Template.Count; i++)
            {
                WrappedTagBlockEntry wrapper = flattened.WrapField(field.Template[i], field.Width, i == field.Template.Count - 1);
                _index++;
                _fields.Insert(_index, wrapper);
            }
        }
Exemplo n.º 6
0
 public void VisitTagBlockEntry(WrappedTagBlockEntry field)
 {
 }
Exemplo n.º 7
0
 // Passed as the callback to TagBlockFlattener.EnumWrappers in VisitTagBlock
 private void TagBlockFlattener_HandleWrapper(WrappedTagBlockEntry wrapper)
 {
     _topLevelField = _flattener.GetTopLevelWrapper(_currentTagBlock, wrapper);
     _highlighter(wrapper, _highlightLevel > 0);
     wrapper.WrappedField.Accept(this);
 }
Exemplo n.º 8
0
 public void VisitTagBlockEntry(WrappedTagBlockEntry field)
 {
     // Ignore - wrapper handling is done inside VisitTagBlock/HandleWrapper to ensure that
     // closed blocks aren't skipped over
 }