Skip to content

Commit f38c372

Browse files
committed
Merge pull request #74 from adamzolotarev/ManualStackingFeature
Added ability to do manual stacking
2 parents a75f4a2 + a1bcc6c commit f38c372

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

Source/Shared/Extensions/EventBuilderExtensions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,16 @@ public static EventBuilder SetVersion(this EventBuilder builder, string version)
5454
builder.Target.SetVersion(version);
5555
return builder;
5656
}
57+
58+
/// <summary>
59+
/// Changes default stacking behavior by setting the stacking key.
60+
/// </summary>
61+
/// <param name="builder">The event builder object.</param>
62+
/// <param name="stackingKey">The manual stacking key.</param>
63+
public static EventBuilder SetManualStackingKey(this EventBuilder builder, string manualStackingKey)
64+
{
65+
builder.Target.SetManualStackingKey(manualStackingKey);
66+
return builder;
67+
}
5768
}
5869
}

Source/Shared/Extensions/EventExtensions.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,19 @@ public static void SetUserDescription(this Event ev, UserDescription description
211211

212212
ev.Data[Event.KnownDataKeys.UserDescription] = description;
213213
}
214+
215+
/// <summary>
216+
/// Sets the manual stacking key
217+
/// </summary>
218+
/// <param name="ev">The event</param>
219+
/// <param name="manualStackingKey">The manual stacking key.</param>
220+
public static void SetManualStackingKey(this Event ev, string manualStackingKey)
221+
{
222+
if (String.IsNullOrWhiteSpace(manualStackingKey))
223+
return;
224+
225+
ev.Data[Event.KnownDataKeys.ManualStackingKey] = manualStackingKey.Trim();
226+
}
214227
}
215228

216229
/// <summary>
@@ -245,5 +258,10 @@ public ExtendedDataInfo() {
245258
/// Specifies if properties that throw serialization errors should be ignored.
246259
/// </summary>
247260
public bool IgnoreSerializationErrors { get; set; }
261+
262+
/// <summary>
263+
/// Overrided defalut stacking behavior.
264+
/// </summary>
265+
public string StackingKey { get; set; }
248266
}
249267
}

Source/Shared/Models/Client/Event.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public static class KnownDataKeys {
7878
public const string Version = "@version";
7979
public const string Level = "@level";
8080
public const string SubmissionMethod = "@submission_method";
81+
public const string ManualStackingKey = "@manual_stacking_key";
8182
}
8283
}
8384
}

0 commit comments

Comments
 (0)