Example #1
0
        private void ProfileProjectTarget(SessionNode session, ProjectTarget projectTarget, bool openReport)
        {
            var targetGuid = projectTarget.TargetProject;

            var dte = (EnvDTE.DTE)GetService(typeof(EnvDTE.DTE));

            EnvDTE.Project projectToProfile = null;
            foreach (EnvDTE.Project project in dte.Solution.Projects)
            {
                var kind = project.Kind;

                if (String.Equals(kind, PythonProfilingPackage.PythonProjectGuid, StringComparison.OrdinalIgnoreCase))
                {
                    var guid = project.Properties.Item("Guid").Value as string;

                    Guid guidVal;
                    if (Guid.TryParse(guid, out guidVal) && guidVal == projectTarget.TargetProject)
                    {
                        projectToProfile = project;
                        break;
                    }
                }
            }

            if (projectToProfile != null)
            {
                ProfileProject(session, projectToProfile, openReport);
            }
            else
            {
                MessageBox.Show("Project could not be found in current solution.", "Python Tools for Visual Studio");
            }
        }
Example #2
0
        internal ProjectTarget Clone()
        {
            var res = new ProjectTarget();

            res.TargetProject = TargetProject;
            res.FriendlyName  = FriendlyName;
            return(res);
        }
Example #3
0
        private void UpdateProjectSetting()
        {
            var target = new ProjectTarget();

            target.TargetProject  = Projects[_project.SelectedIndex].Guid;
            target.FriendlyName   = Projects[_project.SelectedIndex].Name;
            _target.ProjectTarget = target;
        }
Example #4
0
 internal static bool IsSame(ProjectTarget self, ProjectTarget other)
 {
     if (self == null)
     {
         return(other == null);
     }
     else if (other != null)
     {
         return(self.TargetProject == other.TargetProject);
     }
     return(false);
 }
Example #5
0
 internal static bool IsSame(ProfilingTarget self, ProfilingTarget other)
 {
     if (self == null)
     {
         return(other == null);
     }
     else if (other != null)
     {
         return(ProjectTarget.IsSame(self.ProjectTarget, other.ProjectTarget) &&
                StandaloneTarget.IsSame(self.StandaloneTarget, other.StandaloneTarget));
     }
     return(false);
 }
Example #6
0
        private void ProfileProjectTarget(SessionNode session, ProjectTarget projectTarget, bool openReport)
        {
            var project = Solution.EnumerateLoadedPythonProjects()
                          .SingleOrDefault(p => p.GetProjectIDGuidProperty() == projectTarget.TargetProject);

            if (project != null)
            {
                ProfileProject(session, project, openReport);
            }
            else
            {
                MessageBox.Show(Strings.ProjectNotFoundInSolution, Strings.ProductTitle);
            }
        }
Example #7
0
        internal ProfilingTarget Clone()
        {
            var res = new ProfilingTarget();

            if (ProjectTarget != null)
            {
                res.ProjectTarget = ProjectTarget.Clone();
            }

            if (StandaloneTarget != null)
            {
                res.StandaloneTarget = StandaloneTarget.Clone();
            }

            if (Reports != null)
            {
                res.Reports = Reports.Clone();
            }

            return(res);
        }
Example #8
0
 /// <summary>
 /// Create a ProjectTargetView with values from a ProjectTarget.
 /// </summary>
 public ProjectTargetView(ProjectTarget project)
 {
     _name = project.FriendlyName;
     _guid = project.TargetProject;
 }
Example #9
0
 /// <summary>
 /// Create a ProjectTargetView with values from a ProjectTarget.
 /// </summary>
 public ProjectTargetView(ProjectTarget project) {
     _name = project.FriendlyName;
     _guid = project.TargetProject;
 }
Example #10
0
        private void ProfileProjectTarget(SessionNode session, ProjectTarget projectTarget, bool openReport) {
            var targetGuid = projectTarget.TargetProject;

            var dte = (EnvDTE.DTE)GetService(typeof(EnvDTE.DTE));
            EnvDTE.Project projectToProfile = null;
            foreach (EnvDTE.Project project in dte.Solution.Projects) {
                var kind = project.Kind;

                if (String.Equals(kind, PythonProfilingPackage.PythonProjectGuid, StringComparison.OrdinalIgnoreCase)) {
                    var guid = project.Properties.Item("Guid").Value as string;

                    Guid guidVal;
                    if (Guid.TryParse(guid, out guidVal) && guidVal == projectTarget.TargetProject) {
                        projectToProfile = project;
                        break;
                    }
                }
            }

            if (projectToProfile != null) {
                ProfileProject(session, projectToProfile, openReport);
            } else {
                MessageBox.Show("Project could not be found in current solution.", Strings.ProductTitle);
            }
        }
Example #11
0
 internal static bool IsSame(ProjectTarget self, ProjectTarget other) {
     if (self == null) {
         return other == null;
     } else if (other != null) {
         return self.TargetProject == other.TargetProject;
     }
     return false;
 }
Example #12
0
 internal ProjectTarget Clone() {
     var res = new ProjectTarget();
     res.TargetProject = TargetProject;
     res.FriendlyName = FriendlyName;
     return res;
 }