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


C# IRibbonControl.Journal方法代码示例

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


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

示例1: GetAdCount

		public string GetAdCount(IRibbonControl control) {
			var journal = control.Journal();
			return journal == null ? "(N/A)" : journal.Ads.Count.ToString(CultureInfo.CurrentCulture);
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:4,代码来源:JournalRibbon.cs

示例2: GetWomensSeats

		public string GetWomensSeats(IRibbonControl control) {
			if (!Program.WasInitialized) return "(N/A)";
			var journal = control.Journal();
			if (journal == null) return "(N/A)";
			return Program.Current.Statistics[journal.Year].WomensSeats.ToString("n0", CultureInfo.CurrentCulture);
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:6,代码来源:JournalRibbon.cs

示例3: IsJournal

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

示例4: GetTotalPledged

		public string GetTotalPledged(IRibbonControl control) {
			if (!Program.WasInitialized) return "(N/A)";
			var journal = control.Journal();
			if (journal == null) return "(N/A)";
			return Program.Current.Statistics[journal.Year].TotalPledged.ToString("c", CultureInfo.CurrentCulture);
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:6,代码来源:JournalRibbon.cs

示例5: InsertAd

		public void InsertAd(IRibbonControl control, string selectedId, int selectedIndex) {
			var jp = control.Journal();

			if (!jp.ConfirmModification())
				return;

			var typeName = selectedId.Substring("Insert".Length);
			jp.CreateAd(Names.AdTypes.First(t => t.Name == typeName)).Shape.ForceSelect();
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:9,代码来源:JournalRibbon.cs

示例6: 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

示例7: SavePdfTypes

		public void SavePdfTypes(IRibbonControl control) {
			using (var dialog = new FolderBrowserDialog {
				Description = "Export PDFs by ad type",
				ShowNewFolderButton = true
			}) {
				if (dialog.ShowDialog(new ArbitraryWindow((IntPtr)control.Window().HWND)) == DialogResult.Cancel)
					return;
				var ranges = new List<PageRange>();
				var presentation = control.Journal().Presentation;
				for (int i = 1; i <= presentation.Slides.Count; i++) {
					var currentType = presentation.Slides[i].CustomLayout.Name;
					if (ranges.Count == 0 || ranges.Last().Type != currentType)
						ranges.Add(new PageRange { Type = currentType, Start = i, End = i });
					else
						ranges.Last().End = i;
				}

				for (int i = 0; i < ranges.Count; i++) {
					var range = ranges[i];
					presentation.ExportAsFixedFormat(
						Path.Combine(dialog.SelectedPath, $"{i:00} - {range.Type} "
														+ (range.Start == range.End ? $"(Page {range.Start}).pdf" : $"(Pages {range.Start} - {range.End}).pdf")),
						PpFixedFormatType.ppFixedFormatTypePDF, PpFixedFormatIntent.ppFixedFormatIntentPrint,
						PrintRange: presentation.PrintOptions.Ranges.Add(range.Start, range.End),
						RangeType: PpPrintRangeType.ppPrintSlideRange);
				}
			}
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:28,代码来源:JournalRibbon.cs

示例8: SavePdf

		public void SavePdf(IRibbonControl control) {
			using (var dialog = new SaveFileDialog {
				Filter = "PDF Files (*.pdf)|*.pdf",
				FileName = Path.ChangeExtension(control.Journal().Presentation.FullName, ".pdf"),
				Title = "Export PDF"
			}) {
				if (dialog.ShowDialog(new ArbitraryWindow((IntPtr)control.Window().HWND)) == DialogResult.Cancel)
					return;
				control.Journal().Presentation.ExportAsFixedFormat(dialog.FileName,
					PpFixedFormatType.ppFixedFormatTypePDF, PpFixedFormatIntent.ppFixedFormatIntentPrint,
					RangeType: control.Id == "SavePdfSlide" ? PpPrintRangeType.ppPrintCurrent : PpPrintRangeType.ppPrintAll);
			}
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:13,代码来源:JournalRibbon.cs

示例9: ShowImportForm

		public void ShowImportForm(IRibbonControl control) {
			if (!control.Journal().ConfirmModification())
				return;
			AppFramework.LoadTables(EmailAddress.Schema, ImportedPayment.Schema);
			Program.Current.MefContainer.Value
				.GetExport<Billing.PaymentImport.ImportForm>()
				.SetPledgeTypes(Names.JournalPledgeType)
				.RequirePledge()
				.SetCreationCallback(control.Journal().ImportAd)
				.SetJournalMode(control.Journal().Year)
				.Show(new ArbitraryWindow((IntPtr)control.Window().HWND));
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:12,代码来源:JournalRibbon.cs

示例10: ShowGrid

		public void ShowGrid(IRibbonControl control) { new Forms.AdsGridForm(control.Journal()).Show(Globals.ThisAddIn.Application.Window()); }
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:1,代码来源:JournalRibbon.cs

示例11: ShowCharts

		public void ShowCharts(IRibbonControl control) { new Forms.ChartsForm(control.Journal().Year).Show(Globals.ThisAddIn.Application.Window()); }
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:1,代码来源:JournalRibbon.cs

示例12: ShowWarningsForm

		public void ShowWarningsForm(IRibbonControl control) {
			new Forms.WarningsForm(control.Journal()).Show(Globals.ThisAddIn.Application.Window());
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:3,代码来源:JournalRibbon.cs

示例13: ShowDetailPane

		public void ShowDetailPane(IRibbonControl control) {
			var window = control.Window();
			var jp = control.Journal();
			// CustomTaskPanes cannot be reused; I need to create a new one.
			Globals.ThisAddIn.CustomTaskPanes.Add(new AdPane(jp), "Ad Details", jp.Presentation.Windows[1]).Visible = true;
		}
开发者ID:ShomreiTorah,项目名称:Journal,代码行数:6,代码来源:JournalRibbon.cs


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