Skip to content

Instantly share code, notes, and snippets.

@mnaoumov
Created March 7, 2012 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnaoumov/1996900 to your computer and use it in GitHub Desktop.
Save mnaoumov/1996900 to your computer and use it in GitHub Desktop.
protected void {0}_UserActivityEvent(object sender, UserActivityEventArgs e)
{{
switch (e.UserActivityEventType)
{{
{18}
}}
}}
vs
case CustomControlGenerateType.WebMethods:
#>
protected void <#= WidgetField.Name #>_UserActivityEvent(object sender, UserActivityEventArgs e)
{
<#
var eventNamesGroups = WidgetField.UserInterfaceEvents
.Cast<Saturn.Engine.Metadata.UserInterfaceEvent>()
.Select((userInterfaceEvent, index) => new { userInterfaceEvent, index })
.ToLookup(p => WidgetField.UserInterfaceEvents.GetEventType(p.index), p => p.userInterfaceEvent.Name);
if (eventNamesGroups.Any())
{
#>
switch (e.UserActivityEventType)
{
<#
foreach (var eventNamesGroup in eventNamesGroups)
{
#>
case UserActivityEventType.<#= eventNamesGroup.Key #>
RaiseExecuteUserInterfaceActivities("<#= eventNamesGroup.Join(",") #>")
break;
<#
}
#>
}
<#
}
#>
}
<#
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment