protected GroupScope Group(StoryStyle style) { var group = new OutputGroup(style); OutputSend(group, add: true); return(Group(group)); }
protected GroupScope Group(OutputGroup group) { var scope = new GroupScope(group); scope.OnDisposed += GroupScopeClose; _groupStack.Push(scope.Group); return(scope); }
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()); } }
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); }
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); } }
public GroupScope(OutputGroup group) { this.Group = group; }