private void GenerateProduction(Library.Project f, string destinationDirectory)
 {
     ConfigDirectories.AddProductionFolder(f.Title, "", destinationDirectory);
     foreach (Page p in f.Pages)
     {
         OutputHTML html = p.GenerateProduction();
         ConfigDirectories.AddProductionFolder(f.Title, p.Folder, destinationDirectory);
         FileStream fs = new FileStream(Path.Combine(destinationDirectory,
                                                     ConfigDirectories.RemoveLeadSlash(p.Folder),
                                                     ConfigDirectories.RemoveLeadSlash(p.Name)),
                                        FileMode.Create);
         StreamWriter sw = new StreamWriter(fs);
         sw.WriteLine(html.HTML.ToString());
         sw.Close();
         sw.Dispose();
         fs.Close();
         fs.Dispose();
     }
     foreach (Library.File s in f.Files)
     {
         ConfigDirectories.AddProductionFile(f.Title,
                                             Path.Combine(s.Folder, s.FileName),
                                             Path.Combine(ConfigDirectories.GetBuildFolder(f.Title), s.Folder, s.FileName), destinationDirectory);
     }
 }
Exemple #2
0
 private void ReloadBrowser(bool firstLoad = false)
 {
     try
     {
         string fileName = Path.Combine(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title),
                                        ConfigDirectories.RemoveLeadSlash(this.Page.Folder),
                                        ConfigDirectories.RemoveLeadSlash(this.Page.Name));
         string ehdash = Path.Combine(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title),
                                      ConfigDirectories.RemoveLeadSlash(this.Page.Folder),
                                      "ehd_ask.png");
         Library.OutputHTML html = this.Page.GenerateDesign();
         if (!String.IsNullOrEmpty(this.Page.Folder))
         {
             ConfigDirectories.AddFile(Library.Project.CurrentProject.Title,
                                       ehdash,
                                       ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title) + "ehd_ask.png");
         }
         FileStream   fs = new FileStream(fileName, FileMode.Create);
         StreamWriter sw = new StreamWriter(fs);
         sw.WriteLine(html.HTML.ToString());
         sw.Close();
         sw.Dispose();
         fs.Close();
         fs.Dispose();
         this.webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
         this.webBrowser1.Navigate(fileName);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
        private void btnBrowseImage_Click(object sender, EventArgs e)
        {
            FileImport   fi = new FileImport();
            DialogResult dr = fi.ShowDialog();

            if (dr == DialogResult.OK)
            {
                ConfigDirectories.AddFile(Library.Project.CurrentProject.Title,
                                          Path.Combine(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title),
                                                       fi.path.Text),
                                          fi.FileNames[0]);
                Library.Project.Save(Library.Project.CurrentProject, ConfigDirectories.GetDocumentsFolder(), AppDomain.CurrentDomain.GetData("fileName").ToString());
                Library.Project.CurrentProject.ReloadProject();
                this.pic.ImageLocation = fi.FileNames[0];
                int index = this.cmbFiles.Items.Add(fi.path.Text);
                this.cmbFiles.Text = fi.path.Text;
            }
        }
Exemple #4
0
 public void PrepareImage()
 {
     try
     {
         Library.OutputHTML html = this.mPage.GenerateThumbnail();
         FileStream         fs   = new FileStream(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title) + this.mPage.Name + ".html", FileMode.Create);
         StreamWriter       sw   = new StreamWriter(fs);
         sw.WriteLine(html.HTML.ToString());
         sw.Close();
         sw.Dispose();
         fs.Close();
         fs.Dispose();
         this.webBrowser1.Navigate(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title) + this.mPage.Name + ".html");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Exemple #5
0
 private void ReloadBrowser(bool firstLoad = false)
 {
     try
     {
         Library.OutputHTML html = this.HTMLObject.GenerateDesign();
         FileStream         fs   = new FileStream(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title) + this.HTMLObject.Name + ".html", FileMode.Create);
         StreamWriter       sw   = new StreamWriter(fs);
         sw.WriteLine(html.HTML.ToString());
         sw.Close();
         sw.Dispose();
         fs.Close();
         fs.Dispose();
         this.webBrowser1.Navigate(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title) + this.HTMLObject.Name + ".html");
         this.textBox4.Text = this.HTMLObject.CSSOutput(false);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 private void ReloadBrowser(bool firstLoad = false)
 {
     try
     {
         string             fileName = Path.Combine(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title), "horiz.html");
         Library.OutputHTML html     = (this.bsHoriz.Current as Library.HorizontalZone).GenerateDesign();
         FileStream         fs       = new FileStream(fileName, FileMode.Create);
         StreamWriter       sw       = new StreamWriter(fs);
         sw.WriteLine(html.HTML.ToString());
         sw.Close();
         sw.Dispose();
         fs.Close();
         fs.Dispose();
         this.webBrowser1.Navigate(fileName);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 private void ToolView_Load(object sender, EventArgs e)
 {
     Library.MasterObject mo = Library.Project.CurrentProject.MasterObjects.Find(a => { return(a.Name == this.HTMLObject.MasterObjectName); });
     if (mo != null)
     {
         this.textBox2.Text = mo.Title;
     }
     try
     {
         Library.OutputHTML html = this.HTMLObject.GenerateDesign();
         FileStream         fs   = new FileStream(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title) + this.HTMLObject.Name + ".html", FileMode.Create);
         StreamWriter       sw   = new StreamWriter(fs);
         sw.WriteLine(html.HTML.ToString());
         sw.Close();
         sw.Dispose();
         fs.Close();
         fs.Dispose();
         this.webBrowser1.Navigate(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title) + this.HTMLObject.Name + ".html");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 private void cmbFiles_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.pic.ImageLocation = ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title, ConfigDirectories.RemoveLeadSlash(this.cmbFiles.Text));
 }