forked from tunnelvisionlabs/MPFProj10
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ProjectNode.cs
7556 lines (6544 loc) · 301 KB
/
ProjectNode.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/********************************************************************************************
Copyright (c) Microsoft Corporation
All rights reserved.
Microsoft Public License:
This license governs use of the accompanying software. If you use the software, you
accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the
same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions
and limitations in section 3, each contributor grants you a non-exclusive, worldwide,
royalty-free copyright license to reproduce its contribution, prepare derivative works of
its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions
and limitations in section 3, each contributor grants you a non-exclusive, worldwide,
royalty-free license under its licensed patents to make, have made, use, sell, offer for
sale, import, and/or otherwise dispose of its contribution in the software or derivative
works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors'
name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are
infringed by the software, your patent license from such contributor to the software ends
automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent,
trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only
under this license by including a complete copy of this license with your distribution.
If you distribute any portion of the software in compiled or object code form, you may only
do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give
no express warranties, guarantees or conditions. You may have additional consumer rights
under your local laws which this license cannot change. To the extent permitted under your
local laws, the contributors exclude the implied warranties of merchantability, fitness for
a particular purpose and non-infringement.
********************************************************************************************/
namespace Microsoft.VisualStudio.Project
{
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Xml;
using EnvDTE;
using Microsoft.Build.Evaluation;
using Microsoft.Build.Execution;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using DialogResult = Microsoft.Internal.VisualStudio.PlatformUI.DialogResult;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
using IServiceProvider = System.IServiceProvider;
using MSBuild = Microsoft.Build.Evaluation;
using MSBuildConstruction = Microsoft.Build.Construction;
using MSBuildExecution = Microsoft.Build.Execution;
using OleConstants = Microsoft.VisualStudio.OLE.Interop.Constants;
using prjBuildAction = VSLangProj.prjBuildAction;
using VsCommands = Microsoft.VisualStudio.VSConstants.VSStd97CmdID;
using VsCommands2K = Microsoft.VisualStudio.VSConstants.VSStd2KCmdID;
/// <summary>
/// Manages the persistent state of the project (References, options, files, etc.) and deals with user interaction via a GUI in the form a hierarchy.
/// </summary>
[CLSCompliant(false)]
[ComVisible(true)]
public abstract partial class ProjectNode : HierarchyNode,
IVsGetCfgProvider,
IVsProject3,
IVsAggregatableProject,
IVsProjectFlavorCfgProvider,
IPersistFileFormat,
IVsProjectBuildSystem,
IVsBuildPropertyStorage,
IVsComponentUser,
IVsDependencyProvider,
IVsSccProject2,
IBuildDependencyUpdate,
IProjectEventsListener,
IProjectEventsProvider,
IReferenceContainerProvider,
IVsProjectSpecialFiles,
IVsProjectUpgrade,
IVsDesignTimeAssemblyResolution,
IVsSetTargetFrameworkWorkerCallback
{
#region constants
/// <summary>
/// The user file extension.
/// </summary>
private const string _perUserFileExtension = ".user";
#endregion
#region fields
private static readonly FrameworkName DefaultTargetFrameworkMoniker = new FrameworkName(".NETFramework", new Version(4, 0));
protected static Guid AddComponentLastActiveTab = VSConstants.GUID_SolutionPage;
protected static uint AddComponentDialogSizeX = 0;
protected static uint AddComponentDialogSizeY = 0;
/// <summary>
/// List of output groups names and their associated target
/// </summary>
private static readonly KeyValuePair<string, string>[] outputGroupNames =
{ // Name Target (MSBuild)
new KeyValuePair<string, string>("Built", "BuiltProjectOutputGroup"),
new KeyValuePair<string, string>("ContentFiles", "ContentFilesProjectOutputGroup"),
new KeyValuePair<string, string>("LocalizedResourceDlls", "SatelliteDllsProjectOutputGroup"),
new KeyValuePair<string, string>("Documentation", "DocumentationProjectOutputGroup"),
new KeyValuePair<string, string>("Symbols", "DebugSymbolsProjectOutputGroup"),
new KeyValuePair<string, string>("SourceFiles", "SourceFilesProjectOutputGroup"),
new KeyValuePair<string, string>("XmlSerializer", "SGenFilesOutputGroup"),
};
/// <summary>A project will only try to build if it can obtain a lock on this object</summary>
private static readonly object BuildLock = new object();
/// <summary>Maps integer ids to project item instances</summary>
private HierarchyNodeCollection itemIdMap;
/// <summary>A service provider call back object provided by the IDE hosting the project manager</summary>
private ServiceProvider _site;
public static ServiceProvider ServiceProvider { get; set; }
private readonly TrackDocumentsHelper tracker;
/// <summary>
/// A cached copy of project options.
/// </summary>
private ProjectOptions _options;
private bool showAllFilesEnabled;
/// <summary>
/// This property returns the time of the last change made to this project.
/// It is not the time of the last change on the project file, but actually of
/// the in memory project settings. In other words, it is the last time that
/// SetProjectDirty was called.
/// </summary>
private DateTime lastModifiedTime;
/// <summary>
/// MSBuild engine we are going to use
/// </summary>
private MSBuild.ProjectCollection buildEngine;
private Microsoft.Build.Utilities.Logger buildLogger;
private bool useProvidedLogger;
private MSBuild.Project buildProject;
private MSBuild.Project _userBuildProject;
private MSBuildExecution.ProjectInstance currentConfig;
private DesignTimeAssemblyResolution designTimeAssemblyResolution;
private bool designTimeAssemblyResolutionFailed;
private ConfigProvider configProvider;
private TaskProvider taskProvider;
private string _filename;
private Microsoft.VisualStudio.Shell.Url baseUri;
private bool _isDirty;
private bool isNewProject;
private bool projectOpened;
private bool buildIsPrepared;
private ImageHandler imageHandler;
private string errorString;
private string warningString;
private Guid projectIdGuid;
private bool isClosed;
private SuppressEvents eventTriggeringFlag = SuppressEvents.None;
private bool invokeMSBuildWhenResumed;
private uint suspendMSBuildCounter;
private bool canFileNodesHaveChilds;
private bool isProjectEventsListener = true;
/// <summary>
/// The build dependency list passed to IVsDependencyProvider::EnumDependencies
/// </summary>
private List<IVsBuildDependency> buildDependencyList = new List<IVsBuildDependency>();
/// <summary>
/// Defines if Project System supports Project Designer
/// </summary>
private bool supportsProjectDesigner;
private bool showProjectInSolutionPage = true;
private bool buildInProcess;
/// <summary>
/// Field for determining whether sourcecontrol should be disabled.
/// </summary>
private bool disableScc;
private string _sccProjectName;
private string _sccLocalPath;
private string _sccAuxPath;
private string _sccProvider;
/// <summary>
/// Flag for controling how many times we register with the Scc manager.
/// </summary>
private bool isRegisteredWithScc;
/// <summary>
/// Flag for controling query edit should communicate with the scc manager.
/// </summary>
private bool disableQueryEdit;
/// <summary>
/// Control if command with potential destructive behavior such as delete should
/// be enabled for nodes of this project.
/// </summary>
private bool canProjectDeleteItems;
/// <summary>
/// Token processor used by the project sample.
/// </summary>
private TokenProcessor tokenProcessor;
/// <summary>
/// Member to store output base relative path. Used by OutputBaseRelativePath property
/// </summary>
private string outputBaseRelativePath = "bin";
private IProjectEvents projectEventsProvider;
/// <summary>
/// Used for flavoring to hold the XML fragments
/// </summary>
private XmlDocument xmlFragments;
/// <summary>
/// Used to map types to CATID. This provide a generic way for us to do this
/// and make it simpler for a project to provide it's CATIDs for the different type of objects
/// for which it wants to support extensibility. This also enables us to have multiple
/// type mapping to the same CATID if we choose to.
/// </summary>
private Dictionary<Type, Guid> catidMapping = new Dictionary<Type, Guid>();
/// <summary>
/// The internal package implementation.
/// </summary>
private readonly ProjectPackage package;
// Has the object been disposed.
private bool isDisposed;
private readonly List<KeyValuePair<string, prjBuildAction>> _availableFileBuildActions = new List<KeyValuePair<string, prjBuildAction>>();
#endregion
#region abstract properties
/// <summary>
/// This Guid must match the Guid you registered under
/// HKLM\Software\Microsoft\VisualStudio\%version%\Projects.
/// Among other things, the Project framework uses this
/// guid to find your project and item templates.
/// </summary>
public abstract Guid ProjectGuid
{
get;
}
/// <summary>
/// Returns a caption for VSHPROPID_TypeName.
/// </summary>
/// <returns></returns>
public abstract string ProjectType
{
get;
}
#endregion
#region virtual properties
/// <summary>
/// This is the project instance guid that is peristed in the project file
/// </summary>
[System.ComponentModel.BrowsableAttribute(false)]
public virtual Guid ProjectIdGuid
{
get
{
return this.projectIdGuid;
}
set
{
if (this.projectIdGuid != value)
{
this.projectIdGuid = value;
if (this.buildProject != null)
{
this.SetProjectProperty("ProjectGuid", _PersistStorageType.PST_PROJECT_FILE, this.projectIdGuid.ToString("B"));
}
}
}
}
#endregion
#region properties
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public ReadOnlyCollection<KeyValuePair<string, prjBuildAction>> AvailableFileBuildActions
{
get
{
return _availableFileBuildActions.AsReadOnly();
}
}
#region overridden properties
public override int MenuCommandId
{
get
{
return VsMenus.IDM_VS_CTXT_PROJNODE;
}
}
public override string Url
{
get
{
return this.GetMKDocument();
}
}
public override bool CanCacheCanonicalName
{
get
{
return true;
}
}
public override string Caption
{
get
{
// Default to file name
string caption = this.buildProject.FullPath;
if (String.IsNullOrEmpty(caption))
{
if (this.buildProject.GetProperty(ProjectFileConstants.Name) != null)
{
caption = this.buildProject.GetProperty(ProjectFileConstants.Name).EvaluatedValue;
if (caption == null || caption.Length == 0)
{
caption = this.ItemNode.GetMetadata(ProjectFileConstants.Include);
}
}
}
else
{
caption = Path.GetFileNameWithoutExtension(caption);
}
return caption;
}
}
public override Guid ItemTypeGuid
{
get
{
return this.ProjectGuid;
}
}
public override int ImageIndex
{
get
{
return (int)ImageName.Application;
}
}
#endregion
#region virtual properties
public virtual string ErrorString
{
get
{
if (this.errorString == null)
{
this.errorString = SR.GetString(SR.Error, CultureInfo.CurrentUICulture);
}
return this.errorString;
}
}
public virtual string WarningString
{
get
{
if (this.warningString == null)
{
this.warningString = SR.GetString(SR.Warning, CultureInfo.CurrentUICulture);
}
return this.warningString;
}
}
/// <summary>
/// The target name that will be used for evaluating the project file (i.e., pseudo-builds).
/// This target is used to trigger a build with when the project system changes.
/// Example: The language projrcts are triggering a build with the Compile target whenever
/// the project system changes.
/// </summary>
public virtual string ReevaluateProjectFileTargetName
{
get
{
return null;
}
}
/// <summary>
/// This is the object that will be returned by EnvDTE.Project.Object for this project
/// </summary>
public virtual object ProjectObject
{
get
{
return null;
}
}
/// <summary>
/// Override this property to specify when the project file is dirty.
/// </summary>
protected virtual bool IsProjectFileDirty
{
get
{
string document = this.GetMKDocument();
if (String.IsNullOrEmpty(document))
{
return this._isDirty;
}
return (this._isDirty || !File.Exists(document));
}
}
/// <summary>
/// True if the project uses the Project Designer Editor instead of the property page frame to edit project properties.
/// </summary>
protected virtual bool SupportsProjectDesigner
{
get
{
return this.supportsProjectDesigner;
}
set
{
this.supportsProjectDesigner = value;
}
}
protected virtual Guid ProjectDesignerEditor
{
get
{
return VSConstants.GUID_ProjectDesignerEditor;
}
}
/// <summary>
/// Defines the flag that supports the VSHPROPID.ShowProjInSolutionPage
/// </summary>
protected virtual bool ShowProjectInSolutionPage
{
get
{
return this.showProjectInSolutionPage;
}
set
{
this.showProjectInSolutionPage = value;
}
}
#endregion
/// <summary>
/// Gets or sets the ability of a project filenode to have child nodes (sub items).
/// Example would be C#/VB forms having resx and designer files.
/// </summary>
public bool CanFileNodesHaveChilds
{
get
{
return canFileNodesHaveChilds;
}
set
{
canFileNodesHaveChilds = value;
}
}
/// <summary>
/// Get and set the Token processor.
/// </summary>
public TokenProcessor FileTemplateProcessor
{
get
{
if (tokenProcessor == null)
tokenProcessor = new TokenProcessor();
return tokenProcessor;
}
set
{
tokenProcessor = value;
}
}
/// <summary>
/// Gets a service provider object provided by the IDE hosting the project
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")]
public IServiceProvider Site
{
get
{
return this._site;
}
}
/// <summary>
/// Gets an ImageHandler for the project node.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public ImageHandler ImageHandler
{
get
{
if (null == imageHandler)
{
imageHandler = new ImageHandler(typeof(ProjectNode).Assembly.GetManifestResourceStream("Microsoft.VisualStudio.Project.Resources.imagelis.bmp"));
}
return imageHandler;
}
}
/// <summary>
/// This property returns the time of the last change made to this project.
/// It is not the time of the last change on the project file, but actually of
/// the in memory project settings. In other words, it is the last time that
/// SetProjectDirty was called.
/// </summary>
public DateTime LastModifiedTime
{
get
{
return this.lastModifiedTime;
}
}
/// <summary>
/// Determines whether this project is a new project.
/// </summary>
public bool IsNewProject
{
get
{
return this.isNewProject;
}
}
/// <summary>
/// Gets the path to the folder containing the project.
/// </summary>
public string ProjectFolder
{
get
{
return Path.GetDirectoryName(this.FileName);
}
}
/// <summary>
/// Gets or sets the project filename.
/// </summary>
public string ProjectFile
{
get
{
return Path.GetFileName(this.FileName);
}
set
{
this.SetEditLabel(value);
}
}
/// <summary>
/// Gets the Base Uniform Resource Identifier (URI).
/// </summary>
public Microsoft.VisualStudio.Shell.Url BaseUri
{
get
{
if (baseUri == null && this.buildProject != null)
{
string path = System.IO.Path.GetDirectoryName(this.buildProject.FullPath);
// Uri/Url behave differently when you have trailing slash and when you dont
if (!path.EndsWith("\\", StringComparison.Ordinal) && !path.EndsWith("/", StringComparison.Ordinal))
path += "\\";
baseUri = new Url(path);
}
Debug.Assert(baseUri != null, "Base URL should not be null. Did you call BaseURI before loading the project?");
return baseUri;
}
}
/// <summary>
/// Gets whether or not the project is closed.
/// </summary>
public bool IsClosed
{
get
{
return this.isClosed;
}
}
/// <summary>
/// Gets whether or not the project is being built.
/// </summary>
public bool BuildInProgress
{
get
{
return buildInProcess;
}
}
/// <summary>
/// Gets or set the relative path to the folder containing the project ouput.
/// </summary>
public virtual string OutputBaseRelativePath
{
get
{
return this.outputBaseRelativePath;
}
set
{
if (value == null)
throw new ArgumentNullException("value");
if (string.IsNullOrEmpty("value"))
throw new ArgumentException("value cannot be null or empty");
if (Path.IsPathRooted(value))
throw new ArgumentException("Path must not be rooted.");
this.outputBaseRelativePath = value;
}
}
public FrameworkName TargetFrameworkMoniker
{
get
{
if (this._options == null)
{
GetProjectOptions();
}
if (this._options != null)
{
return this._options.TargetFrameworkMoniker ?? DefaultTargetFrameworkMoniker;
}
else
{
return DefaultTargetFrameworkMoniker;
}
}
set
{
if (this._options == null)
{
GetProjectOptions();
}
if (value == null)
{
value = DefaultTargetFrameworkMoniker;
}
if (this._options.TargetFrameworkMoniker != value)
{
this.OnTargetFrameworkMonikerChanged(this._options, this._options.TargetFrameworkMoniker, value);
}
}
}
/// <summary>
/// Version of this node as an IVsHierarchy that can be safely passed to native code from a background thread.
/// </summary>
public IVsHierarchy InteropSafeIVsHierarchy
{
get;
protected set;
}
/// <summary>
/// Version of this node as an IVsUIHierarchy that can be safely passed to native code from a background thread.
/// </summary>
public IVsUIHierarchy InteropSafeIVsUIHierarchy
{
get;
protected set;
}
/// <summary>
/// Version of this node as an IVsProject3 that can be safely passed to native code from a background thread.
/// </summary>
public IVsProject3 InteropSafeIVsProject3
{
get;
protected set;
}
/// <summary>
/// Version of this node as an IVsSccProject2 that can be safely passed to native code from a background thread.
/// </summary>
public IVsSccProject2 InteropSafeIVsSccProject2
{
get;
protected set;
}
/// <summary>
/// Version of this node as an IVsUIHierWinClipboardHelperEvents that can be safely passed to native code from a background thread.
/// </summary>
public IVsUIHierWinClipboardHelperEvents InteropSafeIVsUIHierWinClipboardHelperEvents
{
get;
protected set;
}
public IVsComponentUser InteropSafeIVsComponentUser
{
get;
protected set;
}
/// <summary>
/// Gets or sets the flag whether query edit should communicate with the scc manager.
/// </summary>
protected bool DisableQueryEdit
{
get
{
return this.disableQueryEdit;
}
set
{
this.disableQueryEdit = value;
}
}
/// <summary>
/// Gets a collection of integer ids that maps to project item instances
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public HierarchyNodeCollection ItemIdMap
{
get
{
if (this.itemIdMap == null)
this.itemIdMap = CreateHierarchyNodeCollection();
return this.itemIdMap;
}
}
/// <summary>
/// Get the helper object that track document changes.
/// </summary>
public TrackDocumentsHelper Tracker
{
get
{
return this.tracker;
}
}
/// <summary>
/// Gets or sets the build logger.
/// </summary>
protected Microsoft.Build.Utilities.Logger BuildLogger
{
get
{
return this.buildLogger;
}
set
{
this.buildLogger = value;
this.useProvidedLogger = true;
}
}
/// <summary>
/// Gets the taskprovider.
/// </summary>
protected TaskProvider TaskProvider
{
get
{
return this.taskProvider;
}
}
/// <summary>
/// Gets the project file name.
/// </summary>
protected string FileName
{
get
{
return this._filename;
}
set
{
if (this._filename == value)
return;
this._filename = value;
ItemIdMap.UpdateCanonicalName(this);
}
}
protected virtual string UserFileName
{
get
{
return FileName + PerUserFileExtension;
}
}
protected virtual string PerUserFileExtension
{
get
{
return _perUserFileExtension;
}
}
protected bool IsIdeInCommandLineMode
{
get
{
bool cmdline = false;
var shell = this._site.GetService(typeof(SVsShell)) as IVsShell;
if (shell != null)
{
object obj;
Marshal.ThrowExceptionForHR(shell.GetProperty((int)__VSSPROPID.VSSPROPID_IsInCommandLineMode, out obj));
cmdline = (bool)obj;
}
return cmdline;
}
}
/// <summary>
/// Gets the configuration provider.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public ConfigProvider ConfigProvider
{
get
{
if (this.configProvider == null)
{
this.configProvider = CreateConfigProvider();
}
return this.configProvider;
}
}
/// <summary>
/// Gets or sets whether or not source code control is disabled for this project.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Scc")]
protected bool IsSccDisabled
{
get
{
return this.disableScc;
}
set
{
this.disableScc = value;
}
}
/// <summary>
/// Gets or set whether items can be deleted for this project.
/// Enabling this feature can have the potential destructive behavior such as deleting files from disk.
/// </summary>
public virtual bool CanProjectDeleteItems
{
get
{
return canProjectDeleteItems;
}
set
{
canProjectDeleteItems = value;
}
}
/// <summary>
/// Determines whether the project was fully opened. This is set when the OnAfterOpenProject has triggered.
/// </summary>
public bool HasProjectOpened
{
get
{
return this.projectOpened;
}
}
/// <summary>
/// Gets or sets event triggering flags.
/// </summary>
public SuppressEvents EventTriggeringFlag
{
get