static void Main()
        {
            var devConfig = new DevSettings("devconfig.json");
            var context   = new Context()
            {
                WorkDirectory = "Вложения",
                Host          = devConfig.Host,
                Port          = devConfig.Port,
                UseSsl        = devConfig.UseSsl,
                UserName      = devConfig.UserName,
                Password      = devConfig.Password,
                SubjectText   = devConfig.SubjectText,
                SenderText    = devConfig.SenderText
            };

            // Скрипт №1
            var scriptActivity = new ScriptActivity();

            scriptActivity.Execute(context);

            // Скрипт №2
            var scriptActivity2 = new ScriptActivity2();

            scriptActivity2.Execute(context);

            Console.ReadKey();
        }
        static void Main()
        {
            var devConfig = new DevSettings("devconfig.json");
            var context   = new Context()
            {
                Host        = devConfig.Host,
                Port        = devConfig.Port,
                UseSsl      = devConfig.UseSsl,
                UserName    = devConfig.UserName,
                Password    = devConfig.Password,
                Subject     = devConfig.Subject,
                Sender      = devConfig.Sender,
                Reciver     = devConfig.Reciver,
                MessageText = devConfig.MessageText,
                Attachments = new List <FileInfo>()
                {
                    new FileInfo("Пример.xlsx"),
                    new FileInfo("Пример 2.txt")
                }
            };
            var scriptActivity = new ScriptActivity();

            scriptActivity.Execute(context);
            Console.ReadKey();
        }
 /// <summary>
 /// Установка настроек
 /// </summary>
 /// <param name="settings"></param>
 public void SetSettings(DevSettings settings)
 {
     Host        = settings.Host;
     Port        = settings.Port;
     UseSsl      = settings.UseSsl;
     UserName    = settings.UserName;
     Password    = settings.Password;
     SubjectText = settings.SubjectText;
     SenderText  = settings.SenderText;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Установка настроек
 /// </summary>
 /// <param name="settings"></param>
 public void SetSettings(DevSettings settings)
 {
     Host        = settings.Host;
     Port        = settings.Port;
     UseSsl      = settings.UseSsl;
     UserName    = settings.UserName;
     Password    = settings.Password;
     Subject     = settings.Subject;
     Sender      = settings.Sender;
     Reciver     = settings.Reciver;
     MessageText = settings.MessageText;
 }
 public DevSettings(DevSettings settings)
 {
     SetSettings(settings);
 }