thanks Hristo, but my problem is not about formatting, it's about aggregating strings.
I've solved my problem with a custom aggregator.
01.
public
class
StringAggregateFunction : AggregateFunction
02.
{
03.
protected
override
Cloneable CreateInstanceCore()
04.
{
05.
return
new
StringAggregateFunction();
06.
}
07.
08.
protected
override
void
CloneCore(Cloneable source)
09.
{ }
10.
11.
public
override
string
DisplayName
12.
{
13.
get
{
return
"StringAggregateFunction"
; }
14.
}
15.
16.
protected
override
AggregateValue CreateAggregate(IAggregateContext context)
17.
{
18.
return
new
StringAggregate();
19.
}
20.
}
21.
22.
public
class
StringAggregate : AggregateValue
23.
{
24.
private
string
value = String.Empty;
25.
26.
protected
override
object
GetValueOverride()
27.
{
28.
return
value;
29.
}
30.
31.
protected
override
void
AccumulateOverride(
object
value)
32.
{
33.
// only set value the first time
34.
if
(
this
.value == String.Empty)
35.
{
36.
this
.value = Convert.ToString(value);
37.
}
38.
39.
//this.value = this.value + Convert.ToString(value);
40.
}
41.
42.
protected
override
void
MergeOverride(AggregateValue childAggregate)
43.
{
44.
var stringAggregate = childAggregate
as
StringAggregate;
45.
if
(stringAggregate !=
null
)
46.
{
47.
if
(
this
.value == String.Empty)
48.
{
49.
// first aggregation value
50.
this
.value = stringAggregate.value;
51.
}
52.
else
if
(
this
.value != stringAggregate.value)
53.
{
54.
// next aggregation differs
55.
this
.value =
"Mixed"
;
56.
}
57.
else
58.
{
59.
// next aggregation value is the same
60.
}
61.
}
62.
else
63.
{
64.
throw
new
InvalidOperationException();
65.
}
66.
}
67.
}