Exemplo n.º 1
0
        public static Attachment CreateWithPath(string path, Page page, bool modifyPage)
        {
            string url = BuildUrl("pages/" + page.Identifier + "/attachments");

            NameValueCollection nvc = page.note.GetDefaultParamerers();
            if (modifyPage == false)
                nvc.Add("modify_page", "false");
            string resp = page.GetConsumer().Upload(url, nvc, path);
            XmlDocument xml = new XmlDocument();
            xml.LoadXml(resp);

            Attachment at = (Attachment)Deserialize(typeof(Attachment), xml.InnerXml);
            at.SetOwner(page);

            return at;
        }
Exemplo n.º 2
0
 private void SetOwner(Page page)
 {
     this.owner = page;
 }