本文整理汇总了C#中Name.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Name.ToString方法的具体用法?C# Name.ToString怎么用?C# Name.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Name
的用法示例。
在下文中一共展示了Name.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Each_value_has_a_unique_representation
public void Each_value_has_a_unique_representation()
{
var sallySmith = new Name("Sally", "Smith");
Assert.AreEqual("firstName:Sally;;surname:Smith", sallySmith.ToString());
var billyJean = new Name("Billy", "Jean");
Assert.AreEqual("firstName:Billy;;surname:Jean", billyJean.ToString());
}
示例2: SecurityKey
/// <summary>
/// constructor accepting a byte array for the key
/// </summary>
/// <param name="type"></param>
/// <param name="name"></param>
/// <param name="keyBytes"></param>
public SecurityKey(Type type, Name name, byte[] keyBytes, int index)
{
ID = index;
KeyBytes = keyBytes;
KeyString = Util.ByteArrayToString(keyBytes);
KeyName = name;
KeyType = type;
NameString = KeyName.ToString();
}
示例3: GetElementValueByDataType
//value == DBNull.Value ? default(T) : (T)Convert.ChangeType(value, typeof(T)
/// <summary>
/// Retrieves a child element, inspects the datatype and retrieves it appropriately
/// </summary>
/// <param name="element">parent element</param>
/// <param name="name">name of the child element to get by datatype</param>
/// <returns></returns>
public static dynamic GetElementValueByDataType(this Element element, Name name)
{
return GetElementValueByDataType(element, name.ToString());
}
示例4: Perspective2String
private string Perspective2String(Name perception)
{
if (perception.IsUniversal)
return "Universal";
return perception.ToString();
}
示例5: ToStringReturnNameValue
public void ToStringReturnNameValue(Name validName)
{
Assert.Equal((string)validName, validName.ToString());
}