Skip to content

Commit f20aad7

Browse files
committed
add comments and examples
1 parent ce47228 commit f20aad7

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

BuildTT/BuildTT.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,22 @@ private static void CreateTT(string generatorRoot, string ttRoot)
365365
}
366366
};
367367
368+
// Use the following function if you need to apply additional modifications to a enum
369+
// Called just before UpdateEnumMember
370+
Settings.UpdateEnum = delegate (Enumeration enumeration)
371+
{
372+
//enumeration.EnumAttributes.Add(""[DataContract]"");
373+
};
374+
375+
// Use the following function if you need to apply additional modifications to a enum member
376+
Settings.UpdateEnumMember = delegate (EnumerationMember enumerationMember)
377+
{
378+
//enumerationMember.Attributes.Add(""[EnumMember]"");
379+
380+
//enumerationMember.Attributes.Add(""[SomeAttribute(\"""" + enumerationMember.AllValues[""SomeName""] + "" \"")]"");
381+
};
382+
383+
368384
// Writes any boilerplate stuff inside the POCO class body
369385
Settings.WriteInsideClassBody = delegate(Table t)
370386
{

Generator/Settings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,19 @@ public static class Settings
268268
}
269269
};
270270

271+
// Use the following function if you need to apply additional modifications to a enum
272+
// Called just before UpdateEnumMember
271273
public static Action<Enumeration> UpdateEnum = delegate (Enumeration enumeration)
272274
{
273-
275+
//enumeration.EnumAttributes.Add("[DataContract]");
274276
};
275277

278+
// Use the following function if you need to apply additional modifications to a enum member
276279
public static Action<EnumerationMember> UpdateEnumMember = delegate (EnumerationMember enumerationMember)
277280
{
281+
//enumerationMember.Attributes.Add("[EnumMember]");
278282

283+
//enumerationMember.Attributes.Add("[SomeAttribute(\"" + enumerationMember.AllValues["SomeName"] + " \")]");
279284
};
280285

281286
// Writes any boilerplate stuff inside the POCO class body

0 commit comments

Comments
 (0)