Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
UFileToFileNameWithExt.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 
6 using SiliconStudio.Core.IO;
7 
8 namespace SiliconStudio.Presentation.ValueConverters
9 {
10  /// <summary>
11  /// This converter will convert an <see cref="UFile"/> to a string representing the file name with its extension.
12  /// </summary>
13  public class UFileToFileNameWithExt : OneWayValueConverter<UFileToFileNameWithExt>
14  {
15  /// <inheritdoc/>
16  public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17  {
18  if (value == null)
19  return null;
20  var ufile = (UFile)value;
21  return ufile.GetFileNameWithExtension();
22  }
23  }
24 }
This converter will convert an UFile to a string representing the file name with its extension...
override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Defines a normalized file path. See UPath for details. This class cannot be inherited.
Definition: UFile.cs:13