예제 #1
0
 public static void UninstallData(DiscoDataContext database, PluginManifest manifest, ScheduledTaskStatus status)
 {
     status.UpdateStatus("Removing Plugin Configuration");
     new ConfigurationStore(database)
     {
         EmailConfiguration = null
     };
     database.SaveChanges();
 }
예제 #2
0
        public static void UninstallData(DiscoDataContext Database, PluginManifest Manifest, ScheduledTaskStatus Status)
        {
            Status.UpdateStatus("Removing Configuration");

            var config = new ConfigurationStore(Database);

            config.CustomerEntityId = null;
            config.CustomerUsername = null;
            Database.SaveChanges();

            // Storage Location will be cleared by the framework if requested by the user
        }
예제 #3
0
        public override void Install(DiscoDataContext database, ScheduledTaskStatus status)
        {
            var configStore = new ConfigurationStore(database);

            if (configStore.EmailConfiguration == null)
            {
                var defaultConfig = new ConfigurationModel
                {
                    CurrentVersion         = 1,
                    SmtpServerAddress      = "",
                    SmtpServerPort         = null,
                    EnableSsl              = false,
                    SmtpSenderAddress      = "",
                    AuthenticationRequried = false,
                    SmtpUsername           = "",
                    SmtpPassword           = "",
                    MessageConfig          = ConfigurationExtensions.CreateDefaultMessages()
                };

                configStore.EmailConfiguration = new JavaScriptSerializer().Serialize(defaultConfig);
                database.SaveChanges();
                status.SetFinishedMessage("Installed initial configuration");
            }
        }