Esempio n. 1
0
		Configuration save_controls() {
			var config = new Configuration();
			config.create_new_db_radio_button = create_new_db_radio_button.Active;
			config.tags_radio_button = tags_radio_button.Active;
			config.tags = new ArrayList(tag_entry.GetTypedTagNames());
			config.aspect_ratio_x = aspect_ratio_x.Text;
			config.aspect_ratio_y = aspect_ratio_y.Text;
			config.save_for_later_checkbox = save_for_later_checkbox.Active;
			config.save_for_later_filename = save_for_later_filename.Text;
			config.save_for_later_folder_chooser = save_for_later_folder_chooser.Filename;
			config.use_existing_db_button = use_existing_db_button.Active;
			config.use_existing_file_chooser = use_existing_file_chooser.Filename;
			config.x_res_in_pixels = x_res_in_pixels.ValueAsInt;
			config.x_res_in_stones = x_res_in_stones.ValueAsInt;
			config.min_distance = min_distance.ValueAsInt;
			
			try {
				using (Stream stream = File.Open(config_file, FileMode.Create))
				{
					var serializer = new XmlSerializer(typeof(Configuration));
					serializer.Serialize(stream, config);
				}
			} catch (Exception e) {
				Console.WriteLine(e);
			}
			return config;
		}
Esempio n. 2
0
		void on_dialog_response (object obj, ResponseArgs args) {
			if (args.ResponseId == ResponseType.Ok) {
				config = save_controls();
				System.Threading.Thread command_thread = new System.Threading.Thread (createMosaics);
				command_thread.Name = Catalog.GetString ("Creating Photomosaic");
				progress_dialog = new FSpot.UI.Dialog.ThreadProgressDialog (command_thread, 1);
				progress_dialog.Response += HandleProgressAbort;
				progress_dialog.Start ();
			}
			dialog.Destroy ();
		}