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


C# SelectFileDialog.AddAllFilesFilter方法代码示例

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


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

示例1: Add

		public void Add ()
		{
			var project = (DotNetProject) CurrentNode.GetParentDataItem (typeof(DotNetProject), true);
			
			var dlg = new SelectFileDialog (GettextCatalog.GetString ("Select Native Library"), Gtk.FileChooserAction.Open);
			dlg.SelectMultiple = true;
			dlg.AddAllFilesFilter ();
			//FIXME: add more filters, amke correct for platform
			dlg.AddFilter (GettextCatalog.GetString ("Static Library"), ".a");
			
			if (!dlg.Run ())
				return;
			
			foreach (var file in dlg.SelectedFiles) {
				var item = new NativeReference (file);
				project.Items.Add (item);
			}
			
			IdeApp.ProjectOperations.Save (project);
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:20,代码来源:NativeReferenceCommandHandler.cs

示例2: AddSolutionItem

		public SolutionItem AddSolutionItem (SolutionFolder parentFolder)
		{
			SolutionItem res = null;
			
			var dlg = new SelectFileDialog () {
				Action = Gtk.FileChooserAction.Open,
				CurrentFolder = parentFolder.BaseDirectory,
				SelectMultiple = false,
			};
		
			dlg.AddAllFilesFilter ();
			dlg.DefaultFilter = dlg.AddFilter (GettextCatalog.GetString ("Project Files"), "*.*proj", "*.mdp");
			
			if (dlg.Run ()) {
				try {
					res = AddSolutionItem (parentFolder, dlg.SelectedFile);
				} catch (Exception ex) {
					MessageService.ShowException (ex, GettextCatalog.GetString ("The file '{0}' could not be loaded.", dlg.SelectedFile));
				}
			}
			
			if (res != null)
				IdeApp.Workspace.Save ();

			return res;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:26,代码来源:ProjectOperations.cs

示例3: AddWorkspaceItem

		public WorkspaceItem AddWorkspaceItem (Workspace parentWorkspace)
		{
			WorkspaceItem res = null;
			
			var dlg = new SelectFileDialog () {
				Action = Gtk.FileChooserAction.Open,
				CurrentFolder = parentWorkspace.BaseDirectory,
				SelectMultiple = false,
			};
		
			dlg.AddAllFilesFilter ();
			dlg.DefaultFilter = dlg.AddFilter (GettextCatalog.GetString ("Solution Files"), "*.mds", "*.sln");
			
			if (dlg.Run ()) {
				try {
					res = AddWorkspaceItem (parentWorkspace, dlg.SelectedFile);
				} catch (Exception ex) {
					MessageService.ShowException (ex, GettextCatalog.GetString ("The file '{0}' could not be loaded.", dlg.SelectedFile));
				}
			}

			return res;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:23,代码来源:ProjectOperations.cs

示例4: AddSolutionItem

		public SolutionItem AddSolutionItem (SolutionFolder parentFolder)
		{
			SolutionItem res = null;
			
			var dlg = new SelectFileDialog () {
				Action = Gtk.FileChooserAction.Open,
				CurrentFolder = parentFolder.BaseDirectory,
				SelectMultiple = false,
			};
		
			dlg.AddAllFilesFilter ();
			dlg.DefaultFilter = dlg.AddFilter (GettextCatalog.GetString ("Project Files"), "*.*proj");
			
			if (dlg.Run ()) {
				if (!Services.ProjectService.IsSolutionItemFile (dlg.SelectedFile)) {
					MessageService.ShowMessage (GettextCatalog.GetString ("The file '{0}' is not a known project file format.", dlg.SelectedFile));
					return res;
				}

				if (SolutionContainsProject (parentFolder, dlg.SelectedFile)) {
					MessageService.ShowMessage (GettextCatalog.GetString ("The project '{0}' has already been added.", Path.GetFileNameWithoutExtension (dlg.SelectedFile)));
					return res;
				}

				try {
					res = AddSolutionItem (parentFolder, dlg.SelectedFile);
				} catch (Exception ex) {
					MessageService.ShowError (GettextCatalog.GetString ("The file '{0}' could not be loaded.", dlg.SelectedFile), ex);
				}
			}
			
			if (res != null)
				IdeApp.Workspace.Save ();

			return res;
		}
开发者ID:lkalif,项目名称:monodevelop,代码行数:36,代码来源:ProjectOperations.cs

示例5: AddWorkspaceItem

		public async Task<WorkspaceItem> AddWorkspaceItem (Workspace parentWorkspace)
		{
			WorkspaceItem res = null;
			
			var dlg = new SelectFileDialog () {
				Action = FileChooserAction.Open,
				CurrentFolder = parentWorkspace.BaseDirectory,
				SelectMultiple = false,
			};
		
			dlg.AddAllFilesFilter ();
			dlg.DefaultFilter = dlg.AddFilter (GettextCatalog.GetString ("Solution Files"), "*.mds", "*.sln");
			
			if (dlg.Run ()) {
				try {
					if (WorkspaceContainsWorkspaceItem (parentWorkspace, dlg.SelectedFile)) {
						MessageService.ShowMessage (GettextCatalog.GetString ("The workspace already contains '{0}'.", Path.GetFileNameWithoutExtension (dlg.SelectedFile)));
						return res;
					}

					res = await AddWorkspaceItem (parentWorkspace, dlg.SelectedFile);
				} catch (Exception ex) {
					MessageService.ShowError (GettextCatalog.GetString ("The file '{0}' could not be loaded.", dlg.SelectedFile), ex);
				}
			}

			return res;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:28,代码来源:ProjectOperations.cs

示例6: BrowseForSchemaFile

		/// <summary>Allows the user to browse the file system for a schema.</summary>
		/// <returns>The schema filename the user selected; otherwise null.</returns>
		public static string BrowseForSchemaFile ()
		{
			var dlg = new SelectFileDialog (GettextCatalog.GetString ("Select XML Schema"));
			dlg.AddFilter (new SelectFileDialogFilter (
				GettextCatalog.GetString ("XML Files"),
				new string[] { "*.xsd" },
				new string[] { "text/xml", "application/xml" }
			));
			dlg.AddAllFilesFilter ();
			
			if (dlg.Run ())
				return dlg.SelectedFile;
			return null;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:16,代码来源:XmlEditorService.cs

示例7: BrowseForStylesheetFile

		/// <summary>Allows the user to browse the file system for a stylesheet.</summary>
		/// <returns>The stylesheet filename the user selected; otherwise null.</returns>
		public static string BrowseForStylesheetFile ()
		{
			var dlg = new SelectFileDialog (GettextCatalog.GetString ("Select XSLT Stylesheet")) {
				TransientFor = IdeApp.Workbench.RootWindow,
			};
			dlg.AddFilter (new SelectFileDialogFilter (
				GettextCatalog.GetString ("XML Files"),
				new string[] { "*.xml" },
				new string[] { "text/xml", "application/xml" }
			));
			dlg.AddFilter (new SelectFileDialogFilter(
				GettextCatalog.GetString ("XSL Files"),
				new string[] { "*.xslt", "*.xsl" },
				new string[] { "text/x-xslt" }
			));
			dlg.AddAllFilesFilter ();
			
			if (dlg.Run ())
				return dlg.SelectedFile;
			return null;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:23,代码来源:XmlEditorService.cs

示例8: BrowseForSchemaFile

		/// <summary>Allows the user to browse the file system for a schema.</summary>
		/// <returns>The schema filename the user selected; otherwise null.</returns>
		public static string BrowseForSchemaFile ()
		{
			var dlg = new SelectFileDialog (GettextCatalog.GetString ("Select XML Schema")) {
				TransientFor = IdeApp.Workbench.RootWindow,
			};
			dlg.AddFilter (new SelectFileDialogFilter (GettextCatalog.GetString ("XML Files"), "*.xsd") {
				MimeTypes = { "text/xml", "application/xml" },
			});
			dlg.AddAllFilesFilter ();
			
			if (dlg.Run ())
				return dlg.SelectedFile;
			return null;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:16,代码来源:XmlEditorService.cs


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