当前位置: 首页>>代码示例>>C#>>正文


C# model.GetLength方法代码示例

本文整理汇总了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
        }
开发者ID:fh222dt,项目名称:OOAD,代码行数:25,代码来源:BoatView.cs

示例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;
            }
        }
开发者ID:fh222dt,项目名称:OOAD,代码行数:23,代码来源:BoatView.cs

示例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);
        }
开发者ID:fh222dt,项目名称:OOAD,代码行数:26,代码来源:BoatView.cs

示例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());
 }
开发者ID:dv222bk,项目名称:1DV607_Portfolio,代码行数:10,代码来源:Console.cs


注:本文中的model.GetLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。