本文整理汇总了C#中IRibbonControl.Window方法的典型用法代码示例。如果您正苦于以下问题:C# IRibbonControl.Window方法的具体用法?C# IRibbonControl.Window怎么用?C# IRibbonControl.Window使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRibbonControl
的用法示例。
在下文中一共展示了IRibbonControl.Window方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsPresentation
public bool IsPresentation(IRibbonControl control) {
var window = control.Window();
return window != null && window.Presentation != null;
}
示例2: ShowProperties
public void ShowProperties(IRibbonControl control) {
var window = control.Window();
Globals.ThisAddIn.ShowProperties(window.Presentation);
}
示例3: InsertSpecialPage
public void InsertSpecialPage(IRibbonControl control) {
control.Window().View.Slide = control.Window().Presentation.Slides.Add(1, PpSlideLayout.ppLayoutBlank);
}
示例4: 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);
}
}
示例5: 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);
}
}
}
示例6: 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));
}
示例7: 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;
}