Skip to content

Instantly share code, notes, and snippets.

@rhysgodfrey
Created August 3, 2016 20:35
Show Gist options
  • Save rhysgodfrey/fdad1fd3dd778efe77960e2644e3d267 to your computer and use it in GitHub Desktop.
Save rhysgodfrey/fdad1fd3dd778efe77960e2644e3d267 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telligent.Evolution.Extensibility.Api.Version1;
using Telligent.Evolution.Extensibility.Version1;
namespace ClassLibrary2
{
public class ThemeSwitchTestPlugin : IPlugin
{
public string Description
{
get
{
return "Test Theme Events";
}
}
public string Name
{
get
{
return "Test Theme Plugin";
}
}
public void Initialize()
{
PublicApi.Site.Events.SelectTheme += OnSelectTheme;
PublicApi.Groups.Events.SelectTheme += OnSelectGroupTheme;
PublicApi.Blogs.Events.SelectTheme += OnSelectBlogTheme;
}
private void OnSelectBlogTheme(BlogSelectThemeEventArgs e)
{
PublicApi.Eventlogs.Write("Blog Theme Selected!", new EventLogEntryWriteOptions
{
Category = "Theme Event Test",
EventId = 113,
EventType = "Information"
});
}
private void OnSelectGroupTheme(GroupSelectThemeEventArgs e)
{
PublicApi.Eventlogs.Write("Group Theme Selected!", new EventLogEntryWriteOptions
{
Category = "Theme Event Test",
EventId = 112,
EventType = "Information"
});
}
private void OnSelectTheme(SiteSelectThemeEventArgs e)
{
PublicApi.Eventlogs.Write("Site Theme Selected!", new EventLogEntryWriteOptions
{
Category = "Theme Event Test",
EventId = 111,
EventType = "Information"
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment