本文整理汇总了C#中IView.ShowMessage方法的典型用法代码示例。如果您正苦于以下问题:C# IView.ShowMessage方法的具体用法?C# IView.ShowMessage怎么用?C# IView.ShowMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IView
的用法示例。
在下文中一共展示了IView.ShowMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewSubmitBtnPressed
private void ViewSubmitBtnPressed(object sender, EventArgs e)
{
#region [ View validating ]
if (!_view.IsValid())
{
_view.ShowMessage(InvalidDataMessage);
return;
}
#endregion
var data = _view.GetUserData();
#region [ Verifying if model is choosen ]
if (_currentModel == ModelIsNotChoosen)
{
SetCurrentModel(data);
data.Clear();
}
if (_currentModel == ModelIsNotChoosen)
{
_view.ShowMessage(ModelIsNotChosenMessage);
return;
}
#endregion
#region [ Input data checking ]
bool correct;
try
{
correct = CheckData(data);
}
catch (NotMatchedValuesException exception)
{
_view.ShowMessage(exception.Message);
_models[_currentModel].Reset();
BuildStartPage(PresenterName);
return;
}
if (!correct)
{
_view.ShowMessage(FailMessage);
return;
}
if (_dataToCheck.Count != 0)
{
_view.ShowMessage(SuccessMessage);
_dataToCheck.Clear();
}
#endregion
var model = _models[_currentModel];
#region [ IsEnd of model checking ]
if (model.IsEnd)
{
_view.ShowMessage(ModelEndedMessage);
BuildStartPage(PresenterName);
model.Reset();
return;
}
#endregion
#region [ ExecuteStep ]
try
{
data = GetNextStepData(data);
}
catch (InvalidModelException exception)
{
var requestStr = InvalidModelMessageFirstPart +
CurrentModelName +
InvalidModelMessageSecondPart +
Environment.NewLine +
" - " +
exception.Message;
_view.ShowMessage(requestStr);
_models[_currentModel].Reset();
BuildStartPage(PresenterName);
return;
}
catch (DuplicateDataException exception)
{
_view.ShowMessage(exception.Message);
_models[_currentModel].Reset();
BuildStartPage(PresenterName);
return;
}
catch (NoSuchDataException exception)
{
_view.ShowMessage(exception.Message);
//.........这里部分代码省略.........