예제 #1
0
파일: ComManager.cs 프로젝트: olesar/Altaxo
        public GraphDocumentDataObject GetDocumentsDataObjectForGraphDocument(GraphDocumentBase doc)
        {
            var newComObject = new GraphDocumentDataObject(doc, _fileComObject, this);

            _lastUsedDataObject = new WeakReference(newComObject);
            return(newComObject);
        }
예제 #2
0
        private void CopyDocumentInformation(GraphDocumentBase graph)
        {
            var sourceDocument = (AltaxoDocument)Main.AbsoluteDocumentPath.GetRootNodeImplementing(graph, typeof(AltaxoDocument));

            if (null != sourceDocument)
            {
                _document.DocumentIdentifier = sourceDocument.DocumentIdentifier;
            }
        }
예제 #3
0
        public GraphDocumentDataObject(GraphDocumentBase graphDocument, ProjectFileComObject fileComObject, ComManager comManager)
            : base(comManager)
        {
            ComDebug.ReportInfo("{0} constructor.", GetType().Name);
            _dataAdviseHolder = new ManagedDataAdviseHolder();

            _graphDocumentName = graphDocument.Name;
            _graphDocumentSize = graphDocument.Size;

            _graphExportOptions = graphDocument.GetPropertyValue(ClipboardRenderingOptions.PropertyKeyClipboardRenderingOptions, () => new ClipboardRenderingOptions()).Clone();
            var embeddedRenderingOptions = graphDocument.GetPropertyValue(EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions, () => null);

            if (null != embeddedRenderingOptions)
            {
                _graphExportOptions.CopyFrom(embeddedRenderingOptions); // merge embedded rendering options
            }
            if ((_graphExportOptions.RenderEnhancedMetafile && _graphExportOptions.RenderEnhancedMetafileAsVectorFormat) ||
                (_graphExportOptions.RenderDropFile && _graphExportOptions.DropFileImageFormat == System.Drawing.Imaging.ImageFormat.Emf)
                )
            {
                if (graphDocument is Altaxo.Graph.Gdi.GraphDocument)
                {
                    _graphDocumentMetafileImage = GraphDocumentExportActions.RenderAsEnhancedMetafileVectorFormat((Altaxo.Graph.Gdi.GraphDocument)graphDocument, _graphExportOptions);
                }
            }

            if (null == _graphDocumentMetafileImage ||
                _graphExportOptions.RenderBitmap ||
                _graphExportOptions.RenderWindowsMetafile ||
                (_graphExportOptions.RenderEnhancedMetafile && !_graphExportOptions.RenderEnhancedMetafileAsVectorFormat) ||
                _graphExportOptions.RenderDropFile)
            {
                if (graphDocument is Altaxo.Graph.Gdi.GraphDocument)
                {
                    _graphDocumentBitmapImage = GraphDocumentExportActions.RenderAsBitmap((Altaxo.Graph.Gdi.GraphDocument)graphDocument, _graphExportOptions.BackgroundBrush, System.Drawing.Imaging.PixelFormat.Format32bppArgb, _graphExportOptions.SourceDpiResolution, _graphExportOptions.SourceDpiResolution / _graphExportOptions.OutputScalingFactor);
                }
                else if (graphDocument is Altaxo.Graph.Graph3D.GraphDocument)
                {
                    _graphDocumentBitmapImage = Altaxo.Graph.Graph3D.GraphDocumentExportActions.RenderAsBitmap((Altaxo.Graph.Graph3D.GraphDocument)graphDocument, _graphExportOptions.BackgroundBrush, System.Drawing.Imaging.PixelFormat.Format32bppArgb, _graphExportOptions.SourceDpiResolution, _graphExportOptions.SourceDpiResolution / _graphExportOptions.OutputScalingFactor);
                }
                else
                {
                    throw new NotImplementedException();
                }
            }

            if (_graphExportOptions.RenderEmbeddedObject)
            {
                var miniProjectBuilder = new Altaxo.Graph.Procedures.MiniProjectBuilder();
                _altaxoMiniProject = miniProjectBuilder.GetMiniProject(graphDocument, true);
            }
            else
            {
                _altaxoMiniProject = null;
            }
        }
예제 #4
0
 protected void CopyFolderPropertiesOf(GraphDocumentBase oldGraph)
 {
     foreach (var doc in PropertyExtensions.GetProjectFolderPropertyDocuments(oldGraph))
     {
         if (doc.PropertyBag != null && doc.PropertyBag.Count > 0)
         {
             var bagclone = doc.Clone();
             _document.ProjectFolderProperties.Add(bagclone);
         }
     }
 }
		/// <summary>
		/// Gets the rendering options for the provided graph document.
		/// </summary>
		/// <param name="document">The graph document.</param>
		/// <returns>The rendering options for the graph document. If the graph itself has no rendering options stored (key: <see cref="Altaxo.Graph.Gdi.EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions"/>, the hierarchy (folders, document, etc.) is walked down to find the rendering options.</returns>
		public static EmbeddedObjectRenderingOptions GetRenderingOptions(GraphDocumentBase document)
		{
			var embe = Altaxo.PropertyExtensions.GetPropertyValue(document, EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions, null);
			if (null != embe)
				return embe;

			var clip = Altaxo.PropertyExtensions.GetPropertyValue(document, ClipboardRenderingOptions.PropertyKeyClipboardRenderingOptions, null);
			if (null != clip)
				return clip;

			return new EmbeddedObjectRenderingOptions();
		}
예제 #6
0
        /// <summary>
        /// Gets a graph document as mini project. The mini project is an <see cref="AltaxoDocument"/> consisting of the provided graph document <see cref="AltaxoDocument"/> and all data that is neccessary
        /// to plot that graph.
        /// </summary>
        /// <param name="graph">The existing graph (this graph is cloned before added to the mini project).</param>
        /// <param name="ensureEmbeddedObjectRenderingOptionsStoredInGraph">If set to <c>true</c>, the current embedded rendering options are stored as property in the graph document of the mini project.
        /// This ensures that later on the graph is rendered in the client document exactly as it was chosen to be in the current project. If the mini project is not used for COM, leave that flag to <c>false.</c></param>
        /// <returns>The mini project containing the cloned graph and all related data.</returns>
        public AltaxoDocument GetMiniProject(GraphDocumentBase graph, bool ensureEmbeddedObjectRenderingOptionsStoredInGraph)
        {
            Initialize();

            _graph = graph;
            CollectAllDataColumnReferences();
            CopyReferencedColumnsToNewProject();
            CopyGraphToNewDocument(_graph, ensureEmbeddedObjectRenderingOptionsStoredInGraph);
            CopyFolderPropertiesOf(_graph);
            CopyDocumentInformation(_graph);

            return(_document);
        }
예제 #7
0
		/// <summary>
		/// Gets a graph document as mini project. The mini project is an <see cref="AltaxoDocument"/> consisting of the provided graph document <see cref="AltaxoDocument"/> and all data that is neccessary
		/// to plot that graph.
		/// </summary>
		/// <param name="graph">The existing graph (this graph is cloned before added to the mini project).</param>
		/// <param name="ensureEmbeddedObjectRenderingOptionsStoredInGraph">If set to <c>true</c>, the current embedded rendering options are stored as property in the graph document of the mini project.
		/// This ensures that later on the graph is rendered in the client document exactly as it was chosen to be in the current project. If the mini project is not used for COM, leave that flag to <c>false.</c></param>
		/// <returns>The mini project containing the cloned graph and all related data.</returns>
		public AltaxoDocument GetMiniProject(GraphDocumentBase graph, bool ensureEmbeddedObjectRenderingOptionsStoredInGraph)
		{
			Initialize();

			_graph = graph;
			CollectAllDataColumnReferences();
			CopyReferencedColumnsToNewProject();
			CopyGraphToNewDocument(_graph, ensureEmbeddedObjectRenderingOptionsStoredInGraph);
			CopyFolderPropertiesOf(_graph);
			CopyDocumentInformation(_graph);

			return _document;
		}
        /// <summary>
        /// Renders the provided graph document to an device independent bitmap (TYMED_HGLOBAL). Please not that this format does not support transparancy, thus the back color provided in the rendering options is used as ground brush first.
        /// </summary>
        /// <param name="tymed">The tymed to check.</param>
        /// <param name="document">The graph document.</param>
        /// <returns>Pointer to the device independent bitmap (TYMED_HGLOBAL).</returns>
        public static IntPtr RenderAsDIBBitmap_TYMED_HGLOBAL(TYMED tymed, GraphDocumentBase document)
        {
            if (!(tymed == TYMED.TYMED_HGLOBAL))
            {
                throw new ArgumentException(nameof(tymed) + " is not TYMED_HGLOBAL");
            }

            var renderingOptions = GetRenderingOptions(document);

            using (var bmp = Altaxo.Graph.GraphDocumentBaseExportActions.RenderAsBitmap(document, renderingOptions, System.Drawing.Imaging.PixelFormat.Format24bppRgb))
            {
                return(DataObjectHelper.RenderDIBBitmapToHGLOBAL(bmp));
            }
        }
예제 #9
0
		protected void CopyGraphToNewDocument(GraphDocumentBase oldGraph, bool ensureEmbeddedObjectRenderingOptionsStoredInGraph)
		{
			var newGraph = (GraphDocumentBase)oldGraph.Clone();
			newGraph.Name = oldGraph.Name;
			_document.AddItem(newGraph);

			if (ensureEmbeddedObjectRenderingOptionsStoredInGraph)
			{
				var clipboardRenderingOptions = Altaxo.PropertyExtensions.GetPropertyValue(oldGraph, ClipboardRenderingOptions.PropertyKeyClipboardRenderingOptions, () => new ClipboardRenderingOptions());
				var embeddedRenderingOptions = Altaxo.PropertyExtensions.GetPropertyValue(oldGraph, EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions, () => null);

				// if embeddedRenderingOptions exists explicitely, they should be used. Else the clipboard options can be used.
				var clonedOptions = null != embeddedRenderingOptions ? embeddedRenderingOptions.Clone() : new EmbeddedObjectRenderingOptions(clipboardRenderingOptions);
				newGraph.PropertyBagNotNull.SetValue(EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions, clonedOptions);
			}
		}
예제 #10
0
		public GraphDocumentDataObject(GraphDocumentBase graphDocument, ProjectFileComObject fileComObject, ComManager comManager)
			: base(comManager)
		{
			ComDebug.ReportInfo("{0} constructor.", this.GetType().Name);
			_dataAdviseHolder = new ManagedDataAdviseHolder();

			_graphDocumentName = graphDocument.Name;
			_graphDocumentSize = graphDocument.Size;

			_graphExportOptions = graphDocument.GetPropertyValue(ClipboardRenderingOptions.PropertyKeyClipboardRenderingOptions, () => new ClipboardRenderingOptions()).Clone();
			var embeddedRenderingOptions = graphDocument.GetPropertyValue(EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions, () => null);
			if (null != embeddedRenderingOptions)
				_graphExportOptions.CopyFrom(embeddedRenderingOptions); // merge embedded rendering options

			if ((_graphExportOptions.RenderEnhancedMetafile && _graphExportOptions.RenderEnhancedMetafileAsVectorFormat) ||
					(_graphExportOptions.RenderDropFile && _graphExportOptions.DropFileImageFormat == System.Drawing.Imaging.ImageFormat.Emf)
				)
			{
				if (graphDocument is Altaxo.Graph.Gdi.GraphDocument)
					_graphDocumentMetafileImage = GraphDocumentExportActions.RenderAsEnhancedMetafileVectorFormat((Altaxo.Graph.Gdi.GraphDocument)graphDocument, _graphExportOptions);
			}

			if (null == _graphDocumentMetafileImage ||
				_graphExportOptions.RenderBitmap ||
				_graphExportOptions.RenderWindowsMetafile ||
				(_graphExportOptions.RenderEnhancedMetafile && !_graphExportOptions.RenderEnhancedMetafileAsVectorFormat) ||
				_graphExportOptions.RenderDropFile)
			{
				if (graphDocument is Altaxo.Graph.Gdi.GraphDocument)
					_graphDocumentBitmapImage = GraphDocumentExportActions.RenderAsBitmap((Altaxo.Graph.Gdi.GraphDocument)graphDocument, _graphExportOptions.BackgroundBrush, System.Drawing.Imaging.PixelFormat.Format32bppArgb, _graphExportOptions.SourceDpiResolution, _graphExportOptions.SourceDpiResolution / _graphExportOptions.OutputScalingFactor);
				else if (graphDocument is Altaxo.Graph.Graph3D.GraphDocument)
					_graphDocumentBitmapImage = Altaxo.Graph.Graph3D.GraphDocumentExportActions.RenderAsBitmap((Altaxo.Graph.Graph3D.GraphDocument)graphDocument, _graphExportOptions.BackgroundBrush, System.Drawing.Imaging.PixelFormat.Format32bppArgb, _graphExportOptions.SourceDpiResolution, _graphExportOptions.SourceDpiResolution / _graphExportOptions.OutputScalingFactor);
				else
					throw new NotImplementedException();
			}

			if (_graphExportOptions.RenderEmbeddedObject)
			{
				var miniProjectBuilder = new Altaxo.Graph.Procedures.MiniProjectBuilder();
				_altaxoMiniProject = miniProjectBuilder.GetMiniProject(graphDocument, true);
			}
			else
			{
				_altaxoMiniProject = null;
			}
		}
        /// <summary>
        /// Gets the rendering options for the provided graph document.
        /// </summary>
        /// <param name="document">The graph document.</param>
        /// <returns>The rendering options for the graph document. If the graph itself has no rendering options stored (key: <see cref="Altaxo.Graph.Gdi.EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions"/>, the hierarchy (folders, document, etc.) is walked down to find the rendering options.</returns>
        public static EmbeddedObjectRenderingOptions GetRenderingOptions(GraphDocumentBase document)
        {
            var embe = Altaxo.PropertyExtensions.GetPropertyValue(document, EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions, null);

            if (null != embe)
            {
                return(embe);
            }

            var clip = Altaxo.PropertyExtensions.GetPropertyValue(document, ClipboardRenderingOptions.PropertyKeyClipboardRenderingOptions, null);

            if (null != clip)
            {
                return(clip);
            }

            return(new EmbeddedObjectRenderingOptions());
        }
예제 #12
0
        protected void CopyGraphToNewDocument(GraphDocumentBase oldGraph, bool ensureEmbeddedObjectRenderingOptionsStoredInGraph)
        {
            var newGraph = (GraphDocumentBase)oldGraph.Clone();

            newGraph.Name = oldGraph.Name;
            _document.AddItem(newGraph);

            if (ensureEmbeddedObjectRenderingOptionsStoredInGraph)
            {
                var clipboardRenderingOptions = Altaxo.PropertyExtensions.GetPropertyValue(oldGraph, ClipboardRenderingOptions.PropertyKeyClipboardRenderingOptions, () => new ClipboardRenderingOptions());
                var embeddedRenderingOptions  = Altaxo.PropertyExtensions.GetPropertyValue(oldGraph, EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions, () => null);

                // if embeddedRenderingOptions exists explicitely, they should be used. Else the clipboard options can be used.
                var clonedOptions = null != embeddedRenderingOptions?embeddedRenderingOptions.Clone() : new EmbeddedObjectRenderingOptions(clipboardRenderingOptions);

                newGraph.PropertyBagNotNull.SetValue(EmbeddedObjectRenderingOptions.PropertyKeyEmbeddedObjectRenderingOptions, clonedOptions);
            }
        }
		/// <summary>
		/// Renders the provided graph document to an enhanced metafile (TYMED_ENHMF).
		/// </summary>
		/// <param name="tymed">The tymed to check.</param>
		/// <param name="document">The graph document.</param>
		/// <returns>Pointer to the enhanced metafile (TYMED_ENHMF).</returns>
		public static IntPtr RenderEnhancedMetafile_TYMED_ENHMF(TYMED tymed, GraphDocumentBase document)
		{
			if (!(tymed == TYMED.TYMED_ENHMF))
				throw new ArgumentException(nameof(tymed) + " is not TYMED_TYMED_ENHMF");

			var renderingOptions = GetRenderingOptions(document);
			if (renderingOptions.RenderEnhancedMetafileAsVectorFormat)
			{
				var metafile = Altaxo.Graph.GraphDocumentBaseExportActions.RenderAsEnhancedMetafileVectorFormat(document, renderingOptions);
				return metafile.GetHenhmetafile();
			}
			else
			{
				using (var bmp = Altaxo.Graph.GraphDocumentBaseExportActions.RenderAsBitmap(document, renderingOptions, System.Drawing.Imaging.PixelFormat.Format32bppArgb))
				{
					var scaledDocSize = document.Size * renderingOptions.OutputScalingFactor;
					return GraphDocumentExportActions.RenderAsEnhancedMetafileBitmapFormat(bmp, scaledDocSize).GetHenhmetafile();
				}
			}
		}
        /// <summary>
        /// Renders the provided graph document to an windows metafile picture (TYMED_MFPICT). Please not that this format does not support transparancy, thus the back color provided in the rendering options is used as ground brush first.
        /// </summary>
        /// <param name="tymed">The tymed to check.</param>
        /// <param name="document">The graph document.</param>
        /// <returns>Pointer to windows metafile picture (TYMED_MFPICT).</returns>
        public static IntPtr RenderWindowsMetafilePict_TYMED_MFPICT(TYMED tymed, GraphDocumentBase document)
        {
            if (!(tymed == TYMED.TYMED_MFPICT))
            {
                throw new ArgumentException(nameof(tymed) + " is not TYMED_MFPICT");
            }

            var renderingOptions = GetRenderingOptions(document);

            using (var rgbBitmap = Altaxo.Graph.GraphDocumentBaseExportActions.RenderAsBitmap(document, renderingOptions, System.Drawing.Imaging.PixelFormat.Format24bppRgb))
            {
                var scaledDocSize = document.Size * renderingOptions.OutputScalingFactor;

                using (var enhancedMetafile = GraphDocumentExportActions.RenderAsEnhancedMetafileBitmapFormat(rgbBitmap, scaledDocSize))
                {
                    var hEmf = enhancedMetafile.GetHenhmetafile();
                    return(DataObjectHelper.ConvertEnhancedMetafileToWindowsMetafilePict(hEmf, scaledDocSize.X, scaledDocSize.Y));
                }
            }
        }
        /// <summary>
        /// Renders the provided graph document to an enhanced metafile (TYMED_ENHMF).
        /// </summary>
        /// <param name="tymed">The tymed to check.</param>
        /// <param name="document">The graph document.</param>
        /// <returns>Pointer to the enhanced metafile (TYMED_ENHMF).</returns>
        public static IntPtr RenderEnhancedMetafile_TYMED_ENHMF(TYMED tymed, GraphDocumentBase document)
        {
            if (!(tymed == TYMED.TYMED_ENHMF))
            {
                throw new ArgumentException(nameof(tymed) + " is not TYMED_TYMED_ENHMF");
            }

            var renderingOptions = GetRenderingOptions(document);

            if (renderingOptions.RenderEnhancedMetafileAsVectorFormat)
            {
                var metafile = Altaxo.Graph.GraphDocumentBaseExportActions.RenderAsEnhancedMetafileVectorFormat(document, renderingOptions);
                return(metafile.GetHenhmetafile());
            }
            else
            {
                using (var bmp = Altaxo.Graph.GraphDocumentBaseExportActions.RenderAsBitmap(document, renderingOptions, System.Drawing.Imaging.PixelFormat.Format32bppArgb))
                {
                    var scaledDocSize = document.Size * renderingOptions.OutputScalingFactor;
                    return(GraphDocumentExportActions.RenderAsEnhancedMetafileBitmapFormat(bmp, scaledDocSize).GetHenhmetafile());
                }
            }
        }
		/// <summary>
		/// Renders the provided graph document to an device independent bitmap (TYMED_HGLOBAL). Please not that this format does not support transparancy, thus the back color provided in the rendering options is used as ground brush first.
		/// </summary>
		/// <param name="tymed">The tymed to check.</param>
		/// <param name="document">The graph document.</param>
		/// <returns>Pointer to the device independent bitmap (TYMED_HGLOBAL).</returns>
		public static IntPtr RenderAsDIBBitmap_TYMED_HGLOBAL(TYMED tymed, GraphDocumentBase document)
		{
			if (!(tymed == TYMED.TYMED_HGLOBAL))
				throw new ArgumentException(nameof(tymed) + " is not TYMED_HGLOBAL");

			var renderingOptions = GetRenderingOptions(document);
			using (var bmp = Altaxo.Graph.GraphDocumentBaseExportActions.RenderAsBitmap(document, renderingOptions, System.Drawing.Imaging.PixelFormat.Format24bppRgb))
			{
				return DataObjectHelper.RenderDIBBitmapToHGLOBAL(bmp);
			}
		}
예제 #17
0
파일: ComManager.cs 프로젝트: Altaxo/Altaxo
		public void NotifyDocumentOfDocumentsComObjectChanged(GraphDocumentEmbeddedComObject documentComObject, GraphDocumentBase oldDocument, GraphDocumentBase newDocument)
		{
			if (!(null == oldDocument))
				throw new ArgumentException(nameof(oldDocument) + " should be null");
			if (null == newDocument)
				throw new ArgumentNullException(nameof(newDocument));

			_embeddedComObject = documentComObject;
			EnterEmbeddedObjectMode();
		}
예제 #18
0
파일: ComManager.cs 프로젝트: Altaxo/Altaxo
		public GraphDocumentDataObject GetDocumentsDataObjectForGraphDocument(GraphDocumentBase doc)
		{
			var newComObject = new GraphDocumentDataObject(doc, _fileComObject, this);
			_lastUsedDataObject = new WeakReference(newComObject);
			return newComObject;
		}
예제 #19
0
파일: ComManager.cs 프로젝트: olesar/Altaxo
        public void NotifyDocumentOfDocumentsComObjectChanged(GraphDocumentEmbeddedComObject documentComObject, GraphDocumentBase oldDocument, GraphDocumentBase newDocument)
        {
            if (!(null == oldDocument))
            {
                throw new ArgumentException(nameof(oldDocument) + " should be null");
            }
            if (null == newDocument)
            {
                throw new ArgumentNullException(nameof(newDocument));
            }

            _embeddedComObject = documentComObject;
            EnterEmbeddedObjectMode();
        }
예제 #20
0
		private void CopyDocumentInformation(GraphDocumentBase graph)
		{
			var sourceDocument = (AltaxoDocument)Main.AbsoluteDocumentPath.GetRootNodeImplementing(graph, typeof(AltaxoDocument));

			if (null != sourceDocument)
			{
				_document.DocumentIdentifier = sourceDocument.DocumentIdentifier;
			}
		}
		/// <summary>
		/// Renders the provided graph document to an windows metafile picture (TYMED_MFPICT). Please not that this format does not support transparancy, thus the back color provided in the rendering options is used as ground brush first.
		/// </summary>
		/// <param name="tymed">The tymed to check.</param>
		/// <param name="document">The graph document.</param>
		/// <returns>Pointer to windows metafile picture (TYMED_MFPICT).</returns>
		public static IntPtr RenderWindowsMetafilePict_TYMED_MFPICT(TYMED tymed, GraphDocumentBase document)
		{
			if (!(tymed == TYMED.TYMED_MFPICT))
				throw new ArgumentException(nameof(tymed) + " is not TYMED_MFPICT");

			var renderingOptions = GetRenderingOptions(document);
			using (var rgbBitmap = Altaxo.Graph.GraphDocumentBaseExportActions.RenderAsBitmap(document, renderingOptions, System.Drawing.Imaging.PixelFormat.Format24bppRgb))
			{
				var scaledDocSize = document.Size * renderingOptions.OutputScalingFactor;

				using (var enhancedMetafile = GraphDocumentExportActions.RenderAsEnhancedMetafileBitmapFormat(rgbBitmap, scaledDocSize))
				{
					var hEmf = enhancedMetafile.GetHenhmetafile();
					return DataObjectHelper.ConvertEnhancedMetafileToWindowsMetafilePict(hEmf, scaledDocSize.X, scaledDocSize.Y);
				}
			}
		}
예제 #22
0
		protected void CopyFolderPropertiesOf(GraphDocumentBase oldGraph)
		{
			foreach (var doc in PropertyExtensions.GetProjectFolderPropertyDocuments(oldGraph))
			{
				if (doc.PropertyBag != null && doc.PropertyBag.Count > 0)
				{
					var bagclone = doc.Clone();
					_document.ProjectFolderProperties.Add(bagclone);
				}
			}
		}