SubLib.IO.SubtitleFormats.SubtitleFormat.StringToStyle C# (CSharp) Méthode

StringToStyle() private méthode

private StringToStyle ( string styleText ) : Style
styleText string
Résultat SubLib.Core.Domain.Style
	internal virtual Style StringToStyle (string styleText) {
		Style style = new Style();
		foreach (char character in styleText) {
			if ((character == 'u') || (character == 'U'))
				style.Underline = true;
			else if ((character == 'b') || (character == 'B'))
				style.Bold = true;
			else if ((character == 'i') || (character == 'I'))
				style.Italic = true;
		}
		return style;
	}

Usage Example

	private Style ParseStyle (Match match, SubtitleFormat subtitleFormat) {
		string styleText = String.Empty;
		if (ParseGroup(match, "Style", ref styleText))
			return subtitleFormat.StringToStyle(styleText);
		else
			return new Style();
	}