Exemplo n.º 1
0
        protected GroupScope Group(StoryStyle style)
        {
            var group = new OutputGroup(style);

            OutputSend(group, add: true);

            return(Group(group));
        }
Exemplo n.º 2
0
        protected GroupScope Group(OutputGroup group)
        {
            var scope = new GroupScope(group);

            scope.OnDisposed += GroupScopeClose;

            _groupStack.Push(scope.Group);

            return(scope);
        }
Exemplo n.º 3
0
        public StoryStyle GetCurrentStyle()
        {
            OutputGroup group = _groupStack.Count > 0 ? _groupStack.Peek() : null;

            if (group != null)
            {
                return(group.GetAppliedStyle() + group.Style);                // Combine styles
            }
            else
            {
                return(new StoryStyle());
            }
        }
Exemplo n.º 4
0
        public StoryStyle GetAppliedStyle()
        {
            StoryStyle  style = new StoryStyle();
            OutputGroup group = this.Group;

            while (group != null)
            {
                foreach (var entry in group.Style)
                {
                    if (!style.ContainsKey(entry.Key))
                    {
                        style.Add(entry.Key, entry.Value);
                    }
                }

                group = group.Group;
            }

            return(style);
        }
Exemplo n.º 5
0
        public bool BelongsToGroup(OutputGroup group)
        {
            if (group == null)
            {
                throw new ArgumentNullException("group");
            }

            OutputGroup parentGroup = this.Group;

            if (parentGroup == group)
            {
                return(true);
            }
            else if (parentGroup != null)
            {
                return(parentGroup.BelongsToGroup(group));
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 6
0
 public GroupScope(OutputGroup group)
 {
     this.Group = group;
 }