// Copyright (c) 2007 Omer Rauchwerger (a.k.a rauchy) (omer@rauchy.net) // All rights reserved. // // This file is part of Regionerate. // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, // or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see . using System.Text; using Rauchy.Regionerate.Domain.Entities; namespace Rauchy.Regionerate.Shared.Components.Rendering { public sealed class VisibleRegionRenderer : RegionRenderer { #region Constructors (1)  public VisibleRegionRenderer( CodeLayout.Configuration configuration ) : base( configuration ) {} #endregion Constructors  #region Methods (2)  // Protected Methods (2)  // [rgn] Protected Methods (2) protected override string RenderFooter( Region region ) { StringBuilder footer = new StringBuilder(); footer.Append(TextUtilities.GetTabString(Configuration.RenderingOptions)); // Tabifies the region footer. footer.Append( "#endregion" ); string title = base.RenderFooter( region ); // Gets the symboled name of the region. footer.Append( title ); /*if (region.Children.Count > 0) { // Pad the last child only if it isn't a Separator which is already padding. if (!(region.Children[region.Children.Count - 1] is Separator)) { // Insert a new line before the region footer footer.Insert(0, Environment.NewLine); } }*/ footer.AppendLine(); return footer.ToString(); } protected override string RenderHeader( Region region ) { string title = base.RenderHeader( region ); // Gets the symboled name of the region. string header = RenderHeader( region, "#region", title ); return header.Indent(Configuration.RenderingOptions); } #endregion Methods  } }