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


C# IRibbonControl.CurrentAd方法代码示例

本文整理汇总了C#中IRibbonControl.CurrentAd方法的典型用法代码示例。如果您正苦于以下问题:C# IRibbonControl.CurrentAd方法的具体用法?C# IRibbonControl.CurrentAd怎么用?C# IRibbonControl.CurrentAd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRibbonControl的用法示例。


在下文中一共展示了IRibbonControl.CurrentAd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AutoFormat

		public void AutoFormat(IRibbonControl control) {
			var ad = control.CurrentAd();
			if (ad == null) return;
			var warnings = ad.CheckWarnings();
			if (warnings.Any()
			 && !Dialog.Warn("This ad has unresolved warnings:\r\n • " + warnings.Join("\r\n • ", w => w.Message)
						   + "\r\nThe autoformatter may not catch everything.  Do you want to autoformat anyway?"))
				return;
			ad.Presentation.Formatter.FormatText(ad);
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:10,代码来源:JournalRibbon.cs

示例2: IsAdSelected

		public bool IsAdSelected(IRibbonControl control) { return control.CurrentAd() != null; }
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:1,代码来源:JournalRibbon.cs

示例3: DeleteAd

		public void DeleteAd(IRibbonControl control) {
			string message;
			var ad = control.CurrentAd();
			if (ad == null) return;

			if (!control.Journal().ConfirmModification())
				return;

			if (ad.Row.Payments.Any())
				message = String.Format(CultureInfo.CurrentCulture, "Are you sure you want to delete this ad?\r\nThe ad's {0:c} in payments will not be deleted.\r\nYou should probably delete them first.",
										ad.Row.Payments.Sum(p => p.Amount));
			else if (ad.Row.Pledges.Any())
				message = String.Format(CultureInfo.CurrentCulture, "Are you sure you want to delete this ad?\r\nThe ad's {0:c} in pledges will not be deleted.\r\nYou should probably delete them first.",
										ad.Row.Pledges.Sum(p => p.Amount));
			else
				message = "Are you sure you want to delete this ad?";

			if (Dialog.Warn(message))
				ad.Delete();
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:20,代码来源:JournalRibbon.cs


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