예제 #1
0
        public void Register(IPluginContext context)
        {
            context.Plugin.DisplayName = "Oxite Trackbacks";

            context.Plugin.Settings["ExecuteOnAll"] = true.ToString();
            context.Plugin.Settings["Interval"]     = TimeSpan.FromMinutes(10).Ticks.ToString();
            context.Plugin.Settings["RetryCount"]   = 28.ToString();

            context.Container.RegisterType <OxiteDataContext>(new InjectionConstructor(new ResolvedParameter <string>("ApplicationServices")));
            context.Container.RegisterType <ITrackbackOutboundRepository, TrackbackOutboundRepository>();
            context.Container.RegisterType <ITrackbackOutboundService, TrackbackOutboundService>();

            context.Plugin.BackgroundServices.Add(typeof(BackgroundServices.SendTrackbacksBackgroundService));

            context.EventAdd("PostSaved", s => PostSaved(context, s));
        }
예제 #2
0
        public void Register(IPluginContext context)
        {
            context.Plugin.DisplayName = "Oxite Messages";

            context.Plugin.Settings["ExecuteOnAll"]     = true.ToString();
            context.Plugin.Settings["Interval"]         = TimeSpan.FromMinutes(2).Ticks.ToString();
            context.Plugin.Settings["FromEmailAddress"] = "";
            context.Plugin.Settings["SmtpClient.Host"]  = "";
            context.Plugin.Settings["SmtpClient.Port"]  = "";
            context.Plugin.Settings["SmtpClient.UseDefaultCredentials"] = "";
            context.Plugin.Settings["SmtpClient.Credentials.Username"]  = "";
            context.Plugin.Settings["SmtpClient.Credentials.Password"]  = "";
            context.Plugin.Settings["SmtpClient.Credentials.Domain"]    = "";
            context.Plugin.Settings["SmtpClient.EnableSsl"]             = "";

            context.Container.RegisterType <OxiteDataContext>(new InjectionConstructor(new ResolvedParameter <string>("ApplicationServices")));
            context.Container.RegisterType <IMessageOutboundRepository, MessageOutboundRepository>();
            context.Container.RegisterType <IMessageOutboundService, MessageOutboundService>();

            context.Plugin.BackgroundServices.Add(typeof(BackgroundServices.SendMessagesBackgroundService));

            context.EventAdd("CommentAdded", s => CommentAdded(context, s));
        }