src/Misc/EFTools/EntityDesignPackage/GeneratedCode/DocView.cs
/// <summary>
/// Called to initialize the view after the corresponding document has been loaded.
/// </summary>
Called to initialize the view after the corresponding document has been loaded.
Called to initialize the view after the corresponding document has been loaded .
protected override bool LoadView()
		{
			base.LoadView();
			global::System.Diagnostics.Debug.Assert(this.DocData.RootElement!=null);
			if (this.DocData.RootElement == null)
			{
				return false;
			}
			MicrosoftDataEntityDesignDocDataBase docData = this.DocData as MicrosoftDataEntityDesignDocDataBase;
			global::System.Diagnostics.Debug.Assert(docData != null, "DocData for MicrosoftDataEntityDesignDocViewBase should be an MicrosoftDataEntityDesignDocDataBase!");
			DslModeling::Partition diagramPartition = docData.GetDiagramPartition();
			if (diagramPartition != null)
			{
				global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.View.EntityDesignerDiagram> diagrams = docData.GetDiagramPartition().ElementDirectory.FindElements<global::Microsoft.Data.Entity.Design.EntityDesigner.View.EntityDesignerDiagram>();
				if (diagrams.Count > 0)
				{
					global::System.Diagnostics.Debug.Assert(diagrams.Count == 1, "Found more than one diagram, using the first one found.");
					this.Diagram = (DslDiagrams::Diagram)diagrams[0];
				}
				else
				{
					return false;
				}
			}
			else
			{
				return false;
			}
			return true;
		}
protected override bool LoadView ( ) { base . LoadView ( ) ; global :: System . Diagnostics . Debug . Assert ( this . DocData . RootElement != null ) ; if ( this . DocData . RootElement == null ) { return false ; } MicrosoftDataEntityDesignDocDataBase docData = this . DocData as MicrosoftDataEntityDesignDocDataBase ; global :: System . Diagnostics . Debug . Assert ( docData != null , " " ) ; DslModeling :: Partition diagramPartition = docData . GetDiagramPartition ( ) ; if ( diagramPartition != null ) { global :: System . Collections . ObjectModel . ReadOnlyCollection < global :: Microsoft . Data . Entity . Design . EntityDesigner . View . EntityDesignerDiagram > diagrams = docData . GetDiagramPartition ( ) . ElementDirectory . FindElements < global :: Microsoft . Data . Entity . Design . EntityDesigner . View . EntityDesignerDiagram > ( ) ; if ( diagrams . Count > 0 ) { global :: System . Diagnostics . Debug . Assert ( diagrams . Count == 1 , " " ) ; this . Diagram = ( DslDiagrams :: Diagram ) diagrams [ 0 ] ; } else { return false ; } } else { return false ; } return true ; }
Called to initialize the view after the corresponding document has been loaded.
Called to initialize the view after the corresponding document has been loaded .
// The diagram should exist in the diagram partition by now, just need to find it and connect it to this view.