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


C# FileFilter.AddPattern方法代码示例

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


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

示例1: setupOpenDialog

	private void setupOpenDialog() {
		FileFilter filter;
		Glade.XML xml = getGlade("OpenDialog.glade");

		xml.Autoconnect(this);

		filter = new FileFilter();
		filter.Name = "All support files (*.fld, *.fld.gz, *.gat)";
		filter.AddPattern("*.fld");
		filter.AddPattern("*.fld.gz");
		filter.AddPattern("*.gat");
		openFileDialog.AddFilter(filter);

		filter = new FileFilter();
		filter.Name = "OpenKore Field Files (*.fld, *.fld.gz)";
		filter.AddPattern("*.fld");
		filter.AddPattern("*.fld.gz");
		openFileDialog.AddFilter(filter);

		filter = new FileFilter();
		filter.Name = "Ragnarok Online Ground Files (*.gat)";
		filter.AddPattern("*.gat");
		openFileDialog.AddFilter(filter);

		filter = new FileFilter();
		filter.Name = "All Files (*)";
		filter.AddPattern("*");
		openFileDialog.AddFilter(filter);

		openFileDialog.PreviewWidget = new FieldPreview();
		openFileDialog.UpdatePreview += OnUpdatePreview;
	}
开发者ID:puring0815,项目名称:OpenKore,代码行数:32,代码来源:MainWindow.cs

示例2: DatabaseSaveDialog

		private DatabaseSaveDialog(Window parent)
		{
			Glade.XML xml = new Glade.XML(null,"gui.glade","databaseSaveDialog",null);
			xml.Autoconnect(this);
			
			databaseSaveDialog.Icon = parent.Icon;
			
			// Conectamos las acciones de los botones del diálogo.
			databaseSaveDialog.AddActionWidget(btnSave,ResponseType.Ok);
			databaseSaveDialog.AddActionWidget(btnCancel,ResponseType.Cancel);			
			
			
			// Añadimos los archivos de filtros soportados
			FileFilter filter1=new FileFilter();
			filter1.Name="Archivo XML";
			filter1.AddPattern("*.xml");
			filter1.AddPattern("*.XML");
			
			FileFilter filter2=new FileFilter();
			filter2.Name="Base de datos de reconocimiento";
			filter2.AddPattern("*.jilfml");
			filter2.AddPattern("*.JILFML");
			
			FileFilter filter3=new FileFilter();
			filter3.Name="Todos los archivos";
			filter3.AddPattern("*.*");			
			
			databaseSaveDialog.AddFilter(filter2);		
			databaseSaveDialog.AddFilter(filter1);				
			databaseSaveDialog.AddFilter(filter3);	
		}
开发者ID:coler706,项目名称:mathtextrecognizer,代码行数:31,代码来源:DatabaseSaveDialog.cs

示例3: ShowSelectDatabaseDialog

		private bool ShowSelectDatabaseDialog (out string database)
		{
			FileChooserDialog dlg = new FileChooserDialog (
				AddinCatalog.GetString ("Open Database"), null, FileChooserAction.Open,
				"gtk-cancel", ResponseType.Cancel,
				"gtk-open", ResponseType.Accept
			);
			dlg.SelectMultiple = false;
			dlg.LocalOnly = true;
			dlg.Modal = true;
		
			FileFilter filter = new FileFilter ();
			filter.AddMimeType ("application/x-sqlite2");
			filter.AddMimeType ("application/x-sqlite3");
			filter.AddPattern ("*.db");
			filter.AddPattern ("*.sqlite");
			filter.Name = AddinCatalog.GetString ("SQLite databases");
			FileFilter filterAll = new FileFilter ();
			filterAll.AddPattern ("*");
			filterAll.Name = AddinCatalog.GetString ("All files");
			dlg.AddFilter (filter);
			dlg.AddFilter (filterAll);

			database = null;
			bool result = false;
			try {
				if (dlg.Run () == (int)ResponseType.Accept) {
					database = dlg.Filename;
					result = true;
				}
			} finally {
				dlg.Destroy ();					
			}
			return result;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:35,代码来源:SqliteConnectionSettingsWidget.cs

示例4: CreateAssemblyFilter

		#pragma warning restore 0169
		
		private FileFilter CreateAssemblyFilter () {
			FileFilter fileFilter = new FileFilter ();
			fileFilter.Name = "Assemblies";
			fileFilter.AddPattern ("*.dll");
			fileFilter.AddPattern ("*.exe");
			return fileFilter;
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:9,代码来源:MainWindow.cs

示例5: GetTemplateFromDisk

        public static byte[] GetTemplateFromDisk()
        {
            //Читаем файл документа
            FileChooserDialog Chooser = new FileChooserDialog ("Выберите шаблон документа...",
                null,
                FileChooserAction.Open,
                "Отмена", ResponseType.Cancel,
                "Выбрать", ResponseType.Accept);
            FileFilter Filter = new FileFilter ();
            Filter.Name = "ODT документы и OTT шаблоны";
            Filter.AddMimeType ("application/vnd.oasis.opendocument.text");
            Filter.AddMimeType ("application/vnd.oasis.opendocument.text-template");
            Filter.AddPattern ("*.odt");
            Filter.AddPattern ("*.ott");
            Chooser.AddFilter (Filter);

            Filter = new FileFilter ();
            Filter.Name = "Все файлы";
            Filter.AddPattern ("*.*");
            Chooser.AddFilter (Filter);

            byte[] file = null;

            if ((ResponseType)Chooser.Run () == ResponseType.Accept) {
                Chooser.Hide ();
                logger.Info ("Чтение файла...");

                file = File.ReadAllBytes(Chooser.Filename);

                logger.Info ("Ok");
            }
            Chooser.Destroy ();

            return file;
        }
开发者ID:QualitySolution,项目名称:QSProjects,代码行数:35,代码来源:TemplatesMain.cs

示例6: AssemblyReferencePanel

		public AssemblyReferencePanel (SelectReferenceDialog selectDialog)
		{
			this.selectDialog = selectDialog;
			
			chooser = new FileChooserWidget (FileChooserAction.Open, "");
			chooser.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
			chooser.SelectMultiple = true;

			// this should only allow dll's and exe's
			FileFilter filter = new FileFilter ();
			filter.Name = GettextCatalog.GetString ("Assemblies");
			filter.AddPattern ("*.[Dd][Ll][Ll]");
			filter.AddPattern ("*.[Ee][Xx][Ee]");
			chooser.AddFilter (filter);
			chooser.FileActivated += new EventHandler (SelectReferenceDialog);

			PackStart (chooser, true, true, 0);
			
			PackStart (new Gtk.VSeparator(), false, false, 0);
			
			VBox box = new VBox ();
			Gtk.Button addButton = new Gtk.Button (Gtk.Stock.Add);
			addButton.Clicked += new EventHandler(SelectReferenceDialog);
			box.PackStart (addButton, false, false, 0);
			PackStart (box, false, false, 0);
			
			BorderWidth = 6;
			Spacing = 6;
			ShowAll();
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:30,代码来源:AssemblyReferencePanel.cs

示例7: LogSaveDialog

		/// <summary>
		/// Constructor de la clase LogSaveDialog. Crea y muestra el diálogo.
		/// </summary>
		public LogSaveDialog()
		{
			Glade.XML gxml = new Glade.XML (null,"gui.glade", "logSaveDialog", null);
            gxml.Autoconnect (this);
            
            FileFilter logFilter = new FileFilter();
            logFilter.Name = "Archivo de registro";
            logFilter.AddPattern("*.log");
            logFilter.AddPattern("*.LOG");
            
            FileFilter txtFilter = new FileFilter();
            txtFilter.Name = "Archivo de texto";
            txtFilter.AddPattern("*.txt");
            txtFilter.AddPattern("*.TXT");
            
            FileFilter allFilter = new FileFilter();
            allFilter.Name = "Todos los archivos";
            allFilter.AddPattern("*.*");          
            
            logSaveDialog.AddFilter(logFilter);
            logSaveDialog.AddFilter(txtFilter);
            logSaveDialog.AddFilter(allFilter);
            
            logSaveDialog.AddActionWidget(btnSave,ResponseType.Ok);
            logSaveDialog.AddActionWidget(btnCancel,ResponseType.Cancel); 
		}
开发者ID:coler706,项目名称:mathtextrecognizer,代码行数:29,代码来源:LogSaveDialog.cs

示例8: GetFileFilter

 public static FileFilter GetFileFilter()
 {
     FileFilter filter = new FileFilter();
     filter.Name = "Images";
     filter.AddPattern("*.png");
     filter.AddPattern("*.jpg");
     filter.AddPattern("*.jpeg");
     return filter;
 }
开发者ID:dineshkummarc,项目名称:longomatch,代码行数:9,代码来源:Helpers.cs

示例9: GetImageFilters

 /// <summary>
 /// Get the Image filters.
 /// </summary>
 /// <returns>The Image filters.</returns>
 protected FileFilter GetImageFilters()
 {
     var _filterImage = new FileFilter();
     _filterImage.Name = "Image Files";
     _filterImage.AddPattern("*.jpg");
     _filterImage.AddPattern("*.jpeg");
     _filterImage.AddPattern("*.png");
     _filterImage.AddPattern("*.bmp");
     return _filterImage;
 }
开发者ID:ertseyhan,项目名称:Steg,代码行数:14,代码来源:MainWindow.cs

示例10: ImportDialog

 public ImportDialog()
 {
     this.Build ();
     FileFilter filter = new FileFilter ();
     filter.Name = "Waypoint Files";
     filter.AddPattern ("*.gpx");
     filter.AddPattern ("*.loc");
     filter.AddPattern ("*.zip");
     fileWidget.AddFilter (filter);
     UpdateBookMarkCombo();
 }
开发者ID:TweetyHH,项目名称:Open-Cache-Manager,代码行数:11,代码来源:ImportDialog.cs

示例11: MainWindow2

        public MainWindow2()
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build();

            m_app = new App();

            m_app.Should += delegate(Act action) {
                switch (action) {
                    case Act.AnalyzeHorizontal: return IsHorizontalActive;
                    case Act.AnalyzeVertical: return IsVerticalActive;
                    case Act.AnalyzeIslands: return IsIslandsActive;
                    case Act.Analyze: return true;
                    case Act.Clean: return IsCleanActive;
                    case Act.RemoveBackground: return IsRemoveBackgroundActive;
                    case Act.RefreshIslandsOutputAction: return true;
                    case Act.Process: return true;
                }

            #if DEBUG
                throw new NotImplementedException(action.ToString());
            #else
                return false;
            #endif
            };

            m_app.UpdateInterface += delegate(object sender, UIEventArgs e) {
                var app = m_app;
                switch (e.UI) {
                    case UI.Output: textviewOutput.Buffer.Text = app.Output; return;
                    case UI.ErrorMessage: ShowError(app.ErrorMessage); return;
                    case UI.Filename: return;
                    case UI.IslandEditor: islandeditor1.App = m_app; islandeditor1.QueueDraw(); return;
                    case UI.CompletedTask: ShowCompleted(app.Task); return;
                }

            #if DEBUG
                throw new NotImplementedException(e.UI.ToString());
            #endif
            };

            comboboxMode.Active = 0;
            comboboxProcess.Active = 0;
            islandeditor1.App = m_app;

            var filter = new FileFilter();
            filter.AddPattern("*.png");
            filter.AddPattern("*.PNG");
            filechooserbuttonOpen.AddFilter(filter);
        }
开发者ID:bvssvni,项目名称:csharp-spritesheet-analyzer,代码行数:50,代码来源:MainWindow2.cs

示例12: OnActivated

        protected override void OnActivated()
        {
            base.OnActivated();

            Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog(MainClass.Languages.Translate("chose_workspace_open"), MainClass.MainWindow, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);

            FileFilter filter = new FileFilter();
            filter.Name = "Workspace files";
            filter.AddMimeType("Workspace file");
            filter.AddPattern("*.msw");
            fc.AddFilter(filter);

            if (!String.IsNullOrEmpty(MainClass.Settings.LastOpenedWorkspaceDir))
                fc.SetCurrentFolder(MainClass.Settings.LastOpenedWorkspaceDir);

            if (fc.Run() == (int)ResponseType.Accept) {

                MainClass.Settings.LastOpenedWorkspaceDir = System.IO.Path.GetDirectoryName(fc.Filename);

                //CloseActualWorkspace();
                Workspace.Workspace workspace = Workspace.Workspace.OpenWorkspace(fc.Filename);

                if (workspace != null){
                    //MainClass.Settings.RecentFiles.AddWorkspace(fc.Filename,fc.Filename);
                    MainClass.MainWindow.ReloadWorkspace(workspace,true,true);
                }

            }

            fc.Destroy();
        }
开发者ID:moscrif,项目名称:ide,代码行数:31,代码来源:OpenWorkspaceAction.cs

示例13: AddFilters

        /// <summary>
        /// Adds the filters. Returns default extension
        /// </summary>
        /// <returns>The filters.</returns>
        /// <param name="dialog">Dialog.</param>
        private static string AddFilters(FileChooserDialog dialog) 
        {
            string defaultExtension = "teml";
            string cryptedFileExtension = "temlx";
            // Add experiment files filter
            FileFilter fileFilter = new FileFilter();
            fileFilter.AddPattern(string.Format("*.{0}", defaultExtension));
            fileFilter.Name = Mono.Unix.Catalog.GetString(string.Format("Experiment files (.{0})", defaultExtension));
            dialog.AddFilter(fileFilter);

            // Add experiment files filter
            //TLAB-67
        //here: we check if the file is crypted, if it's so we ask the user to insert a password. then we decrypt the file and check the 
            /// password. if the pwd is the same we contninue with the standard process, otherwise we raise and error
            FileFilter fileFilterCryptedFile = new FileFilter();
            fileFilterCryptedFile.AddPattern(string.Format("*.{0}", cryptedFileExtension));
            fileFilterCryptedFile.Name = Mono.Unix.Catalog.GetString(string.Format("Experiment files (.{0})", cryptedFileExtension));
            dialog.AddFilter(fileFilterCryptedFile);
            
            //add another option of All files
            FileFilter allFilesFilter = new FileFilter();
            allFilesFilter.Name = Mono.Unix.Catalog.GetString("All files");
            allFilesFilter.AddPattern("*.*");
            dialog.AddFilter(allFilesFilter);

            return defaultExtension;
        }
开发者ID:CoEST,项目名称:TraceLab,代码行数:32,代码来源:FileDialogs.cs

示例14: OnSaveButtonClicked

        protected void OnSaveButtonClicked(object sender, EventArgs e)
        {
            try
            {
                FileChooserDialog fc = new FileChooserDialog("Save Filterset", this, FileChooserAction.Save, "Cancel", ResponseType.Cancel, "Save", ResponseType.Accept);

                FileFilter filter = new FileFilter();
                filter.Name = "DeSERt Filterset";
                filter.AddMimeType("Filterset/fis");
                filter.AddPattern("*.fis");
                fc.AddFilter(filter);
                fc.DoOverwriteConfirmation = true;
                fc.CurrentName = FiltersetnameEntry.Text.Replace(" ", "-");
                if (Directory.Exists(MySettings.LastFilterDir)) { fc.SetCurrentFolder(MySettings.LastFilterDir); }

                ResponseType res = (ResponseType)fc.Run();
                if (res == ResponseType.Ok || res == ResponseType.Close)
                {
                    string path;
                    if (!System.IO.Path.HasExtension(fc.Filename)) { path = fc.Filename + ".fis"; }
                    else { path = fc.Filename; }
                    MySettings.LastFilterDir = System.IO.Path.GetDirectoryName(fc.Filename);
                    MySettings.Save();
                    fst.Name = FiltersetnameEntry.Text;
                    Filterset.SaveFilterset(path, fst);
                    saved = true;
                }
                fc.Destroy();
                if (res == ResponseType.Close) { this.Destroy(); }
            }
            catch (Exception ex) { ErrorReport.ReportError("Save Button (Create Filterset)", ex); }
        }
开发者ID:TimeScience,项目名称:desert-deflicker,代码行数:32,代码来源:CreateFilterset.cs

示例15: OpenClicked

		protected virtual void OpenClicked (object sender, System.EventArgs e)
		{
			FileChooserDialog dlg = new FileChooserDialog (
				GettextCatalog.GetString ("Select Executable"), null, FileChooserAction.Open,
				"gtk-cancel", ResponseType.Cancel,
				"gtk-open", ResponseType.Accept
			);
			dlg.SelectMultiple = false;
			dlg.LocalOnly = true;
			dlg.Modal = true;
			dlg.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
			
			FileFilter filterExe = new FileFilter ();
			filterExe.AddPattern ("*.exe");
			filterExe.Name = GettextCatalog.GetString ("Executables");
			FileFilter filterAll = new FileFilter ();
			filterAll.AddPattern ("*");
			filterAll.Name = GettextCatalog.GetString ("All files");
			dlg.AddFilter (filterExe);
			dlg.AddFilter (filterAll);

			if (dlg.Run () == (int)ResponseType.Accept)
				entryExecutable.Text = dlg.Filename;
			dlg.Destroy ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:25,代码来源:SelectExecutableDialog.cs


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