diff --git a/PROMS/DataLoader/Documents.cs b/PROMS/DataLoader/Documents.cs index ab6e042e..6955032c 100644 --- a/PROMS/DataLoader/Documents.cs +++ b/PROMS/DataLoader/Documents.cs @@ -270,7 +270,9 @@ namespace DataLoader } private int SaveWordDoc(string temppath, string stype, string sectName) { - return SaveWordDoc(temppath, String.Empty, stype, null, sectName); + ConfigInfo ci = new ConfigInfo(null); + ci.AddItem("Edit", "Initialized", "true"); + return SaveWordDoc(temppath, String.Empty, stype, ci, sectName); } private int SaveTheDoc(string temppath, string title, ConfigInfo ci, string ascii) { diff --git a/PROMS/DataLoader/LibDoc.cs b/PROMS/DataLoader/LibDoc.cs index f7bf71dc..598dc396 100644 --- a/PROMS/DataLoader/LibDoc.cs +++ b/PROMS/DataLoader/LibDoc.cs @@ -70,6 +70,7 @@ namespace DataLoader ConfigInfo ci = new ConfigInfo(null); string title = null; // for docname, remove the '.lib', i.e. substring(0,8) DateTime dts = DateTime.Now; + ci.AddItem("Edit", "Initialized", "true"); string tmpRtfFileName = GetLibDocData(fi, ci, ref title); int Docid = SaveWordDoc(tmpRtfFileName, title, null, ci, string.Empty); File.Delete(tmpRtfFileName); diff --git a/PROMS/VEPROMS.CSLA.Library/Config/DocumentConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/DocumentConfig.cs index 48651481..ba43909c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/DocumentConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/DocumentConfig.cs @@ -67,6 +67,24 @@ namespace VEPROMS.CSLA.Library OnPropertyChanged("LibDoc_Comment"); } } + [Category("Edit")] + [DisplayName("Initialized")] + [Description("Initialized")] + public bool Edit_Initialized + { + get + { + string s = _Xp["Edit", "Initialized"]; + if (s == string.Empty) // If there is no value, then default to false + s = "false"; // default + return bool.Parse(s); + } + set + { + _Xp["Edit", "Initialized"] = value.ToString(); + OnPropertyChanged("Edit_Initialized"); + } + } // RHM 20110415 - These are now stored in the PDF table. //[Category("Printing")] //[DisplayName("Length")] diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 27c4b655..c78ea0d7 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -330,6 +330,7 @@ namespace VEPROMS.CSLA.Library doc.DocAscii = ascii; //doc.UpdateDocAscii(_MyFile.FullName); DocumentConfig cfg = new DocumentConfig(doc); + cfg.Edit_Initialized = true; doc.Config = cfg.ToString(); doc.UserID = Volian.Base.Library.VlnSettings.UserID; doc.DTS = _MyFile.LastWriteTime; diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel.cs b/PROMS/Volian.Controls.Library/DSOTabPanel.cs index 1ca3b890..0dde99d1 100644 --- a/PROMS/Volian.Controls.Library/DSOTabPanel.cs +++ b/PROMS/Volian.Controls.Library/DSOTabPanel.cs @@ -350,6 +350,8 @@ namespace Volian.Controls.Library { try { + if (!IsBeingDeleted) + SaveDirty(); this.Enter -= new EventHandler(DSOTabPanel_Enter); // this.Leave -= new EventHandler(DSOTabPanel_Leave); // SaveDirty(); // SaveDirty happens in CloseDSO(bool) @@ -415,6 +417,7 @@ namespace Volian.Controls.Library try { _MyDSOFramer.Save(); + _MyDSOFramer_OnSaveCompleted(this, null); // These are handled in the method above //LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); //MyDSOFile.FullName = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName"); @@ -476,8 +479,6 @@ namespace Volian.Controls.Library { if (_MyDSOFramer != null) { - if(!IsBeingDeleted) - SaveDirty(); _MyDSOFramer.Close(); Controls.Remove(_MyDSOFramer); components.Remove(_MyDSOFramer);