示例#1
0
        protected GroupScope Group(StoryStyle style)
        {
            var group = new OutputGroup(style);

            OutputSend(group, add: true);

            return(Group(group));
        }
示例#2
0
        protected GroupScope Group(OutputGroup group)
        {
            var scope = new GroupScope(group);

            scope.OnDisposed += GroupScopeClose;

            _groupStack.Push(scope.Group);

            return(scope);
        }
示例#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());
            }
        }
示例#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);
        }
示例#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);
            }
        }
示例#6
0
 public GroupScope(OutputGroup group)
 {
     this.Group = group;
 }