internal DxfModel LoadExternalReference( Dictionary <string, DxfModel> loadedExternalReferences, DxfBlock.GetExternalReferenceDelegate resolveExternalReference, out bool wasAlreadyLoaded) { DxfModel dxfModel = (DxfModel)null; wasAlreadyLoaded = false; if (this.IsExternalReference && !string.IsNullOrEmpty(this.ExternalReference) && !this.IsExternalReferenceUnloaded) { wasAlreadyLoaded = loadedExternalReferences.TryGetValue(this.ExternalReference, out dxfModel); if (wasAlreadyLoaded) { if (!this.Model.ExternalReferences.ContainsKey(this.ExternalReference)) { this.Model.ExternalReferences.Add(this.ExternalReference, dxfModel); } } else { dxfModel = resolveExternalReference(this); if (dxfModel != null) { loadedExternalReferences.Add(this.ExternalReference, dxfModel); if (!this.Model.ExternalReferences.ContainsKey(this.ExternalReference)) { this.Model.ExternalReferences.Add(this.ExternalReference, dxfModel); } } } } return(dxfModel); }
public bool LoadExternalReference( DxfBlock.GetExternalReferenceDelegate resolveExternalReference) { bool wasAlreadyLoaded; return(this.LoadExternalReference(this.Model.ExternalReferences, resolveExternalReference, out wasAlreadyLoaded) != null); }