Esempio n. 1
0
 protected override void DoLoadSourceState(IVsaPersistSite site){
 }
	public virtual void SaveSourceState(IVsaPersistSite site)
			{
				lock(this)
				{
					Preconditions(Pre.EngineNotClosed |
								  Pre.EngineNotRunning |
								  Pre.EngineInitialized);
					if(site != null)
					{
						try
						{
							DoSaveSourceState(site);
						}
						catch(VsaException)
						{
							throw;
						}
						catch(Exception e)
						{
							// Wrap the exception and re-throw.
							throw new VsaException(VsaError.SaveElementFailed,
												   e.ToString(), e);
						}
					}
					else
					{
						throw new VsaException(VsaError.SiteInvalid);
					}
				}
			}
	// Internal implementation of "SaveSourceState".
	protected abstract void DoSaveSourceState(IVsaPersistSite site);
 protected override void DoSaveSourceState(IVsaPersistSite site){
   XmlDocument project = new XmlDocument();
   project.LoadXml("<project></project>");
   XmlElement root = project.DocumentElement;
   this.SaveProjectVersion(project, root);
   this.SaveVsaEngineState(project, root);
   site.SaveElement(null, project.OuterXml);
   this.SaveSourceForDebugging();
   this.isEngineDirty = false;
 }
	public virtual void LoadSourceState(IVsaPersistSite site)
			{
				lock(this)
				{
					Preconditions(Pre.EngineNotClosed |
								  Pre.EngineNotInitialized |
								  Pre.RootMonikerSet |
								  Pre.SiteSet);
					isEngineInitialized = true;
					try
					{
						DoLoadSourceState(site);
					}
					catch
					{
						// Reset the "isEngineInitialized" flag.
						isEngineInitialized = true;
						throw;
					}
					isEngineDirty = true;
				}
			}
Esempio n. 6
0
 public virtual void SaveSourceState(IVsaPersistSite site){
   this.TryObtainLock();
   try{
     Preconditions(Pre.EngineNotClosed | Pre.EngineNotRunning | Pre.EngineInitialised);
     if (site == null)
       throw Error(VsaError.SiteInvalid);
     try{
       DoSaveSourceState(site);
     }catch(Exception e){
       throw new VsaException(VsaError.SaveElementFailed, e.ToString(), e);
     }
   }finally{
     this.ReleaseLock();
   }
 }
      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);
        }
      }
 public virtual void SaveSourceState(IVsaPersistSite Site)
 {
 }
Esempio n. 9
0
 public virtual void LoadSourceState(IVsaPersistSite site){
   this.TryObtainLock();
   try{
     Preconditions(Pre.EngineNotClosed |
                   Pre.EngineNotInitialised |
                   Pre.RootMonikerSet |
                   Pre.SiteSet);
     this.isEngineInitialized = true;
     try{
       this.DoLoadSourceState(site);
     }catch{
       this.isEngineInitialized = false;
       throw;
     }
     this.isEngineDirty = false;
   }finally{
     this.ReleaseLock();
   }
 }
 public virtual void LoadSourceState(IVsaPersistSite Site)
 {
 }
Esempio n. 11
0
	// Internal implementation of "SaveSourceState".
	protected override void DoSaveSourceState(IVsaPersistSite site)
			{
				// Nothing to do here - source saving is not supported.
			}
Esempio n. 12
0
	// Internal implementation of "LoadSourceState".
	protected override void DoLoadSourceState(IVsaPersistSite site)
			{
				// Nothing to do here - source loading is not supported.
			}
Esempio n. 13
0
		public virtual void SaveSourceState (IVsaPersistSite site)
		{
			throw new NotImplementedException ();
		}
Esempio n. 14
0
	public void SaveSourceState(IVsaPersistSite site)
			{
				throw new NotSupportedException();
			}