// 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 . namespace Rauchy.Regionerate.Shared.Components.Rendering { /// /// A textual sign which can be embedded in strings and later be identified in them. /// The symbol adds a prefix to the embedded text. /// public sealed class Prefix : Symbol { #region Fields (1)  private readonly string _value; #endregion Fields  #region Constructors (1)  /// /// Initializes a new instance of the class. /// /// The prefix value of this symbol. public Prefix( string value ) { _value = value; } #endregion Constructors  #region Properties (1)  /// /// Gets the prefix value of this symbol. /// public string Value { get { return _value; } } #endregion Properties  #region Methods (2)  // Public Methods (2)  /// /// Embeds the textual chariteristics of this inside the specified text. /// /// The provided text with the embedded in it. public override string Embed( string text ) { return Value + " " + text; } /// /// Determines whether the textual chariteristics of this are embedded in the specified text. /// public override bool IsEmbeddedIn( string text ) { if ( text.Contains( Value ) ) { return true; } else { return false; } } #endregion Methods  } }