Exemplo n.º 1
0
        /// <summary>
        /// 获取当前工程版本的递归父级对象
        /// </summary>
        /// <param name="project"></param>
        private void GetProjectVersionParents(M_ProjectVersionClass version)
        {
            if (this.currentSolutionCollection != null &&
                this.currentSolutionCollection.SolutionsCollection != null &&
                this.currentSolutionCollection.SolutionsCollection.Count > 0)
            {
                foreach (M_SolutionClass s in this.currentSolutionCollection.SolutionsCollection)
                {
                    if (s != null &&
                        s.SolutionProjectsCollection != null &&
                        s.SolutionProjectsCollection.Count > 0)
                    {
                        foreach (M_ProjectClass p in s.SolutionProjectsCollection)
                        {
                            if (p != null &&
                                p.ProjectVersionCollection != null &&
                                p.ProjectVersionCollection.Count > 0)
                            {
                                foreach (M_ProjectVersionClass v in p.ProjectVersionCollection)
                                {
                                    if (v.Equals(version))
                                    {
                                        this.currentSolution = s;
                                        this.currentProject  = p;
                                        this.currentVersion  = v;

                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void TreeView_Selected(object sender, RoutedEventArgs e)
        {
            TreeView tree = sender as TreeView;

            if (tree != null)
            {
                TreeViewItem ti = e.OriginalSource as TreeViewItem;

                if (ti != null)
                {
                    ti.IsExpanded = !ti.IsExpanded;
                }

                M_SolutionClass s = tree.SelectedItem as M_SolutionClass;

                if (s != null)
                {
                    GetSolutionParents(s);

                    SetTextBoxBindings();
                }
                else
                {
                    M_ProjectClass p = tree.SelectedItem as M_ProjectClass;

                    if (p != null)
                    {
                        GetProjectParents(p);

                        SetTextBoxBindings();

                        //this.currentProjectItem = ti;
                    }
                    else
                    {
                        M_ProjectVersionClass v = tree.SelectedItem as M_ProjectVersionClass;

                        if (v != null)
                        {
                            GetProjectVersionParents(v);

                            SetTextBoxBindings();
                        }
                    }
                }
            }
        }