Example #1
0
	protected virtual void OnListSources_Activated(object sender, System.EventArgs e)
	{
		if (_currentView != null)
		{
			_currentView.SaveView();
		}
		
		SourceListDialog listDialog = new SourceListDialog();
		
		if (sender is Gtk.Dialog)
		{
			listDialog.TransientFor = (Gtk.Window)sender;
		}
		else
		{
			listDialog.TransientFor = this;
		}
		
		listDialog.Database = _database;
		listDialog.Record = _record;
		
		listDialog.Show();
		
		listDialog.Response += new Gtk.ResponseHandler(OnListSources_Response);
	}
		protected void OnSelectMasterSource(object sender, SourceArgs e)
		{
			SourceListDialog listDialog = new SourceListDialog();
		
			listDialog.Database = Database;
			listDialog.Record = Record;
			
			int response = listDialog.Run();
			
			switch (response)
			{
				case (int)Gtk.ResponseType.Apply:
					e.Source = listDialog.Record as GedcomSourceRecord;
					break;
				case (int)Gtk.ResponseType.Ok:
					// Create new source
					e.Source = new GedcomSourceRecord(Database);								
					break;
			}
			
			listDialog.Destroy();
		}