本文整理汇总了C#中GDID.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# GDID.ToString方法的具体用法?C# GDID.ToString怎么用?C# GDID.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GDID
的用法示例。
在下文中一共展示了GDID.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GDID_10
public void GDID_10()
{
var gdid = new GDID(1293, 3, 57);
var s = gdid.ToString();
Console.WriteLine(s);
Assert.AreEqual("1293:3:57", s);
}
示例2: MakeFake
public static PersonRow MakeFake(GDID parentGdid)
{
var age = (int)(parentGdid.ID % 99);
var tags = NFX.ExternalRandomGenerator.Instance.NextRandomInteger > 0 ? new string[NFX.ExternalRandomGenerator.Instance.NextScaledRandomInteger(1, 20)] : null;
if (tags != null)
for (int i = 0; i < tags.Length; i++)
{
tags[i] = ((char)('a' + i)) + "tag";
}
var pers = new PersonRow()
{
ID = parentGdid,
Name = NFX.Parsing.NaturalTextGenerator.Generate(30),
Age = age,
DOB = DateTime.Now.AddYears(-age),
Sex = (parentGdid.ID % 2) == 0 ? Sex.Male : Sex.Female,
Income = (parentGdid.ID % 79) * 1000,
Debt = (parentGdid.ID % 11) * 1000,
Rating = (parentGdid.ID % 2) == 0 ? (double?)null : 3.25,
Notes = parentGdid.ToString(),
Voter = (parentGdid.ID % 2) == 0 ? (bool?)null : true,
MilitarySvc = (parentGdid.ID % 2) == 0 ? (bool?)null : false,
Address1 = NFX.Parsing.NaturalTextGenerator.Generate(50),
Address2 = (parentGdid.ID % 7) == 0 ? NFX.Parsing.NaturalTextGenerator.Generate(50) : null,
City = (parentGdid.ID % 2) == 0 ? "Magdaburg" : "Odessa On Don",
State = "OH",
Zip = "44000" + (parentGdid.ID % 999),
Phone1 = "(555) 222-3222",
Phone2 = (parentGdid.ID % 3) == 0 ? "(555) 737-9789" : null,
Email1 = "[email protected]",
Email2 = (parentGdid.ID % 5) == 0 ? "[email protected]" : null,
URL = (parentGdid.ID % 2) == 0 ? "https://ibm.com/products/" + parentGdid.ID : null,
Tags = tags
};
return pers;
}