Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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 + " = ");
 }
Ejemplo n.º 3
0
 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;
 }