From d34acd45d4777acf017de07cdf9590d0d6aa4bf5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 29 Apr 2020 19:04:19 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 28 ++++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index ec8d23c..901393b 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -163,6 +163,7 @@ namespace AyaNova.PlugIn.V8 /// private async void DoExport() { + Cursor.Current = Cursors.WaitCursor; //Show progress form ProgressForm progress = new ProgressForm(); progress.Show(); @@ -201,7 +202,7 @@ namespace AyaNova.PlugIn.V8 //ERASE DB progress.Op("Erasing AyaNova 8 data"); var a = await util.PostAsync("License/PermanentlyEraseAllData", "\"I understand\""); - + //TAGS progress.Op("Compiling tags"); ExportUnitModelCategories(progress); @@ -242,15 +243,17 @@ namespace AyaNova.PlugIn.V8 } catch (Exception ex) { - progress.Append("ERROR, During operation: " + progress.LastOp + "\n"+progress.LastSubOp); + progress.Append("ERROR, During operation: " + progress.LastOp + "\n" + progress.LastSubOp); progress.Append("\n************\nExport failed with error:"); progress.Append(ex.Message); progress.Append("stack:\n" + ex.StackTrace); } - finally { - progress.FinishedImport(); + finally + { + progress.FinishedImport(); + Cursor.Current = Cursors.Default; } - + //----------------------------------- //endof method @@ -261,7 +264,7 @@ namespace AyaNova.PlugIn.V8 #region Object Export methods - + #region users private async System.Threading.Tasks.Task ExportUsers(ProgressForm progress) @@ -372,7 +375,7 @@ namespace AyaNova.PlugIn.V8 d.customFields = CustomFieldData(c, DateCustomFields); } - + var a = await util.PostAsync("User", d.ToString()); long RavenId = util.IdFromResponse(a); Map.Add(c.ID, RavenId); @@ -389,7 +392,7 @@ namespace AyaNova.PlugIn.V8 } //Attachments / FILES - await ExportAttachments(new TypeAndID(RootObjectTypes.User, c.ID),progress); + await ExportAttachments(new TypeAndID(RootObjectTypes.User, c.ID), progress); } @@ -634,7 +637,7 @@ namespace AyaNova.PlugIn.V8 } #endregion custom fields - + #region Attachments exporter private async System.Threading.Tasks.Task ExportAttachments(TypeAndID tid, ProgressForm progress) { @@ -651,7 +654,7 @@ namespace AyaNova.PlugIn.V8 var af = AyaFile.GetItem(i.LT_O_AyaFile.Value); if (af == null) continue; - progress.SubOp("Wikifile: \"" + af.Name + "\" size:" + af.FileSize); + progress.SubOp("Wikifile: \"" + af.Name + "\" " + AyaBizUtils.FileSizeDisplay((decimal)af.FileSize)); //Compile the FileData property var sDate = i.LT_Common_Label_Created.ToString(); @@ -695,6 +698,9 @@ namespace AyaNova.PlugIn.V8 var ravenId = a.ObjectResponse["data"][0]["id"].Value(); Map.Add(af.ID, ravenId); } + + progress.SubOp(""); + } #endregion attachments @@ -746,7 +752,7 @@ namespace AyaNova.PlugIn.V8 } - + #endregion wiki