Exemplo n.º 1
0
        public async Task GetLayers()
        {
            using (ComosWeb cw = GetComosWeb(true))
            {
                var tdb = cw.GetDatabases();
                var db  = tdb.Result.Databases.FirstOrDefault();
                Assert.IsTrue(db != null);
                var      tproj   = cw.GetProjects(db);
                CProject project = null;
                foreach (var proj in tproj.Result)
                {
                    if (proj.Name == "iDB_P01")
                    {
                        project = proj;
                        break;
                    }
                }

                var layers = cw.GetWorkingOverlays(project);
                foreach (var layer in layers.Result)
                {
                    Console.WriteLine(string.Format("ClassType = {0}", layer.ClassType));
                    Console.WriteLine(string.Format("Description = {0}", layer.Description));
                    Console.WriteLine(string.Format("IsClientPicture = {0}", layer.IsClientPicture));
                    Console.WriteLine(string.Format("Name = {0}", layer.Name));
                    Console.WriteLine(string.Format("OverlayUID = {0}", layer.OverlayUID));
                    Console.WriteLine(string.Format("Picture = {0}", layer.Picture));
                    Console.WriteLine(string.Format("ProjectUID = {0}", layer.ProjectUID));
                    Console.WriteLine(string.Format("SystemFullName = {0}", layer.SystemFullName));
                    Console.WriteLine(string.Format("UID = {0}", layer.UID));
                }
                var value = await cw.Logout();
            }
        }
Exemplo n.º 2
0
 public void GetProjects()
 {
     Task.Run(async() =>
     {
         using (ComosWeb cw = GetComosWeb(true))
         {
             var tdb = cw.GetDatabases();
             var db  = tdb.Result.Databases.FirstOrDefault();
             Assert.IsTrue(db != null);
             var tproj = cw.GetProjects(db);
             foreach (var project in tproj.Result)
             {
                 Console.WriteLine(string.Format("ClassType = {0}", project.ClassType));
                 Console.WriteLine(string.Format("Description = {0}", project.Description));
                 Console.WriteLine(string.Format("IsClientPicture = {0}", project.IsClientPicture));
                 Console.WriteLine(string.Format("Name = {0}", project.Name));
                 Console.WriteLine(string.Format("OverlayUID = {0}", project.OverlayUID));
                 Console.WriteLine(string.Format("Picture = {0}", project.Picture));
                 Console.WriteLine(string.Format("ProjectUID = {0}", project.ProjectUID));
                 Console.WriteLine(string.Format("SystemFullName = {0}", project.SystemFullName));
                 Console.WriteLine(string.Format("UID = {0}", project.UID));
             }
             var value = await cw.Logout();
         }
     }).Wait();
 }
Exemplo n.º 3
0
        public async Task <CInfo> GetDatabases()
        {
            if (m_Platform.IsOnline)
            {
                var tmp = await m_ComosWebOnline.GetDatabases();

                if (tmp != null)
                {
                    var    url    = m_Url + "dbs";
                    string output = Newtonsoft.Json.JsonConvert.SerializeObject(tmp);
                    m_Database.WriteUrlCache(url, output);
                    return(tmp);
                }
            }
            return(await m_ComosWebOffline.GetDatabases());
        }
Exemplo n.º 4
0
        public void GetDatabases()
        {
            ComosWeb cw   = GetComosWeb();
            var      task = cw.GetDatabases();

            Console.WriteLine("Databases");
            foreach (var databases in task.Result.Databases)
            {
                Console.WriteLine("\t" + databases.Key + " " + databases.Name);
            }
            Console.WriteLine("Languages");
            foreach (var languages in task.Result.Languages)
            {
                Console.WriteLine("\t" + languages.Key + " " + languages.LCID + " " + languages.Value);
            }
        }