本文整理汇总了C#中OpenFileDialog.AddAllFilesFilter方法的典型用法代码示例。如果您正苦于以下问题:C# OpenFileDialog.AddAllFilesFilter方法的具体用法?C# OpenFileDialog.AddAllFilesFilter怎么用?C# OpenFileDialog.AddAllFilesFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenFileDialog
的用法示例。
在下文中一共展示了OpenFileDialog.AddAllFilesFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleToFile
void HandleToFile (object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog (GettextCatalog.GetString ("Select Policy File"));
dlg.TransientFor = this;
dlg.InitialFileName = currentSet.Name + ".mdpolicy";
dlg.Action = FileChooserAction.Save;
dlg.AddFilter (BrandingService.BrandApplicationName (GettextCatalog.GetString ("MonoDevelop policy files")), "*.mdpolicy");
dlg.AddAllFilesFilter ();
dlg.CurrentFolder = ExportProjectPolicyDialog.DefaultFileDialogPolicyDir;
if (dlg.Run ()) {
try {
currentSet.SaveToFile (dlg.SelectedFile);
ExportProjectPolicyDialog.DefaultFileDialogPolicyDir = dlg.SelectedFile.ParentDirectory;
} catch (Exception ex) {
MessageService.ShowException (ex, GettextCatalog.GetString ("The policy set could not be saved"));
}
}
}
示例2: HandleFromFile
void HandleFromFile (object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog (GettextCatalog.GetString ("Select Policy File"));
dlg.Action = FileChooserAction.Open;
dlg.TransientFor = this;
dlg.AddFilter (BrandingService.BrandApplicationName (GettextCatalog.GetString ("MonoDevelop policy files")), "*.mdpolicy");
dlg.AddAllFilesFilter ();
dlg.CurrentFolder = ExportProjectPolicyDialog.DefaultFileDialogPolicyDir;
if (dlg.Run ()) {
try {
PolicySet pset = new PolicySet ();
pset.LoadFromFile (dlg.SelectedFile);
if (string.IsNullOrEmpty (pset.Name))
pset.Name = dlg.SelectedFile.FileNameWithoutExtension;
pset.Name = GetUnusedName (pset.Name);
sets.Add (pset);
ExportProjectPolicyDialog.DefaultFileDialogPolicyDir = dlg.SelectedFile.ParentDirectory;
FillPolicySets ();
policiesCombo.Active = sets.IndexOf (pset);
} catch (Exception ex) {
MessageService.ShowException (ex, GettextCatalog.GetString ("The policy set could not be loaded"));
}
}
}