本文整理汇总了C#中model.DeleteBoat方法的典型用法代码示例。如果您正苦于以下问题:C# model.DeleteBoat方法的具体用法?C# model.DeleteBoat怎么用?C# model.DeleteBoat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model.DeleteBoat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveBoatFromList
public void RemoveBoatFromList(model.Member member, int i)
{
member.DeleteBoat(GetBoat(member, i - 1));
c_dc.UpdateDataStorage();
}
示例2: DoDelegateBoatOperation
/**
* Checks boat menu option and delegates control to specialized functions
*/
private void DoDelegateBoatOperation(model.Member member)
{
m_memberView.ShowMembersBoats();
if (!member.HasNoBoatsRegistered())
{
model.Boat boatToHandle = m_memberView.GetMembersBoatToDisplay();
m_boatView.ShowVerboseBoat(boatToHandle);
view.BoatOperation operation = m_boatView.GetWhatToDoWithBoat();
switch (operation)
{
case view.BoatOperation.Edit:
m_boatController.DoEditBoat(boatToHandle);
break;
case view.BoatOperation.Delete:
member.DeleteBoat(boatToHandle);
m_baseView.PrintMessage("Boat deleted");
break;
case view.BoatOperation.Back:
break;
default:
break;
}
}
else
{
m_baseView.GetKeyPress();
}
m_list.SaveMemberList();
}
示例3: DeleteBoat
// Display view to delete a boat (pick boat, confirmation window), delete the boat from the member
private void DeleteBoat(model.Member member)
{
if (member.Boats.Count() == 0)
{
DoMemberView(member);
}
else
{
try
{
model.Boat boatToDelete = _boatView.GetBoatToEditOrDelete(member, "delete");
if (_boatView.ConfirmDelete() == true)
{
member.DeleteBoat(boatToDelete);
_list.SaveMemberList();
}
DoMemberView(member);
}
catch (Exception ex)
{
_boatView.DisplayErrorMessage(ex.Message);
_boatView.PressKeyToContinue();
DoMemberView(member);
}
}
}