Esempio n. 1
0
        public ValispaceInstance(string ProjectName, TreeView projectTree)
        {
            //valispace = ValispaceAPI.Connect("https://app.valispace.com", "kuldeep", "valispace.");
            try
            {
                valispace        = WPFLogin.valispace;
                this.projectTree = projectTree;
                if (valispace == null)
                {
                    return;
                }
            }
            catch
            {
                MessageBox.Show("You are not Logged in ! ", "Warning");
            }
            var projects = valispace.getProjects();

            //var p = new List<Project>();
            foreach (var project in projects)
            {
                if ((string)project["name"] == ProjectName)
                {
                    selectedProject      = new Project();
                    selectedProject.Name = (string)project["name"];
                    selectedProject.Id   = (Int64)project["id"];
                    projLoaded           = true;
                    break;
                }
            }
            if (projLoaded)
            {
                loadProjectTree(selectedProject);
            }
            else
            {
                MessageBox.Show("Project with Selected Name doesnt Exist. Please check the project Name entered and try again!");
            }
        }
Esempio n. 2
0
        private void loadProjects()
        {
            if (valispace == null)
            {
                return;
            }

            var projects = valispace.getProjects();

            var p = new List <Project>();

            foreach (var project in projects)
            {
                var pr = new Project();
                pr.Name = (string)project["name"];
                pr.Id   = (Int64)project["id"];

                p.Add(pr);
            }

            //projectCombo.ItemsSource = p;
            //projectCombo.IsEnabled = true;
        }