public virtual void LoadSourceState(IJSVsaPersistSite site)
 {
     this.TryObtainLock();
     try
     {
         this.Preconditions(Pre.EngineNotInitialised | Pre.SiteSet | Pre.RootMonikerSet | Pre.EngineNotClosed);
         this.isEngineInitialized = true;
         try
         {
             this.DoLoadSourceState(site);
         }
         catch
         {
             this.isEngineInitialized = false;
             throw;
         }
         this.isEngineDirty = false;
     }
     finally
     {
         this.ReleaseLock();
     }
 }
 public virtual void SaveSourceState(IJSVsaPersistSite site)
 {
     this.TryObtainLock();
     try
     {
         this.Preconditions(Pre.EngineInitialised | Pre.EngineNotRunning | Pre.EngineNotClosed);
         if (site == null)
         {
             throw this.Error(JSVsaError.SiteInvalid);
         }
         try
         {
             this.DoSaveSourceState(site);
         }
         catch (Exception exception)
         {
             throw new JSVsaException(JSVsaError.SaveElementFailed, exception.ToString(), exception);
         }
     }
     finally
     {
         this.ReleaseLock();
     }
 }
 protected abstract void DoSaveSourceState(IJSVsaPersistSite site);
 public virtual void SaveSourceState(IJSVsaPersistSite site)
 {
     this.TryObtainLock();
     try
     {
         this.Preconditions(Pre.EngineInitialised | Pre.EngineNotRunning | Pre.EngineNotClosed);
         if (site == null)
         {
             throw this.Error(JSVsaError.SiteInvalid);
         }
         try
         {
             this.DoSaveSourceState(site);
         }
         catch (Exception exception)
         {
             throw new JSVsaException(JSVsaError.SaveElementFailed, exception.ToString(), exception);
         }
     }
     finally
     {
         this.ReleaseLock();
     }
 }
 public virtual void LoadSourceState(IJSVsaPersistSite site)
 {
     this.TryObtainLock();
     try
     {
         this.Preconditions(Pre.EngineNotInitialised | Pre.SiteSet | Pre.RootMonikerSet | Pre.EngineNotClosed);
         this.isEngineInitialized = true;
         try
         {
             this.DoLoadSourceState(site);
         }
         catch
         {
             this.isEngineInitialized = false;
             throw;
         }
         this.isEngineDirty = false;
     }
     finally
     {
         this.ReleaseLock();
     }
 }
 protected abstract void DoSaveSourceState(IJSVsaPersistSite site);
 protected override void DoSaveSourceState(IJSVsaPersistSite site)
 {
     XmlDocument project = new XmlDocument();
     project.LoadXml("<project></project>");
     XmlElement documentElement = project.DocumentElement;
     this.SaveProjectVersion(project, documentElement);
     this.SaveVsaEngineState(project, documentElement);
     site.SaveElement(null, project.OuterXml);
     this.SaveSourceForDebugging();
     base.isEngineDirty = false;
 }
 protected override void DoLoadSourceState(IJSVsaPersistSite site)
 {
     string xml = site.LoadElement(null);
     try
     {
         XmlDocument document = new XmlDocument();
         document.LoadXml(xml);
         XmlElement documentElement = document.DocumentElement;
         if (this.LoadProjectVersion(documentElement) == CurrentProjectVersion)
         {
             this.LoadVsaEngineState(documentElement);
             base.isEngineDirty = false;
         }
     }
     catch (Exception exception)
     {
         throw new JSVsaException(JSVsaError.UnknownError, exception.ToString(), exception);
     }
 }