예제 #1
0
 public ResourceModifier(string uri, GetToken token, string acceptHeader, HuddleResourceObject modifiedItem)
 {
     _pathManager = new PathManager(uri);
     _token = token;
     _acceptHeader = acceptHeader;
     _body = SerializeToXml(modifiedItem);
 }
예제 #2
0
파일: newObject.cs 프로젝트: Huddle/Puddle
        protected override void ProcessRecord()
        {
            var item = new HuddleResourceObject();
            item.Title = Title;
            item.Description = Desc;

            WriteObject(item);

            base.ProcessRecord();
        }
예제 #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();
            }
        }
예제 #4
0
 private string SerializeToXml(HuddleResourceObject modifiedItem)
 {
     return JsonConvert.SerializeObject(modifiedItem);
 }