private IEnumerable <MockObject> WalkGraph(int depth, bool includeSelf, MockGraphContext context, Dictionary <Guid, MockObject> visited) { if (includeSelf) { if (!visited.ContainsKey(Uuid)) { visited[Uuid] = this; yield return(this); } } if (depth <= 0) { yield break; } foreach (var @object in SourcesAndTargets(context)) { if (!visited.ContainsKey(@object.Uuid)) { visited[@object.Uuid] = @object; yield return(@object); if (depth > 1) { foreach (var node in @object.WalkGraph(depth - 1, false, context, visited)) { yield return(node); } } } } }
public MockSubscriptionInfo(v12.Datatypes.Object.SubscriptionInfo subscriptionInfo) { RequestUuid = subscriptionInfo.RequestUuid; IncludeObjectData = subscriptionInfo.IncludeObjectData; Format = subscriptionInfo.Format; Context = new MockGraphContext(subscriptionInfo); }
public IEnumerable <MockObject> SecondarySourcesAndTargets(MockGraphContext context) { if (context.IncludeSecondarySources) { foreach (var @object in SecondarySources.Values) { yield return(@object); } } if (context.IncludeSecondaryTargets) { foreach (var @object in SecondaryTargets.Values) { yield return(@object); } } }
public IEnumerable <EtpDataObjectType> SupportedPrimarySourceAndTargetTypes(MockGraphContext context) { if (context.IncludeSources) { if (context.NavigatePrimaryEdges) { foreach (var dataObjectType in SupportedSourceTypes) { yield return(dataObjectType); } } } if (context.IncludeTargets) { if (context.NavigatePrimaryEdges) { foreach (var dataObjectType in SupportedTargetTypes) { yield return(dataObjectType); } } } }
public IEnumerable <MockObject> WalkGraph(MockGraphContext context) { var visited = new Dictionary <Guid, MockObject>(); foreach (var @object in WalkGraph(context.Depth, context.IncludeSelf, context, visited)) { yield return(@object); } if (context.IncludeSecondarySources || context.IncludeSecondaryTargets) { foreach (var @object in visited.Values.ToList()) { foreach (var secondary in @object.SecondarySourcesAndTargets(context)) { if (!visited.ContainsKey(secondary.Uuid)) { visited[secondary.Uuid] = secondary; yield return(secondary); } } } } }
public MockSubscriptionInfo(EtpVersion version, MockObject mockObject, Guid requestUuid) { RequestUuid = requestUuid; IncludeObjectData = true; Context = new MockGraphContext(mockObject.Uri(version)); }
public MockSubscriptionInfo(string uri, Guid namespaceId) { RequestUuid = GuidUtility.Create(namespaceId, uri); IncludeObjectData = false; Context = new MockGraphContext(new EtpUri(uri)); }
public MockSubscriptionInfo(v11.Datatypes.Object.NotificationRequestRecord request) { RequestUuid = request.RequestUuid; IncludeObjectData = request.IncludeObjectData; Context = new MockGraphContext(request); }
public MockSubscriptionInfo(Common.Datatypes.ChannelData.IChannelDescribeSubscription subscription) { RequestUuid = subscription.RequestUuid; IncludeObjectData = false; Context = new MockGraphContext(subscription); }