コード例 #1
0
		void ButtonClicked (object sender, EventArgs e)
		{
			CheckProject ();
			
			var dialog = new ProjectFileSelectorDialog (Project, null, DefaultFilter);
			try {
				if (DialogTitle != null)
					dialog.Title = DialogTitle;
				int response = MessageService.RunCustomDialog (dialog);
				if (response == (int)Gtk.ResponseType.Ok && dialog.SelectedFile != null) {
					entry.Text = dialog.SelectedFile.ProjectVirtualPath;
				}
			} finally {
				dialog.Destroy ();
			}
		}
コード例 #2
0
ファイル: ImageChooser.cs プロジェクト: jfcantin/monodevelop
		protected override void OnClicked ()
		{
			base.OnClicked ();
			if (project == null)
				return;
			var dialog = new ProjectFileSelectorDialog (project, null, "*.png");
			try {
				dialog.Title = GettextCatalog.GetString ("Select icon...");
				int response = MessageService.RunCustomDialog (dialog);
				if (response == (int)Gtk.ResponseType.Ok && dialog.SelectedFile != null) {
					
					var path = dialog.SelectedFile.FilePath;
					if (!CheckImage (path))
						return;
					SelectedProjectFile = dialog.SelectedFile.ProjectVirtualPath;
					OnChanged (EventArgs.Empty);
				}
			} finally {
				dialog.Destroy ();
			}
		}
コード例 #3
0
ファイル: ImageChooser.cs プロジェクト: yayanyang/monodevelop
		protected override void OnClicked ()
		{
			base.OnClicked ();
			if (project == null)
				return;
			
			var formats = string.Join ("|", SupportedFormats.Select (f => "*." + f));
			var dialog = new ProjectFileSelectorDialog (project, "All Images", formats);

			try {
				if (AcceptedSize.IsEmpty)
					dialog.Title = GettextCatalog.GetString ("Select icon...");
				else
					dialog.Title = GettextCatalog.GetString ("Select icon ({0}x{1})...", AcceptedSize.Width, AcceptedSize.Height);
				while (MessageService.RunCustomDialog (dialog) == (int)Gtk.ResponseType.Ok && dialog.SelectedFile != null) {
					var path = dialog.SelectedFile.FilePath;
					if (!CheckImage (path))
						continue;
					
					SelectedProjectFile = dialog.SelectedFile.ProjectVirtualPath;
					OnChanged (EventArgs.Empty);
					break;
				}
			} finally {
				dialog.Destroy ();
			}
		}