本文整理汇总了C#中IView.AskYesNo方法的典型用法代码示例。如果您正苦于以下问题:C# IView.AskYesNo方法的具体用法?C# IView.AskYesNo怎么用?C# IView.AskYesNo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IView
的用法示例。
在下文中一共展示了IView.AskYesNo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleStratumChanging
public bool HandleStratumChanging(StratumDO newStratum, IView view)
{
if (newStratum == null) { return false; }
if (Stratum != null
&& Stratum.Stratum_CN == newStratum.Stratum_CN)
{ return false; }
if (Stratum != null)
{
if (!view.AskYesNo("You are changing the stratum of a tree" +
", are you sure you want to do this?"
, "!", System.Windows.Forms.MessageBoxIcon.Asterisk))
{
return false;//do not change stratum
}
else
{
//log stratum changed
DAL.LogMessage(String.Format("Tree Stratum Changed (Cu:{0} St:{1} -> {2} Sg:{3} Tdv_CN:{4} T#: {5} P#:{6}"
, CuttingUnit.Code
, Stratum.Code
, newStratum.Code
, (SampleGroup != null) ? SampleGroup.Code : "?"
, (TreeDefaultValue != null) ? TreeDefaultValue.TreeDefaultValue_CN.ToString() : "?"
, TreeNumber
, (Plot != null) ? Plot.PlotNumber.ToString() : "-"), "I");
return true;
}
}
else
{
return true;
}
}
示例2: HandleSampleGroupChanging
public bool HandleSampleGroupChanging(SampleGroupDO newSG, IView view)
{
if (newSG == null) { return false; }
if (SampleGroup != null
&& SampleGroup.SampleGroup_CN == newSG.SampleGroup_CN) { return true; }
if (SampleGroup != null)
{
if (!view.AskYesNo("You are changing the Sample Group of a tree, are you sure you want to do this?"
, "!"
, System.Windows.Forms.MessageBoxIcon.Asterisk
, true))
{
return false;
}
else
{
DAL.LogMessage(String.Format("Tree Sample Group Changed (Cu:{0} St:{1} Sg:{2} -> {3} Tdv_CN:{4} T#: {5}",
CuttingUnit.Code,
Stratum.Code,
(SampleGroup != null) ? SampleGroup.Code : "?",
newSG.Code,
(TreeDefaultValue != null) ? TreeDefaultValue.TreeDefaultValue_CN.ToString() : "?",
TreeNumber), "high");
return true;
}
}
else
{
return true;
}
}