예제 #1
0
        /// <summary>
        /// Convert the SegmentContentBlocks struct defined in adapter to stack
        /// </summary>
        /// <param name="segmentBlocks">The blocks field contains a number cSegments of SegmentContentBlocks fields.
        /// The Nth SegmentContentBlocks field corresponds to the Nth SegmentDescription and hence the Nth content segment.
        /// </param>
        /// <returns>Return the SegmentContentBlocks type defined in stack</returns>
        private static TestTools.StackSdk.BranchCache.Pccrc.SegmentContentBlocks[] ConvertToStackForSegBlocks(
            SegmentContentBlocks[] segmentBlocks)
        {
            TestTools.StackSdk.BranchCache.Pccrc.SegmentContentBlocks[] segmentBlocksStack
                = new TestTools.StackSdk.BranchCache.Pccrc.SegmentContentBlocks[segmentBlocks.Length];
            for (int i = 0; i < segmentBlocks.Length; i++)
            {
                segmentBlocksStack[i].BlockHashes = segmentBlocks[i].BlockHashes;
                segmentBlocksStack[i].cBlocks     = segmentBlocks[i].Cblocks;
            }

            return(segmentBlocksStack);
        }
        /// <summary>
        /// Convert the SegmentContentBlocks struct defined in adapter to stack
        /// </summary>
        /// <param name="segmentBlocks">The blocks field contains a number cSegments of SegmentContentBlocks fields. 
        /// The Nth SegmentContentBlocks field corresponds to the Nth SegmentDescription and hence the Nth content segment.
        /// </param>
        /// <returns>Return the SegmentContentBlocks type defined in stack</returns>
        private static TestTools.StackSdk.BranchCache.Pccrc.SegmentContentBlocks[] ConvertToStackForSegBlocks(
            SegmentContentBlocks[] segmentBlocks)
        {
            TestTools.StackSdk.BranchCache.Pccrc.SegmentContentBlocks[] segmentBlocksStack
                = new TestTools.StackSdk.BranchCache.Pccrc.SegmentContentBlocks[segmentBlocks.Length];
            for (int i = 0; i < segmentBlocks.Length; i++)
            {
                segmentBlocksStack[i].BlockHashes = segmentBlocks[i].BlockHashes;
                segmentBlocksStack[i].cBlocks = segmentBlocks[i].Cblocks;
            }

            return segmentBlocksStack;
        }