Paradox Game Engine
v1.0.0 beta06
Main Page
Related Pages
Packages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Events
Macros
Pages
CamelCaseTextConverter.cs
Go to the documentation of this file.
1
// Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2
// This file is distributed under GPL v3. See LICENSE.md for details.
3
using
System
;
4
using
System.Globalization;
5
using
System.Text.RegularExpressions;
6
7
namespace
SiliconStudio.Presentation.ValueConverters
8
{
9
/// <summary>
10
/// This converter will format a CamelCase string by inserting spaces between words.
11
/// </summary>
12
public
class
CamelCaseTextConverter
: OneWayValueConverter<CamelCaseTextConverter>
13
{
14
/// <inheritdoc/>
15
public
override
object
Convert
(
object
value, Type targetType,
object
parameter, CultureInfo culture)
16
{
17
if
(value == null)
18
return
null;
19
20
string
strVal = value.ToString();
21
return
Regex.Replace(strVal,
"([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))"
,
"$1 "
);
22
}
23
}
24
}
SiliconStudio.Presentation.ValueConverters.CamelCaseTextConverter.Convert
override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Definition:
CamelCaseTextConverter.cs:15
SiliconStudio.Shaders.Parser.System
A system file.
SiliconStudio.Presentation.ValueConverters.CamelCaseTextConverter
This converter will format a CamelCase string by inserting spaces between words.
Definition:
CamelCaseTextConverter.cs:12
sources
common
presentation
SiliconStudio.Presentation
ValueConverters
CamelCaseTextConverter.cs
Generated on Sat Dec 20 2014 21:51:18 for Paradox Game Engine by
1.8.7