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

            Parallel.ForEach(template, operation.ParallelLoopBody);

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

            Parallel.ForEach(segment, operation.ParallelLoopBody);

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