Esempio n. 1
0
 public ResourceModifier(string uri, GetToken token, string acceptHeader, HuddleResourceObject modifiedItem)
 {
     _pathManager = new PathManager(uri);
     _token = token;
     _acceptHeader = acceptHeader;
     _body = SerializeToXml(modifiedItem);
 }
Esempio n. 2
0
        protected override void ProcessRecord()
        {
            var item = new HuddleResourceObject();
            item.Title = Title;
            item.Description = Desc;

            WriteObject(item);

            base.ProcessRecord();
        }
Esempio n. 3
0
        private string SerializeToXml(HuddleResourceObject modifiedItem)
        {
            XmlSerializer serializer = new XmlSerializer(typeof (Object));

            if (_type == "folder")
            {
                serializer = new XmlSerializer(typeof (Folder));
            }
            else if (_type == "workspace")
            {
                serializer = new XmlSerializer(typeof (Workspace));
            }
            else if (_type == "document")
            {
                serializer = new XmlSerializer(typeof (Document));
            }

            using (var writer = new StringWriter())
            {
                serializer.Serialize(writer, modifiedItem);
                return writer.ToString();
            }
        }
Esempio n. 4
0
 private string SerializeToXml(HuddleResourceObject modifiedItem)
 {
     return JsonConvert.SerializeObject(modifiedItem);
 }