本文整理汇总了C#中model.GetLength方法的典型用法代码示例。如果您正苦于以下问题:C# model.GetLength方法的具体用法?C# model.GetLength怎么用?C# model.GetLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model.GetLength方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BoatMenu
public int BoatMenu(model.Boat a_boat)
{
Console.Clear();
Console.WriteLine("");
Console.WriteLine("-----Boat specifics-----");
Console.WriteLine("Type: {0}", a_boat.GetType());
Console.WriteLine("Length: {0}", a_boat.GetLength());
Console.WriteLine("");
Console.WriteLine("---------------");
Console.WriteLine("");
Console.WriteLine("(D) to Delete boat (U) to Update boat");
ConsoleKeyInfo input = Console.ReadKey();
if (input.Key == ConsoleKey.D)
{
return 1;
}
else if (input.Key == ConsoleKey.U)
{
return 2;
}
else return 0; //returnera nåt annat
}
示例2: DeleteBoat
public model.Boat DeleteBoat(model.Boat a_selectedBoat, model.Member a_selectedMember)
{
Console.Clear();
Console.WriteLine("");
Console.WriteLine("-----Delete boat from registry-----");
Console.WriteLine("Do you want to DELETE the following boat?");
Console.WriteLine("Owner:{0} {1}", a_selectedMember.GetFirstName(), a_selectedMember.GetLastName());
Console.WriteLine("Type: {0}", a_selectedBoat.GetType());
Console.WriteLine("Length: {0}", a_selectedBoat.GetLength());
Console.WriteLine("");
Console.WriteLine("Please press (Y) Yes or (N) No");
ConsoleKeyInfo input = Console.ReadKey();
if (input.Key == ConsoleKey.Y)
{
return a_selectedBoat;
}
else
{
return null;
}
}
示例3: UpdateBoat
public model.Boat UpdateBoat(model.Boat a_selectedBoat)
{
int boatType;
double length;
Console.Clear();
Console.WriteLine("");
Console.WriteLine("-----Update boat information-----");
Console.WriteLine("");
Console.WriteLine("Type: {0}", a_selectedBoat.GetType());
Console.WriteLine("Length: {0}", a_selectedBoat.GetLength());
Console.WriteLine("**********");
Console.WriteLine("Please change the information by entering below:");
Console.WriteLine("");
Console.WriteLine("Boat type: ");
Console.WriteLine("Please enter (1)Sailboat, (2)Motorsailer, (3)Motorboat, (4)Canoe, (5)Other ");
boatType = Int32.Parse(Console.ReadLine());
Console.WriteLine("Length in foot: ");
length = double.Parse(Console.ReadLine());
Console.WriteLine("");
Console.WriteLine("Boat information updated!");
model.Boat.BoatType type = (model.Boat.BoatType)boatType;
return new model.Boat(type, length);
}
示例4: DisplayBoat
/// <summary>
/// Displays a boat to the user
/// </summary>
/// <param name="a_boat">model.Boat. The boat to be displayed</param>
public void DisplayBoat(model.Boat a_boat)
{
System.Console.WriteLine("BoatID: {0}", a_boat.GetBoatID());
System.Console.WriteLine("Type: {0}", a_boat.GetBoatType());
System.Console.WriteLine("Length: {0}", a_boat.GetLength());
}