Exemple #1
0
 /// <include file='doc\TaskProvider.uex' path='docs/doc[@for="TaskCollection.TaskCollection"]/*' />
 public TaskCollection(TaskProvider owner)
 {
     if (null == owner)
     {
         throw new ArgumentNullException("owner");
     }
     this.owner = owner;
     this.list  = new ArrayList();
 }
Exemple #2
0
        /// <summary>
        /// Constructor.  Inititialize member data.
        /// </summary>
        public IDEBuildLogger(IVsOutputWindowPane output, TaskProvider taskProvider, IVsHierarchy hierarchy)
        {
            if(taskProvider == null)
                throw new ArgumentNullException("taskProvider");
            if(hierarchy == null)
                throw new ArgumentNullException("hierarchy");

            this.taskProvider = taskProvider;
            this.outputWindowPane = output;
            this.hierarchy = hierarchy;
            IOleServiceProvider site;
            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hierarchy.GetSite(out site));
            this.serviceProvider = new ServiceProvider(site);
        }
Exemple #3
0
        /// <summary>
        /// Constructor.  Inititialize member data.
        /// </summary>
        public IDEBuildLogger(IVsOutputWindowPane output, TaskProvider taskProvider, IVsHierarchy hierarchy)
        {
            if (taskProvider == null)
                throw new ArgumentNullException("taskProvider");
            if (hierarchy == null)
                throw new ArgumentNullException("hierarchy");

            Trace.WriteLineIf(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA, "WARNING: IDEBuildLogger constructor running on the wrong thread.");

            IOleServiceProvider site;
            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hierarchy.GetSite(out site));

            this.taskProvider = taskProvider;
            this.outputWindowPane = output;
            this.hierarchy = hierarchy;
            this.serviceProvider = new ServiceProvider(site);
            this.dispatcher = Dispatcher.CurrentDispatcher;
        }
Exemple #4
0
        /// <summary>
        /// If the file has been renamed then do some cleanup.
        /// </summary>
        public void CheckForRename()
        {
            var currentFilename = this.GetFilePath();
            if (this.originalFileName != currentFilename)
            {
                TaskReporter tr = this.GetTaskReporter();
                tr.ClearBackgroundTasksForFile(originalFileName);

                // Refresh the task list
                tr.OutputTaskList();

                this.originalFileName = null;

                if (this.taskProvider != null)
                {
                    this.taskProvider = null;
                }
                if (this.taskReporter != null)
                {
                    this.taskReporter.Dispose();
                    this.taskReporter = null;
                }

                this.RecordChangeToView();
            }
        }
Exemple #5
0
        // Overriden in source.fs, it calls this base implementation
        public virtual void Dispose()
        {
#if LANGTRACE
            Trace.WriteLine("Source::Cleanup");
#endif
            this.disposed = true;
            try
            {
                if (this.textLinesEvents != null)
                {
                    this.textLinesEvents.Dispose();
                    this.textLinesEvents = null;
                }
            }
            finally
            {
                try
                {
                    if (this.userDataEvents != null)
                    {
                        this.userDataEvents.Dispose();
                        this.userDataEvents = null;
                    }
                }
                finally
                {
                    try
                    {
                        if (this.hiddenTextSession != null)
                        {
                            // We can't throw or exit here because we need to call Dispose on the
                            // other members that need to be disposed.
                            this.hiddenTextSession.UnadviseClient();
                            // This is causing a debug assert in vs\env\msenv\textmgr\vrlist.cpp
                            // at line 1997 in CVisibleRegionList::Terminate
                            //this.hiddenTextSession.Terminate();
                            this.hiddenTextSession = null;
                        }
                    }
                    finally
                    {
                        try
                        {
                            if (this.methodData != null)
                            {
                                this.methodData.Dispose();
                                this.methodData = null;
                            }
                        }
                        finally
                        {
                            try
                            {
                                if (this.completionSet != null)
                                {
                                    this.completionSet.Dispose();
                                    this.completionSet = null;
                                }
                            }
                            finally
                            {
                                try
                                {
                                    // clear out any remaining tasks for this doc in the task list
                                    // tp may not be the same as taskProvider

                                    // REVIEW: This should be: if (null != this.taskReporter)
                                    // Right now, MSBuild 4.0 can clear out build loggers responsibly, so this.taskReporter will always
                                    // be null when we get to this point, so we'll need to create a new taskReporter to clear out the
                                    // background tasks
                                    TaskReporter tr = this.GetTaskReporter();  // may be our own TR or one from ProjectSite of this file
                                    if (null != tr)
                                    {
                                        tr.ClearBackgroundTasksForFile(this.GetFilePath());
                                        // Refresh the task list
                                        tr.OutputTaskList();
                                    }
                                    if (null != this.taskReporter)      // dispose the one we own (do not dispose one shared by project site!)
                                    {
                                        this.taskReporter.Dispose();
                                        this.taskReporter = null;
                                        this.taskProvider = null;
                                    }
                                }
                                finally
                                {
                                    try
                                    {
                                        this.service = null;
                                        if (this.colorizer != null)
                                        {
                                            // The colorizer is owned by the core text editor, so we don't close it, the core text editor
                                            // does that for us when it is ready to do so.
                                            //colorizer.CloseColorizer();
                                            this.colorizer = null;
                                        }
                                    }
                                    finally
                                    {
                                        this.colorState = null;
                                        try
                                        {
                                            if (this.expansionProvider != null)
                                            {
                                                this.expansionProvider.Dispose();
                                                this.expansionProvider = null;
                                            }

                                        }
                                        finally
                                        {
                                            // Sometimes OnCloseSource is called when language service is changed, (for example
                                            // when you save the file with a different file extension) in which case we cannot 
                                            // null out the site because that will cause a crash inside msenv.dll.
                                            //            if (this.textLines != null) {
                                            //                ((IObjectWithSite)this.textLines).SetSite(null);
                                            //            }
                                            if (this.textLines != null)
                                            {
                                                this.textLines = null;
                                                Marshal.Release(pUnkTextLines);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #6
0
 // Overriden in Source.fs, but it calls this base implementation
 public virtual TaskProvider GetTaskProvider()
 {
     if (this.taskProvider == null)
     {
         this.taskProvider = new ErrorListProvider(service.Site); // task list
         // Due to the fact that the ErrorList is not yet working...the 
         // following at least results in all tasks from the same language 
         // service into one list.
         this.taskProvider.ProviderGuid = service.GetLanguageServiceGuid();
         this.taskProvider.ProviderName = service.Name;
     }
     return this.taskProvider;
 }
 /// <include file='doc\TaskProvider.uex' path='docs/doc[@for="TaskCollection.TaskCollection"]/*' />
 public TaskCollection(TaskProvider owner)
 {
     if (null == owner) {
         throw new ArgumentNullException("owner");
     }
     this.owner = owner;
     this.list = new ArrayList();
 }
 public PackageReferenceMarker(TaskProvider taskProvider, PackageReference packageReference)
 {
     this._taskProvider = taskProvider;
     this.PackageReference = packageReference;
 }
 /// <include file='doc\TaskProvider.uex' path='docs/doc[@for="TaskCollection.TaskCollection"]/*' />
 public TaskCollection(TaskProvider owner)
 {
     this.owner = owner;
     this.list = new ArrayList();
 }
        /// <summary>
        /// Sets the service provider from which to access the services. 
        /// </summary>
        /// <param name="site">An instance to an Microsoft.VisualStudio.OLE.Interop object</param>
        /// <returns>A success or failure value.</returns>
        public override int SetSite(Microsoft.VisualStudio.OLE.Interop.IServiceProvider site)
        {
            CCITracing.TraceCall();
            this.site = new ServiceProvider(site);
            ServiceProvider = this.site;

            if (taskProvider != null)
            {
                taskProvider.Dispose();
            }
            taskProvider = new TaskProvider(this.site);

            return VSConstants.S_OK;
        }
Exemple #11
0
        /// <summary>
        /// Constructor.  Inititialize member data.
        /// </summary>
        public IDEBuildLogger(IVsOutputWindowPane output, TaskProvider taskProvider, IVsHierarchy hierarchy) {
            Utilities.ArgumentNotNull("taskProvider", taskProvider);
            Utilities.ArgumentNotNull("hierarchy", hierarchy);

            Trace.WriteLineIf(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA, "WARNING: IDEBuildLogger constructor running on the wrong thread.");

            IOleServiceProvider site;
            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hierarchy.GetSite(out site));

            this.taskProvider = taskProvider;
            this.outputWindowPane = output;
            this.hierarchy = hierarchy;
            this.serviceProvider = new ServiceProvider(site);
            serviceProvider.GetUIThread().MustBeCalledFromUIThread();
            this.dispatcher = Dispatcher.CurrentDispatcher;
        }
Exemple #12
0
 //http://vsxexperience.net/2010/03/23/writing-to-the-vs-errorlist/
 private TaskProvider GetTaskListProvider()
 {
     TaskProvider provider = new TaskProvider(this);
     provider.ProviderName = "Lonestar";
     provider.ProviderGuid = new Guid("bac18fa3-71ac-4240-8008-bc12e25eab75");
     return provider;
 }
 public PackageReferenceMarkerProvider(TaskProvider taskProvider)
 {
     this._taskProvider = taskProvider;
 }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_textLineMarker != null)
         {
             RemoveTextLineMarker();
         }
         this.PackageReference = null;
         this._taskProvider = null;
     }
 }
		/// <summary>
		/// Disposes the project node object.
		/// </summary>
		/// <param name="disposing">Flag determining ehether it was deterministic or non deterministic clean up.</param>
		protected override void Dispose(bool disposing)
		{
			if(this.isDisposed)
			{
				return;
			}

			try
			{
				try
				{
					this.UnRegisterProject();
				}
				finally
				{
					try
					{
						this.RegisterClipboardNotifications(false);
					}
					finally
					{
						try
						{
							if(this.globalPropertyHandler != null)
							{
								this.globalPropertyHandler.ActiveConfigurationChanged -= new EventHandler<ActiveConfigurationChangedEventArgs>(this.OnHandleConfigurationRelatedGlobalProperties);

								this.globalPropertyHandler.Dispose();
							}

							if(this.projectEventsProvider != null)
							{
								this.projectEventsProvider.AfterProjectFileOpened -= this.OnAfterProjectOpen;
							}
							if(this.taskProvider != null)
							{
								taskProvider.Tasks.Clear();
								this.taskProvider.Dispose();
								this.taskProvider = null;
							}
							if(buildLogger != null)
							{
								buildLogger = null;
							}
							this.site = null;
						}
						finally
						{
							if(this.buildEngine != null)
							{
								this.buildEngine.UnregisterAllLoggers();
								this.buildEngine = null;
							}
						}
					}
				}

				if(this.buildProject != null)
				{
					this.buildProject.ParentEngine.UnloadProject(this.buildProject);
					this.buildProject = null;
				}

				if(null != imageHandler)
				{
					imageHandler.Close();
					imageHandler = null;
				}
			}
			finally
			{
				base.Dispose(disposing);
				this.isDisposed = true;
			}
		}
        // Overriden in Source.fs, but it calls this base implementation
        public virtual TaskProvider GetTaskProvider()
        {
            if (this.taskProvider == null)
            {
                this.taskProvider = new ErrorListProvider(service.Site); // task list
                this.taskProvider.ProviderGuid = service.GetLanguageServiceGuid();
				string name;
				((IVsLanguageInfo)service).GetLanguageName(out name);
				this.taskProvider.ProviderName = name;
            }
            return this.taskProvider;
        }
Exemple #17
0
 public TaskListProvider(Microsoft.VisualStudio.Shell.TaskProvider taskProvider)
 {
     this.taskProvider = taskProvider;
 }
Exemple #18
0
 /// <include file='doc\TaskProvider.uex' path='docs/doc[@for="TaskCollection.TaskCollection"]/*' />
 public TaskCollection(TaskProvider owner)
 {
     this.owner = owner;
     this.list  = new ArrayList();
 }
        /// <summary>
        /// Disposes the project node object.
        /// </summary>
        /// <param name="disposing">Flag determining ehether it was deterministic or non deterministic clean up.</param>
        protected override void Dispose(bool disposing)
        {
            if (this.isDisposed)
            {
                return;
            }

            try
            {
                try
                {
                    this.UnRegisterProject();
                }
                finally
                {
                    try
                    {
                        this.RegisterClipboardNotifications(false);
                    }
                    finally
                    {
                        try
                        {
                            if (this.projectEventsProvider != null)
                            {
                                this.projectEventsProvider.AfterProjectFileOpened -= this.OnAfterProjectOpen;
                            }
                            if (this.taskProvider != null)
                            {
                                taskProvider.Tasks.Clear();
                                this.taskProvider.Dispose();
                                this.taskProvider = null;
                            }

                            if (this.buildLogger != null)
                            {
                                this.buildLogger.Shutdown();
                                buildLogger = null;
                            }

                            if (this.site != null)
                            {
                                this.site.Dispose();
                            }
                        }
                        finally
                        {
                            this.buildEngine = null;
                        }
                    }
                }

                if (this.buildProject != null)
                {
                    this.buildProject.ProjectCollection.UnloadProject(this.buildProject);
                    this.buildProject.ProjectCollection.UnloadProject(this.buildProject.Xml);
                    this.buildProject = null;
                }

                if (null != imageHandler)
                {
                    imageHandler.Close();
                    imageHandler = null;
                }
            }
            finally
            {
                base.Dispose(disposing);
                this.isDisposed = true;
            }
        }
 public NemerleIdeBuildLogger(IVsOutputWindowPane output, TaskProvider taskProvider, IVsHierarchy hierarchy)
     : base(output, taskProvider, hierarchy)
 {
     _taskProvider = taskProvider;
 }
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initilaization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            taskProvider = new TaskProvider(this);

            var outputWindowService = GetService(typeof(SVsOutputWindow)) as IVsOutputWindow;
            if (outputWindowService != null)
            {
                Guid guidPane = Microsoft.VisualStudio.VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid;
                if (outputWindowService.GetPane(ref guidPane, out outputPane) != VSConstants.S_OK)
                {
                    throw new NotSupportedException();
                }
            }

            // Add our command handlers for menu (commands must exist in the .vsct file)
            OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (null != mcs)
            {
                InitializeMenus(mcs);
            }
        }
Exemple #22
0
        /// <summary>
        ///     Sets the service provider from which to access the services.
        /// </summary>
        /// <param name="site">An instance to an Microsoft.VisualStudio.OLE.Interop object</param>
        /// <returns>A success or failure value.</returns>
        public override int SetSite(IOleServiceProvider site)
        {
            CCITracing.TraceCall();
            this.site = new ServiceProvider(site);
            ServiceProvider = this.site;

            if (TaskProvider != null)
            {
                TaskProvider.Dispose();
            }
            TaskProvider = new TaskProvider(this.site);

            return VSConstants.S_OK;
        }