Exemplo n.º 1
0
		public static DialogResult Run(LinkBundle linkBundle)
		{
			var dilogResult = DialogResult.Cancel;
			linkBundle.PerformTransaction(linkBundle.Library.Context,
				linkBundleCopy =>
				{
					using (var form = new FormEditBundle(linkBundleCopy))
					{
						dilogResult = form.ShowDialog(MainController.Instance.MainForm);
						if (dilogResult == DialogResult.OK)
							linkBundleCopy.MarkAsModified();
						return dilogResult == DialogResult.OK;
					}
				},
				copyMethod => MainController.Instance.ProcessManager.Run("Preparing Data...", cancelationToken => copyMethod()),
				(context, original, current) => MainController.Instance.ProcessManager.Run("Saving Changes...",
					cancelationToken =>
					{
						original.Save(context, current, false);
					}));
			return dilogResult;
		}