Exemplo n.º 1
0
 public static bool Run(string file)
 {
     using (var zip = new ZipFileSystem(file))
     {
         return(Run(zip));
     }
 }
Exemplo n.º 2
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                Check();
            }
            catch (Exception err)
            {
                Errors.Report(err);
                return;
            }

            var         cfg  = GlobalSettings.Pages.Email();
            MailMessage mail = new MailMessage();

            mail.From = cfg.GetFromAddress();
            foreach (string addr in emailToFrame1.EmailTo.Split(';'))
            {
                mail.To.Add(addr);
            }
            mail.Subject    = tbxSubject.Text;
            mail.Body       = tbxBody.Text;
            mail.IsBodyHtml = false;

            string fn = Core.GetTempFile(".dca");

            using (var zipfs = new ZipFileSystem(fn))
            {
                configSelectionFrame1.Root.CopyCheckedTo(zipfs, true, null);
                zipfs.Flush();
            }

            using (var dcafr = new FileInfo(fn).OpenRead())
            {
                var att = new Attachment(dcafr, "configuration.dca");
                mail.Attachments.Add(att);

                if (chbAddHowTo.Checked)
                {
                    var ms = new MemoryStream();
                    var sw = new StreamWriter(ms);
                    sw.Write(CoreRes.sendconfig_howto);
                    sw.Flush();
                    ms.Position = 0;
                    var atthowto = new Attachment(ms, "howto.html");
                    mail.Attachments.Add(atthowto);
                }

                SmtpClient smtp = cfg.GetClient();
                Logging.Info("Sending mail to " + emailToFrame1.EmailTo);
                smtp.Send(mail);
            }

            File.Delete(fn);
            Close();
            StdDialog.ShowInfo("s_configuration_sent");
        }
Exemplo n.º 3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            var place = (IFilePlace)addonSelectFrame1.SelectedObject;

            try
            {
                place.CheckOutput();
            }
            catch (Exception err)
            {
                Errors.Report(err);
                return;
            }
            string fn = place.GetWorkingFileName();

            using (var zipfs = new ZipFileSystem(fn))
            {
                configSelectionFrame1.Root.CopyCheckedTo(zipfs, true, null);
                zipfs.Flush();
            }
            place.FinalizeFileName();
            DialogResult = DialogResult.OK;
            Close();
        }
Exemplo n.º 4
0
 public ZipVirtualFile(ZipFileSystem fs, string path)
     : base(fs, path)
 {
 }
Exemplo n.º 5
0
 protected ZipVirtualPath(ZipFileSystem fs, string path)
 {
     m_fs        = fs;
     m_path      = path;
     m_normaPath = VirtualFileExtension.NormalizePath(m_path);
 }