コード例 #1
0
ファイル: HtmlTest.cs プロジェクト: BenJoyenConseil/planmyway
        static public void HtmlConstructTEST()
        {
            Element htmlFile = new Element();

            htmlFile.Tag = "html";
            Element head = new Element("head");
            head.Add(new Element("title") { Text = "Test html title" });
            Element body = new Element("body");
            body.Add(new Element("p") { Text = "<span color=\"Red\">Salut comment ça va??</span>" });
            htmlFile.Add(head);
            htmlFile.Add(body);
            try
            {
                IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();
                StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("rapport.html", FileMode.Create, file), Encoding.UTF8);
                writeFile.Write(htmlFile.ToString());
                writeFile.Flush();
            }
            catch (Exception e)
            {
            }
            EmailComposeTask emailtask = new EmailComposeTask();
            emailtask.Body = htmlFile.ToString();
            emailtask.Subject = "coucou";
            emailtask.Show();
        }
コード例 #2
0
        private void saveFile()
        {
            Element htmlFile = new Element();

            htmlFile.Tag = "html";
            Element head = new Element("head");
            head.Add(new Element("title") { Text = "Test html title" });
            Element body = new Element("body");
            body.Add(new Element("p") { Text = "<span color=\"Red\">Salut comment ça va??</span>" });
            htmlFile.Add(head);
            htmlFile.Add(body);
            try
            {
                using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication())
                using (Stream writeFile = new IsolatedStorageFileStream("rapport-PlanMyWay.xls", FileMode.Create, file))
                {
                    //writeFile.Write(htmlFile.ToString());
                    //writeFile.Flush();
                    //writeFile.Close();
                    //file.Dispose();
                    //writeFile.Dispose();

                    ExcelWriter writer = new ExcelWriter(writeFile);
                    writer.BeginWrite();
                    writer.WriteCell(0, 0, "ExcelWriter Demo");
                    writer.WriteCell(1, 0, "int");
                    writer.WriteCell(1, 1, 10);
                    writer.WriteCell(2, 0, "double");
                    writer.WriteCell(2, 1, 1.5);
                    writer.WriteCell(3, 0, "empty");
                    writer.WriteCell(3, 1);
                    writer.EndWrite();
                    writeFile.Close();
                }
            }
            catch (Exception e)
            {
            }
        }
コード例 #3
0
ファイル: Element.cs プロジェクト: BenJoyenConseil/planmyway
 public void Add(Element element)
 {
     _children.Add(element);
 }