示例#1
0
        private bool DoesLifetimeOutlastLifetimeGraph(BoundedLifetime boundedLifetime, LifetimeGraphIdentifier graphIdentifier)
        {
            BoundedLifetimeGraph boundedLifetimeGraph = boundedLifetime.DiagramGraph;
            BoundedLifetimeGraph diagramGraph         = _diagramGraphs[graphIdentifier];

            if (boundedLifetimeGraph == diagramGraph)
            {
                return(boundedLifetimeGraph.DoesOutlast(boundedLifetime, boundedLifetimeGraph.DiagramLifetime));
            }
            else
            {
                LifetimeGraphIdentifier currentGraphIdentifier = graphIdentifier, parentGraphIdentifier;
                while (_graphParents.TryGetValue(currentGraphIdentifier, out parentGraphIdentifier))
                {
                    diagramGraph = _diagramGraphs[currentGraphIdentifier];
                    if (diagramGraph == boundedLifetimeGraph)
                    {
                        return(true);
                    }
                    currentGraphIdentifier = parentGraphIdentifier;
                }
                return(false);
            }
        }
示例#2
0
 public BoundedLifetime(LifetimeGraphTree graphTree, BoundedLifetimeGraph graph)
 {
     _graphTree   = graphTree;
     DiagramGraph = graph;
 }
示例#3
0
 public void EstablishLifetimeGraph(LifetimeGraphIdentifier identifier, LifetimeGraphIdentifier parentIdentifier)
 {
     _diagramGraphs[identifier] = new BoundedLifetimeGraph(this);
     _graphParents[identifier]  = parentIdentifier;
 }