本文整理汇总了C#中IFileDialogCustomize.AddRadioButtonList方法的典型用法代码示例。如果您正苦于以下问题:C# IFileDialogCustomize.AddRadioButtonList方法的具体用法?C# IFileDialogCustomize.AddRadioButtonList怎么用?C# IFileDialogCustomize.AddRadioButtonList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileDialogCustomize
的用法示例。
在下文中一共展示了IFileDialogCustomize.AddRadioButtonList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Attach
/// <summary>
/// Attach the RadioButtonList control to the dialog object
/// </summary>
/// <param name="dialog">The target dialog</param>
internal override void Attach(IFileDialogCustomize dialog)
{
Debug.Assert(dialog != null, "CommonFileDialogRadioButtonList.Attach: dialog parameter can not be null");
// Add the radio button list control
dialog.AddRadioButtonList(this.Id);
// Add the radio button list items
for (int index = 0; index < items.Count; index++)
dialog.AddControlItem(this.Id, index, items[index].Text);
// Set the currently selected item
if (selectedIndex >= 0 && selectedIndex < items.Count)
{
dialog.SetSelectedControlItem(this.Id, this.selectedIndex);
}
else if (selectedIndex != -1)
{
throw new IndexOutOfRangeException("Index was outside the bounds of the CommonFileDialogRadioButtonList.");
}
// Sync unmanaged properties with managed properties
SyncUnmanagedProperties();
}