Exemplo n.º 1
0
        public async Task <CSystemObject> GetObject(string db, string projectuid, string layeruid, string uid, string lcid = "")
        {
            var content = await communicationManager.GetObject(m_Url, db, projectuid, uid, lcid, layeruid, m_Session.Id, serverName);

            if (content == null)
            {
                return(null);
            }
            JObject json = JObject.Parse(content);

            if (json == null)
            {
                return(await Task.FromResult <CSystemObject>(null));
            }

            CSystemObject result = new CSystemObject();

            result = JsonConvert.DeserializeObject <CSystemObject>(json.ToString());

            var doctypejson = json.SelectToken("DocumentType");

            if (doctypejson != null)
            {
                result.DocumentType = new CDocumentType();
                result.DocumentType = JsonConvert.DeserializeObject <CDocumentType>(doctypejson.ToString());
            }
            return(result);
        }