コード例 #1
0
        public async Task <string> GetObjectSpecificationAsHtml(string database, string project, string layer, string lcid, string target, string spec)
        {
            var tmp = await m_ComosWebOffline.GetObjectSpecificationAsHtml(database, project, layer, lcid, target, spec);

            if (tmp == null)
            {
                tmp = await m_ComosWebOnline.GetObjectSpecificationAsHtml(database, project, layer, lcid, target, spec);

                if (tmp != null)
                {
                    var    url    = m_Url + "ui/dbs/" + database + "/projects/" + project + "/objects/" + target + "/specifications/" + spec + "/html?lcid=" + lcid + "&overlayid=" + layer;
                    string output = Newtonsoft.Json.JsonConvert.SerializeObject(tmp);
                    m_Database.WriteUrlCache(url, output);
                }
            }
            return(tmp);
        }
コード例 #2
0
        //[Ignore]
        public async Task GetObjectSpecifications()
        {
            using (ComosWeb cw = GetComosWeb(true))
            {
                var layer = await cw.GetWorkingLayerByUrl("db1/projects/U:2:A3BQHFA8AR:/wl/U:42:A3WXEAM61M:/details");

                var o = await cw.GetObjectBySystemFullName(layer, "A10|A90|A30|A30| » 6/8/2017 09:08:35");

                var specs = await cw.GetObjectSpecification(layer, "1033", o.UID);

                foreach (var spec in specs)
                {
                    var html = await cw.GetObjectSpecificationAsHtml(layer, "1033", o.UID, spec.Name);

                    System.IO.File.WriteAllText("attributes." + spec.Description + ".txt", html);
                }

                var value = await cw.Logout();
            }
        }
コード例 #3
0
        public async Task <string> GetObjectSpecificationAsHtml(string database, string project, string layer, string lcid, string target, string spec)
        {
            string tmp = null;

            if (m_Platform.IsOnline)
            {
                tmp = await m_ComosWebOnline.GetObjectSpecificationAsHtml(database, project, layer, lcid, target, spec);

                if (tmp != null)
                {
                    var url = m_Url + "ui/dbs/" + database + "/projects/" + project + "/objects/" + target + "/specifications/" + spec + "/html?lcid=" + lcid + "&overlayid=" + layer;
                    m_Database.WriteUrlCache(url, tmp);
                    return(tmp);
                }
            }
            string result = await m_ComosWebOffline.GetObjectSpecificationAsHtml(database, project, layer, lcid, target, spec);

            //if (string.Compare(result, tmp) != 0)
            //{
            //    throw new Exception();
            //}
            return(result);
        }