Esempio n. 1
0
		void StartImport (SafeUri uri)
		{
			var controller = new ImportController (true);
			controller.StatusEvent += evnt => {
				if (evnt == ImportEvent.ImportFinished) {
					if (controller.PhotosImported > 0) {
						query.RollSet = new RollSet (Database.Rolls.GetRolls (1));
					}
				}
			};
			var import_window = new ImportDialog (controller, Window);
			import_window.Show ();
		}
Esempio n. 2
0
		public void ImportUriList (UriList list, bool copy)
		{
			// Drag'n drop import.
			var controller = new ImportController (false);
			controller.StatusEvent += (evnt) => ThreadAssist.ProxyToMain (() => {
				if (evnt == ImportEvent.ImportFinished) {
					if (controller.PhotosImported > 0) {
						query.RollSet = new RollSet (Database.Rolls.GetRolls (1));
					}
				}
			});

			var source = new MultiFileImportSource (list.ToArray ());
			controller.ActiveSource = source;
			controller.CopyFiles = copy;
			controller.DuplicateDetect = true;
			controller.RecurseSubdirectories = true;
			controller.RemoveOriginals = false;

			var import_window = new ImportDialog (controller, Window);
			import_window.Show ();

			controller.StartImport ();
		}