Microsoft.JScript.Vsa.VsaEngine.DoLoadSourceState C# (CSharp) Method

DoLoadSourceState() protected method

protected DoLoadSourceState ( IVsaPersistSite site ) : void
site IVsaPersistSite
return void
      protected override void DoLoadSourceState(IVsaPersistSite site){
        // DoSaveSourceState puts everything in the project item (use null for the name)
        // We assume the site is valid and contains a valid project file so any errors are
        // wrapped in a VsaException and thrown
        string projectElement = site.LoadElement(null);
        try{
          XmlDocument project = new XmlDocument();
          project.LoadXml(projectElement);
          XmlElement root = project.DocumentElement;

          // verify that we support this version of the project file
          if (this.LoadProjectVersion(root) == CurrentProjectVersion){
            this.LoadVsaEngineState(root);
            this.isEngineDirty = false;
          }
        }catch(Exception e){
          throw new VsaException(VsaError.UnknownError, e.ToString(), e);
        }catch{
          throw new VsaException(VsaError.UnknownError);
        }
      }