예제 #1
0
        private static TSD.TSDDocument GetTSDDocument(bool Save)
        {
            TSD.TSDDocument aTSDDocument = null;
            try
            {
                object aObject = System.Runtime.InteropServices.Marshal.GetActiveObject("TSD.Document");
                if (aObject != null && aObject is TSD.TSDDocument)
                {
                    aTSDDocument = aObject as TSD.TSDDocument;
                    if (Save)
                    {
                        aTSDDocument.save();
                    }
                    aTSDDocument.close();
                }
            }
            catch
            {
            }

            if (aTSDDocument == null)
            {
                aTSDDocument = new TSD.TSDDocument();
            }

            return(aTSDDocument);
        }
예제 #2
0
        public bool Save()
        {
            if (readOnly)
            {
                return(false);
            }

            return(tSDDocument.save());
        }
예제 #3
0
        void IDisposable.Dispose()
        {
            if (pTSDDocument != null)
            {
                if (pSave)
                {
                    pTSDDocument.save();
                }

                pTSDDocument.close();
                pTSDDocument = null;
            }
        }
예제 #4
0
 //Close and save the TSD Document
 private void CloseTsdDocument(bool save = true)
 {
     if (tsdDocument != null)
     {
         if (save == true)
         {
             tsdDocument.save();
         }
         tsdDocument.close();
         if (tsdDocument != null)
         {
             ClearCOMObject(tsdDocument);
             tsdDocument = null;
         }
     }
 }