/// <summary>
 /// Initializes a new instance of the <see cref="LastWriteFileChangeMonitor"/> class.
 /// </summary>
 /// <param name="package"></param>
 /// <param name="importsMonitor">An instance of <see cref="ImportsMonitor"/> that reports files to monitor</param>
 public LastWriteFileChangeMonitor(ApprenticePackage package, ImportsMonitor importsMonitor)
 {
     this.package        = Requires.NotNull(package, nameof(package));
     this.asp            = Requires.NotNull((IAsyncServiceProvider)package, nameof(package));
     this.importsMonitor = Requires.NotNull(importsMonitor, nameof(importsMonitor));
     this.cookies        = new List <uint>();
     this.importsMonitor.ImportsChanged += this.ImportsMonitor_ImportsChanged;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImportsHierarchyNodeManager"/> class.
 /// </summary>
 /// <param name="package">The package instance</param>
 /// <param name="importsMonitor">An instance of <see cref="ImportsMonitor"/></param>
 /// <param name="solutionMonitor">An instance of <see cref="SolutionMonitor"/></param>
 public ImportsHierarchyNodeManager(ApprenticePackage package, ImportsMonitor importsMonitor, SolutionMonitor solutionMonitor)
 {
     this.importsMonitor  = Requires.NotNull(importsMonitor, nameof(importsMonitor));
     this.solutionMonitor = Requires.NotNull(solutionMonitor, nameof(solutionMonitor));
     this.package         = Requires.NotNull(package, nameof(package));
     this.sp = Requires.NotNull((IServiceProvider)package, nameof(package));
     this.importsMonitor.ImportsChanged   += this.ImportsMonitor_ImportsChanged;
     this.solutionMonitor.SolutionClosing += this.SolutionMonitor_SolutionClosing;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ImportsHierarchyNode"/> class.
        /// </summary>
        /// <param name="package">The root package</param>
        public ImportsHierarchyNode(ApprenticePackage package)
        {
            Requires.NotNull(package, nameof(package));
            this.asp = package;
            this.sp  = package;
            this.ssp = package;

            this.lastItemId = this.firstItemId;

            this.rootPropertyMap = new Dictionary <int, object>
            {
                { (int)__VSHPROPID.VSHPROPID_Caption, "Watched Imports" },
                { (int)__VSHPROPID.VSHPROPID_Expandable, true },
                { (int)__VSHPROPID.VSHPROPID_ExpandByDefault, false },
                { (int)__VSHPROPID.VSHPROPID_Expanded, false },
                { (int)__VSHPROPID.VSHPROPID_FirstChild, this.firstItemId },
                { (int)__VSHPROPID.VSHPROPID_HandlesOwnReload, true },
                { (int)__VSHPROPID.VSHPROPID_IconIndex, 2 },
                { (int)__VSHPROPID.VSHPROPID_Name, "Watched Imports Name" },
                { (int)__VSHPROPID.VSHPROPID_OpenFolderIconIndex, 3 },
                { (int)__VSHPROPID.VSHPROPID_Parent, VSConstants.VSITEMID.Nil },
                { (int)__VSHPROPID.VSHPROPID_StateIconIndex, VsStateIcon.STATEICON_READONLY },
                { (int)__VSHPROPID.VSHPROPID_TypeGuid, WatchedImportType },
                { (int)__VSHPROPID.VSHPROPID_TypeName, nameof(WatchedImportType) },
                { (int)__VSHPROPID8.VSHPROPID_SupportsIconMonikers, true },
                { (int)__VSHPROPID8.VSHPROPID_IconMonikerGuid, ImageCatalogGuid },
                { (int)__VSHPROPID8.VSHPROPID_IconMonikerId, FolderInformation },
                { (int)__VSHPROPID8.VSHPROPID_OpenFolderIconMonikerGuid, ImageCatalogGuid },
                { (int)__VSHPROPID8.VSHPROPID_OpenFolderIconMonikerId, FolderInformation }
            };

            this.itemPropertyMap = new Dictionary <int, object>
            {
                { (int)__VSHPROPID.VSHPROPID_Expandable, false },
                { (int)__VSHPROPID.VSHPROPID_ExpandByDefault, false },
                { (int)__VSHPROPID.VSHPROPID_Expanded, false },
                { (int)__VSHPROPID.VSHPROPID_HandlesOwnReload, true },
                { (int)__VSHPROPID.VSHPROPID_Parent, VSConstants.VSITEMID.Root },
                { (int)__VSHPROPID.VSHPROPID_StateIconIndex, VsStateIcon.STATEICON_BLANK },
                { (int)__VSHPROPID.VSHPROPID_TypeGuid, WatchedImportType },
                { (int)__VSHPROPID.VSHPROPID_TypeName, nameof(WatchedImportType) },
                { (int)__VSHPROPID5.VSHPROPID_ProvisionalViewingStatus, __VSPROVISIONALVIEWINGSTATUS.PVS_Enabled }
            };

            this.idPathMap     = new ConcurrentDictionary <uint, string>();
            this.cookieSinkMap = new Dictionary <uint, IVsHierarchyEvents>();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="Feature"/> class.
 /// </summary>
 /// <param name="package">The package instance</param>
 /// <param name="optionsPage">The common options page</param>
 public Feature(ApprenticePackage package, Common.OptionsDialogPage optionsPage)
 {
     this.package     = Requires.NotNull(package, nameof(package));
     this.optionsPage = Requires.NotNull(optionsPage, nameof(optionsPage));
     this.optionsPage.PropertyChanged += this.OptionsPage_PropertyChanged;
 }
 public SolutionMonitor(ApprenticePackage package)
 {
     this.package = Requires.NotNull(package, nameof(package));
     this.asp     = Requires.NotNull((IAsyncServiceProvider)package, nameof(package));
 }