コード例 #1
0
ファイル: Operation.cs プロジェクト: rvhuang/ostraka
        internal static string[] Compose(string[] template, int offset, int count,
            IEnumerable<string> placeholders, Func<string, string> valueFactory)
        {
            var segment = new ArraySegment<string>(template, offset, count);
            var operation = new ArrayOperationWithValueFactory(placeholders, valueFactory, segment.Count);

            Parallel.ForEach(segment, operation.ParallelLoopBody);

            return operation.GetResult() as string[];
        }
コード例 #2
0
ファイル: Operation.cs プロジェクト: rvhuang/ostraka
        internal static string[] Compose(ICollection<string> template,
            IEnumerable<string> placeholders, Func<string, string> valueFactory)
        {
            var operation = new ArrayOperationWithValueFactory(placeholders, valueFactory, template.Count);

            Parallel.ForEach(template, operation.ParallelLoopBody);

            return operation.GetResult() as string[];
        }