public ResourceModifier(string uri, GetToken token, string acceptHeader, HuddleResourceObject modifiedItem) { _pathManager = new PathManager(uri); _token = token; _acceptHeader = acceptHeader; _body = SerializeToXml(modifiedItem); }
protected override void ProcessRecord() { var item = new HuddleResourceObject {Title = Title, Description = Desc}; WriteObject(item); base.ProcessRecord(); }
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(); } }
private string SerializeToXml(HuddleResourceObject modifiedItem) { return JsonConvert.SerializeObject(modifiedItem); }