To explain curly braces, this is just a shortcut to the following:
DailyTrigger dt = new DailyTrigger();
dt.DaysInterval = 2;
td.Triggers.Add(dt);
So the equivalent in VB will be simple:
Dim dt As DailyTrigger = new DailyTrigger()
dt.DaysInterval = 2
td.Triggers.Add(dt)
Or use a similar Withshortcut:
td.Triggers.Add(New DailyTrigger() With { .DaysInterval = 2 })
But this shortcut syntax was not added to VB.NET until a later version (part of LINQ, I believe), so if you are not using the latest version of .NET, this may not work.
source
share