AODL.Document.TextDocuments.TextDocument.Dispose C# (CSharp) Method

Dispose() public method

Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection.
public Dispose ( ) : void
return void
		public void Dispose()
		{
			Dispose(true);
			GC.SuppressFinalize(this);
		}

Same methods

TextDocument::Dispose ( bool disposing ) : void

Usage Example

示例#1
0
		public void LoadFileDeleteGraphic()
		{
			string fileName					= "hallo_rem_graphic.odt";
			string graphicFile				= "";
			TextDocument document			= new TextDocument();
			document.Load(AARunMeFirstAndOnce.inPutFolder+"hallo.odt");
			foreach(IContent iContent in document.Content)
			{
				if (iContent is Paragraph && ((Paragraph)iContent).Content.Count > 0
					&& ((Paragraph)iContent).Content[0] is Frame)
				{
					Frame frame				= ((Paragraph)iContent).Content[0] as Frame;
					Assert.IsTrue(frame.Content[0] is Graphic, "Must be a graphic!");
					Graphic graphic			= frame.Content[0] as Graphic;
					//now access the full qualified graphic path
					Assert.IsNotNull(graphic.GraphicRealPath, "The graphic real path must exist!");
					Assert.IsTrue(File.Exists(graphic.GraphicRealPath));
					graphicFile				= graphic.GraphicRealPath;
					//Delete the graphic
					frame.Content.Remove(graphic);
				}
			}
			document.SaveTo(AARunMeFirstAndOnce.outPutFolder+fileName);
			//Special case, only for this test neccessary
			document.Dispose();
			//Load file again
			TextDocument documentRel		= new TextDocument();
			documentRel.Load(AARunMeFirstAndOnce.outPutFolder+fileName);
			Assert.IsFalse(File.Exists(graphicFile), "This file must be removed from this file!");
		}
All Usage Examples Of AODL.Document.TextDocuments.TextDocument::Dispose