Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: obsolete/Microsoft.VisualStudio.Project/SolutionListenerForProjectOpen.cs

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /// Copyright (c) Microsoft Corporation. All rights reserved.
2
3 using System;
4 using System.Diagnostics;
5 using Microsoft.VisualStudio;
6 using Microsoft.VisualStudio.Shell.Interop;
7 using IServiceProvider = System.IServiceProvider;
8
9 namespace Microsoft.VisualStudio.Project
10 {
11
12 [CLSCompliant(false)]
13 public class SolutionListenerForProjectOpen : SolutionListener
14 {
15 public SolutionListenerForProjectOpen(IServiceProvider servicePr ovider)
16 : base(serviceProvider)
17 {
18 }
19
20 public override int OnAfterOpenProject(IVsHierarchy hierarchy, i nt added)
21 {
22 // If this is a new project and our project. We use here that it is only our project that will implemnet the "internal" IBuildDependenc yOnProjectContainer.
23 if(added != 0 && hierarchy is IBuildDependencyUpdate)
24 {
25 IVsUIHierarchy uiHierarchy = hierarchy as IVsUIH ierarchy;
26 Debug.Assert(uiHierarchy != null, "The ProjectNo de should implement IVsUIHierarchy");
27 // Expand and select project node
28 IVsUIHierarchyWindow uiWindow = UIHierarchyUtili ties.GetUIHierarchyWindow(this.ServiceProvider, HierarchyNode.SolutionExplorer);
29 if(uiWindow != null)
30 {
31 __VSHIERARCHYITEMSTATE state;
32 uint stateAsInt;
33 if(uiWindow.GetItemState(uiHierarchy, VS Constants.VSITEMID_ROOT, (uint)__VSHIERARCHYITEMSTATE.HIS_Expanded, out stateAsI nt) == VSConstants.S_OK)
34 {
35 state = (__VSHIERARCHYITEMSTATE) stateAsInt;
36 if(state != __VSHIERARCHYITEMSTA TE.HIS_Expanded)
37 {
38 int hr;
39 hr = uiWindow.ExpandItem (uiHierarchy, VSConstants.VSITEMID_ROOT, EXPANDFLAGS.EXPF_ExpandParentsToShowIte m);
40 if(ErrorHandler.Failed(h r))
41 Trace.WriteLine( "Failed to expand project node");
42 hr = uiWindow.ExpandItem (uiHierarchy, VSConstants.VSITEMID_ROOT, EXPANDFLAGS.EXPF_SelectItem);
43 if(ErrorHandler.Failed(h r))
44 Trace.WriteLine( "Failed to select project node");
45
46 return hr;
47 }
48 }
49 }
50 }
51 return VSConstants.S_OK;
52 }
53
54 /// <summary>
55 /// Called at load time when solution has finished opening.
56 /// The ProjectLoadDialogState is set to Show again for unsafe p rojects
57 /// that are added to the solution after an eventually safe proj ect has cleaned it.
58 /// </summary>
59 /// <param name="reserved">reserved</param>
60 /// <param name="isSolution">true if this is a new solution</par am>
61 /// <returns>Success or a filure code.</returns>
62 public override int OnAfterOpenSolution(object reserved, int isS olution)
63 {
64 // Once the solution is open, throw away any saved dialo g responses so that if the
65 // user now does an Add Existing Project (on an insecure project), he should see the
66 // security warning dialog again. Unchecking the "Ask m e always" checkbox only
67 // applies to the loading of the solution. Subsequent p roject loads show the dialog again.
68 Utilities.SaveDialogStateInSolution(this.ServiceProvider , _ProjectLoadSecurityDialogState.PLSDS_ShowAgain);
69
70 return VSConstants.S_OK;
71 }
72
73 }
74 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698