本文整理汇总了C#中Dir.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Dir.ToString方法的具体用法?C# Dir.ToString怎么用?C# Dir.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dir
的用法示例。
在下文中一共展示了Dir.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IfNoCorridor_ExceptionShouldContainMapBoundsPropertyNameAndValue
public void IfNoCorridor_ExceptionShouldContainMapBoundsPropertyNameAndValue(
Dir dir, string name)
{
var cell = new MapCell();
cell.Sides[dir] = Side.Wall;
Assert.That(() => ThrowD.IfNoCorridor(cell, dir, name),
Throws.InvalidOperationException
.With.Message.Contains(dir.ToString())
.And.Message.Contains(name));
}
示例2: CreatOptional_control_parameters
/// <summary>
/// 可选控制参数 用于控制返回数据的
/// </summary>
/// <param name="start">开始</param>
/// <param name="limit">条数限制</param>
/// <param name="sort">排序字段</param>
/// <param name="dir">排序方法</param>
/// <returns></returns>
private string CreatOptional_control_parameters(Dir dir,string start = "", string limit = "", string sort = "")
{
string Optional_control_parameters = "";
if (!string.IsNullOrEmpty(start))
{
Optional_control_parameters += "&start=" + start;
}
if (!string.IsNullOrEmpty(limit))
{
Optional_control_parameters += "&limit=" + limit;
}
if (!string.IsNullOrEmpty(sort))
{
Optional_control_parameters += "&sort=" + sort;
}
if (!string.IsNullOrEmpty(dir.ToString()))
{
Optional_control_parameters += "&dir=" + dir;
}
return Optional_control_parameters;
}
示例3: AnimData
public AnimData(tk2dAnimatedSprite spr, int defaultId,
string moveName, string stopName, Dir dir)
{
//omni dir
if(dir == Dir.NumDir) {
moveId = spr.GetClipIdByName(moveName);
if(moveId < 0) {
moveId = defaultId;
}
stopId = spr.GetClipIdByName(stopName);
if(stopId < 0) {
stopId = defaultId;
}
}
else {
string nameDir = dir.ToString();
moveId = spr.GetClipIdByName(moveName + nameDir);
if(moveId < 0) {
moveId = defaultId;
}
stopId = spr.GetClipIdByName(stopName + nameDir);
if(stopId < 0) {
stopId = defaultId;
}
}
}