本文整理汇总了C#中Namespace.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Namespace.ToString方法的具体用法?C# Namespace.ToString怎么用?C# Namespace.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Namespace
的用法示例。
在下文中一共展示了Namespace.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create_Namespace_Long
public void Create_Namespace_Long()
{
var @namespace = new Namespace("Create.Namespace.Long");
var expectet = Comparer.Create_Namespace_Long();
var actual = @namespace.ToString();
Assert.AreEqual(expectet, actual);
Console.WriteLine(actual);
}
示例2: Create_Nested_Namespaces
public void Create_Nested_Namespaces()
{
var @namespace = new Namespace("Create_Nested_Namespaces")
{
new Namespace("Nested_Create_Nested_Namespaces"),
};
var expectet = Comparer.Create_Nested_Namespaces();
var actual = @namespace.ToString();
Assert.AreEqual(expectet, actual);
Console.WriteLine(actual);
}
示例3: CreateGameNamespace
/// <summary>
/// Creates or get the path to game folder
/// </summary>
/// <param name="ns">Game namespace</param>
/// <param name="create">True if we should create the path on disk if it doesn't exist already</param>
/// <returns>game path</returns>
public static string CreateGameNamespace(Namespace ns, bool create)
{
string dir_path = string.Format("{0}{1}\\", Program.GamesPath, ns.ToString());
if (create && !Directory.Exists(dir_path)) Directory.CreateDirectory(dir_path);
return dir_path;
}
示例4: GetRelativePath
/// <summary>
/// Get the relative path to game folder
/// </summary>
/// <param name="ns">Game namespace</param>
/// <returns>relative game path</returns>
public static string GetRelativePath(Namespace ns) { return string.Format("{0}\\", ns.ToString()); }
示例5: GetPlatformFolderPath
/// <summary>
/// Gets a complete platform folder path based on a game's namespace, and its platform
/// </summary>
/// <param name="ns">Game namespace</param>
/// <param name="platform">Platform folder</param>
/// <param name="folder">Platform's folder. Must only have one folder flag set.</param>
/// <returns></returns>
public static string GetPlatformFolderPath(Namespace ns, Platform platform, PlatformFolder folder)
{
return string.Format("{0}{1}\\{2}\\{3}\\", Program.GamesPath, ns.ToString(), platform.ToString(), folder.ToString().Replace('_', '\\'));
}