OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 namespace NativeClientVSAddIn | 5 namespace NativeClientVSAddIn |
6 { | 6 { |
7 using System; | 7 using System; |
8 using System.Collections.Generic; | 8 using System.Collections.Generic; |
9 | 9 |
10 using EnvDTE; | 10 using EnvDTE; |
11 using EnvDTE80; | 11 using EnvDTE80; |
12 using Microsoft.VisualStudio.VCProjectEngine; | 12 using Microsoft.VisualStudio.VCProjectEngine; |
13 | 13 |
14 /// <summary> | 14 /// <summary> |
15 /// Contains helper functions for this add-in. | 15 /// Contains helper functions for this add-in. |
16 /// </summary> | 16 /// </summary> |
17 public static class Utility | 17 public static class Utility |
18 { | 18 { |
19 /// <summary> | 19 /// <summary> |
20 /// Tells us if the given project is a Visual C/C++ project. | 20 /// Tells us if the given project is a Visual C/C++ project. |
21 /// </summary> | 21 /// </summary> |
22 /// <param name="proj">Project to check.</param> | 22 /// <param name="proj">Project to check.</param> |
23 /// <returns>True if project is a Visual C/C++ project.</returns> | 23 /// <returns>True if project is a Visual C/C++ project.</returns> |
24 public static bool IsVisualCProject(Project proj) | 24 public static bool IsVisualCProject(Project proj) |
25 { | 25 { |
| 26 if (proj.Properties == null) |
| 27 { |
| 28 return false; |
| 29 } |
26 foreach (Property prop in proj.Properties) | 30 foreach (Property prop in proj.Properties) |
27 { | 31 { |
28 if (prop.Name == "Kind") | 32 if (prop.Name == "Kind") |
29 { | 33 { |
30 string projectType = prop.Value as string; | 34 string projectType = prop.Value as string; |
31 return projectType == "VCProject"; | 35 return projectType == "VCProject"; |
32 } | 36 } |
33 } | 37 } |
34 | 38 |
35 return false; | 39 return false; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 proc.ParentID, | 215 proc.ParentID, |
212 anscestor, | 216 anscestor, |
213 proc.CreationDate); | 217 proc.CreationDate); |
214 } | 218 } |
215 } | 219 } |
216 | 220 |
217 return false; | 221 return false; |
218 } | 222 } |
219 } | 223 } |
220 } | 224 } |
OLD | NEW |