コード例 #1
0
 internal VsResetInteractive(DTE dte, IComponentModel componentModel, IVsMonitorSelection monitorSelection, IVsSolutionBuildManager buildManager, Func<string, string> createReference, Func<string, string> createImport)
     : base(createReference, createImport)
 {
     _dte = dte;
     _componentModel = componentModel;
     _monitorSelection = monitorSelection;
     _buildManager = buildManager;
 }
コード例 #2
0
        public VsUpdateSolutionEvents(
            IVsSolutionBuildManager buildManager,
            TaskCompletionSource<bool> taskSource)
        {
            _taskSource = taskSource;
            _buildManager = buildManager;

            Marshal.ThrowExceptionForHR(
                buildManager.AdviseUpdateSolutionEvents(this, out _cookie));
        }
コード例 #3
0
ファイル: Package.cs プロジェクト: dbremner/specsharp
    protected override void Dispose(bool disposing)
    {
      if (disposing) {
        tools.Release();
        tools = null;

        sharedTaskManagers.Clear();
        sharedTaskManagers = null;

        if (buildManager != null) {
          buildManager.UnadviseUpdateSolutionEvents(buildManagerCookie);
          buildManager = null;
        }
        
        if (solution != null) {
          solution.UnadviseSolutionEvents(solutionEventsCookie);
          solution = null;
        }

        taskListMenu.Release();
        taskListMenu = null;
        Common.Release();
        GC.SuppressFinalize(this);
      }
      base.Dispose(disposing);
    } 
コード例 #4
0
ファイル: Package.cs プロジェクト: dbremner/specsharp
    protected override void Initialize()
    {
      base.Initialize();
      
      // Initialize common functionality
      Common.Initialize(this);
      taskListMenu = new RootMenu();
      
      // Initialize fields
      tools = new Tools();
      sharedTaskManagers = new List<TaskManager>();

      // Attach to solution events
      solution = GetService(typeof(SVsSolution)) as IVsSolution;
      // if (solution == null) throw new NullReferenceException();
      solution.AdviseSolutionEvents(this as IVsSolutionEvents, out solutionEventsCookie);

      // Attach to build events
      buildManager = GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager;
      // if (buildManager == null) throw new NullReferenceException();
      buildManager.AdviseUpdateSolutionEvents(this, out buildManagerCookie);

      // Add a TaskManagerFactory service
      (this as System.ComponentModel.Design.IServiceContainer).AddService(typeof(ITaskManagerFactory), this, true);
    }
コード例 #5
0
 public ProjectAsyncBuilder(IVsSolutionBuildManager manager, TaskCompletionSource<bool> completionSource)
 {
     _buildManager = manager;
     _completionSource = completionSource;
 }
コード例 #6
0
ファイル: Package.cs プロジェクト: nbulp/CodeContracts
    protected override void Initialize()
    {
      Common.Trace("Package intialize");
      base.Initialize();
      Common.Trace("Task manager.Initialize()");

      // Initialize common functionality
      Common.Initialize(this);
      taskListMenu = new RootMenu();
      
      // Initialize fields
      tools = new Tools();
      sharedTaskManagers = new List<TaskManager>();

      // Attach to solution events
      solution = GetService(typeof(SVsSolution)) as IVsSolution;
      if (solution == null) Common.Log("Could not get solution");
      solution.AdviseSolutionEvents(this as IVsSolutionEvents, out solutionEventsCookie);

      // Attach to build events
      buildManager = GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager;
      if (buildManager == null) Common.Log("Could not get build manager");
      buildManager.AdviseUpdateSolutionEvents(this, out buildManagerCookie);

      // Add a TaskManagerFactory service
      ITaskManagerFactory factory = this as ITaskManagerFactory;
      (this as System.ComponentModel.Design.IServiceContainer).AddService(typeof(ITaskManagerFactory), factory, true);

      // Set PID for msbuild tasks
      Environment.SetEnvironmentVariable( "VSPID", System.Diagnostics.Process.GetCurrentProcess().Id.ToString() );
    }