private static bool AddSubgraphsAsNeeded(INamedGraph potentialNewGraph, RecordingState recordingState) { bool wasAdded = GRSExport.AddSubgraphAsNeeded(recordingState.mainExportContext, potentialNewGraph); if (wasAdded) { restart: foreach (KeyValuePair <string, GraphExportContext> kvp in recordingState.mainExportContext.nameToContext) { GraphExportContext context = kvp.Value; if (!context.isExported) { wasAdded = GRSExport.ExportSingleGraph(recordingState.mainExportContext, context, recordingState.writer); if (wasAdded) { goto restart; } } } AddGraphAttributes(recordingState.mainExportContext, recordingState.writer); return(true); } return(false); }
void EmitObjectAttributeAssignmentCreatingAsNeeded(IObject owner, AttributeType attrType, MainGraphExportContext mainExportContext, RecordingState recordingState) { if (!mainExportContext.HasPersistentName(owner)) { StringBuilder deferredInits = new StringBuilder(); GRSExport.EmitObjectCreation(mainExportContext, owner.Type, owner, graph, recordingState.writer, deferredInits); recordingState.writer.WriteLine(); recordingState.writer.Write(deferredInits.ToString()); } recordingState.writer.Write("@@(\"" + mainExportContext.GetOrAssignPersistentName((IObject)owner) + "\")." + attrType.Name + " = "); }
private static bool AddSubgraphsAsNeeded(INamedGraph potentialNewGraph, RecordingState recordingState) { bool wasAdded = GRSExport.AddSubgraphAsNeeded(recordingState.mainExportContext, potentialNewGraph); if(wasAdded) { restart: foreach(KeyValuePair<string, GraphExportContext> kvp in recordingState.mainExportContext.nameToContext) { GraphExportContext context = kvp.Value; if(!context.isExported) { wasAdded = GRSExport.ExportSingleGraph(recordingState.mainExportContext, context, recordingState.writer); if(wasAdded) goto restart; } } AddGraphAttributes(recordingState.mainExportContext, recordingState.writer); return true; } return false; }