AODL.Document.Export.Html.OpenDocumentHtmlExporter.CopyGraphics C# (CSharp) Метод

CopyGraphics() приватный Метод

private CopyGraphics ( IDocument document, string directory ) : void
document IDocument
directory string
Результат void
		private void CopyGraphics(IDocument document, string directory)
		{
			try
			{
				string picturedir		= directory+@"\Pictures\";

				foreach(Graphic graphic in document.Graphics)
				{
					if (graphic.GraphicRealPath != null)
					{
						//Loaded or added
						if (graphic.GraphicFileName == null)
						{
							FileInfo fInfo	= new FileInfo(graphic.GraphicRealPath);
							if (!File.Exists(picturedir+fInfo.Name))
								File.Copy(graphic.GraphicRealPath, picturedir+fInfo.Name);
						}
						else
							File.Copy(graphic.GraphicRealPath, picturedir+graphic.GraphicFileName);
					}					
				}
			}
			catch(Exception ex)
			{
				Console.WriteLine("CopyGraphics: {0}", ex.Message);
				throw;
			}
		}