private IList <ParentLocator> ReadParentLocators(VhdPropertyAttribute attribute) { var parentLocators = new List <ParentLocator>(); var attributeHelper = new AttributeHelper <ParentLocator>(); var entityAttribute = attributeHelper.GetEntityAttribute(); long baseOffset = headerOffset + attribute.Offset; for (int i = 0; i < attribute.Count; i++) { var parentLocatorFactory = new VhdParentLocatorFactory(dataReader, baseOffset); parentLocators.Add(parentLocatorFactory.Create()); baseOffset += entityAttribute.Size; } return(parentLocators); }
private IEnumerable <CompletionPort> CreateParentLocators(AsyncMachine <IList <ParentLocator> > machine, VhdPropertyAttribute attribute) { var parentLocators = new List <ParentLocator>(); var attributeHelper = new AttributeHelper <ParentLocator>(); var entityAttribute = attributeHelper.GetEntityAttribute(); long baseOffset = headerOffset + attribute.Offset; for (int i = 0; i < attribute.Count; i++) { var parentLocatorFactory = new VhdParentLocatorFactory(dataReader, baseOffset); parentLocatorFactory.BeginReadCreate(machine.CompletionCallback, null); yield return(CompletionPort.SingleOperation); ParentLocator parentLocator = parentLocatorFactory.EndReadCreate(machine.CompletionResult); parentLocators.Add(parentLocator); baseOffset += entityAttribute.Size; } machine.ParameterValue = parentLocators; }