当前位置: 首页>>代码示例>>C#>>正文


C# SolutionEvents类代码示例

本文整理汇总了C#中SolutionEvents的典型用法代码示例。如果您正苦于以下问题:C# SolutionEvents类的具体用法?C# SolutionEvents怎么用?C# SolutionEvents使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SolutionEvents类属于命名空间,在下文中一共展示了SolutionEvents类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AutoLinkerService

        public AutoLinkerService(DTE2 visualStudio, IConfigurationService configurationService, IVisualStudioService visualStudioService)
        {
            Argument.IsNotNull("visualStudio", visualStudio);
            Argument.IsNotNull("configurationService", configurationService);
            Argument.IsNotNull("visualStudioService", visualStudioService);

            _visualStudio = visualStudio;
            _configurationService = configurationService;
            _visualStudioService = visualStudioService;

            var events = (Events2)_visualStudio.Events;

            _solutionEvents = events.SolutionEvents;
            _solutionEvents.Opened += OnSolutionOpened;
            _solutionEvents.AfterClosing += OnSolutionClosed;

            _solutionItemsEvents = events.MiscFilesEvents;
            _solutionItemsEvents.ItemAdded += OnSolutionItemAdded;
            _solutionItemsEvents.ItemRemoved += OnSolutionItemRemoved;
            _solutionItemsEvents.ItemRenamed += OnSolutionItemRenamed;

            _projectItemsEvents = events.ProjectItemsEvents;
            _projectItemsEvents.ItemAdded += OnSolutionItemAdded;
            _projectItemsEvents.ItemRemoved += OnSolutionItemRemoved;
            _projectItemsEvents.ItemRenamed += OnSolutionItemRenamed;
        }
开发者ID:GeertvanHorrik,项目名称:Caitlyn,代码行数:26,代码来源:AutoLinkerService.cs

示例2: PluginList

        public PluginList()
        {
            InitializeComponent();

            _logger = new Logger();

            _dte = Package.GetGlobalService(typeof(DTE)) as DTE;
            if (_dte == null)
                return;

            _solution = _dte.Solution;
            if (_solution == null)
                return;

            _events = _dte.Events;
            var windowEvents = _events.WindowEvents;
            windowEvents.WindowActivated += WindowEventsOnWindowActivated;
            _solutionEvents = _events.SolutionEvents;
            _solutionEvents.BeforeClosing += BeforeSolutionClosing;
            _solutionEvents.BeforeClosing += SolutionBeforeClosing;
            _solutionEvents.ProjectAdded += SolutionProjectAdded;
            _solutionEvents.ProjectRemoved += SolutionProjectRemoved;
            _solutionEvents.ProjectRenamed += SolutionProjectRenamed;

            SelectedAssemblyItem.PropertyChanged += SelectedAssemblyItem_PropertyChanged;
        }
开发者ID:modulexcite,项目名称:CRMDeveloperExtensions,代码行数:26,代码来源:PluginList.xaml.cs

示例3: Initialize

        protected override void Initialize()
        {
            base.Initialize();

            //if invalid data, adjust it
            dataAdjuster.Adjust();

            // Get solution build manager
            sbm = ServiceProvider.GlobalProvider.GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager2;
            if (sbm != null)
            {
                sbm.AdviseUpdateSolutionEvents(this, out updateSolutionEventsCookie);
            }

            // Must hold a reference to the solution events object or the events wont fire, garbage collection related
            events = GetDTE().Events.SolutionEvents;
            events.Opened += Solution_Opened;

            PrintLine("Build monitor initialized");
            PrintLine("Path to persist data: {0}", Settings.RepositoryPath);

            monitor.SolutionBuildFinished = b =>
            {
                Print("[{0}] Time Elapsed: {1} \t\t", b.SessionBuildCount, b.SolutionBuildTime.ToTime());
                PrintLine("Session build time: {0}\n", b.SessionMillisecondsElapsed.ToTime());
            };

            monitor.ProjectBuildFinished = b => PrintLine(" - {0}\t-- {1} --", b.MillisecondsElapsed.ToTime(), b.ProjectName);
        }
开发者ID:abhijeetpathak,项目名称:BuildMonitor,代码行数:29,代码来源:BuildMonitorPackage.cs

示例4: Initialize

        protected override void Initialize()
        {
            _dte = GetService(typeof(DTE)) as DTE2;
            Package = this;

            Telemetry.SetDeviceName(_dte.Edition);
            Logger.Initialize(this, Constants.VSIX_NAME);

            Events2 events = (Events2)_dte.Events;
            _solutionEvents = events.SolutionEvents;
            _solutionEvents.AfterClosing += () => { TableDataSource.Instance.CleanAllErrors(); };
            _solutionEvents.ProjectRemoved += (project) => { TableDataSource.Instance.CleanAllErrors(); };

            _buildEvents = events.BuildEvents;
            _buildEvents.OnBuildBegin += OnBuildBegin;

            CreateConfig.Initialize(this);
            Recompile.Initialize(this);
            CompileOnBuild.Initialize(this);
            RemoveConfig.Initialize(this);
            CompileAllFiles.Initialize(this);
            CleanOutputFiles.Initialize(this);

            base.Initialize();
        }
开发者ID:PaulVrugt,项目名称:WebCompiler,代码行数:25,代码来源:WebCompilerPackage.cs

示例5: WebResourceList

        public WebResourceList()
        {
            InitializeComponent();
            _dte = Package.GetGlobalService(typeof(DTE)) as DTE;
            if (_dte == null)
                return;

            _solution = _dte.Solution;
            if (_solution == null)
                return;

            _events = _dte.Events;
            var windowEvents = _events.WindowEvents;
            windowEvents.WindowActivated += WindowEventsOnWindowActivated;
            _solutionEvents = _events.SolutionEvents;
            _solutionEvents.BeforeClosing += BeforeSolutionClosing;
            _solutionEvents.Opened += SolutionOpened;
            _solutionEvents.ProjectAdded += SolutionProjectAdded;
            _solutionEvents.ProjectRemoved += SolutionProjectRemoved;
            _solutionEvents.ProjectRenamed += SolutionProjectRenamed;
            _events2 = (Events2)_dte.Events;
            _projectItemsEvents = _events2.ProjectItemsEvents;
            _projectItemsEvents.ItemAdded += ProjectItemAdded;
            _projectItemsEvents.ItemRemoved += ProjectItemRemoved;
            _projectItemsEvents.ItemRenamed += ProjectItemRenamed;
        }
开发者ID:kwechsler,项目名称:CRMDeveloperExtensions,代码行数:26,代码来源:WebResourceList.xaml.cs

示例6: VSEventsHandler

		/// <summary>
		/// Initializes a new instance of the <see cref="VSEventsHandler"/> class.
		/// </summary>
		/// <param name="package">The Visual Studio Extension Package.</param>
		public VSEventsHandler(OpenCoverUIPackage package)
		{
			_package = package;
            _solutionEvents = _package.DTE.Events.SolutionEvents;
            _solutionEvents.Opened += OnSolutionOpened;
            _solutionEvents.AfterClosing += OnSolutionClosing;
		}
开发者ID:ktcheek,项目名称:OpenCover.UI,代码行数:11,代码来源:VSEventsHandler.cs

示例7: GoToDefinitionFilterProvider

        public GoToDefinitionFilterProvider(
            [Import(typeof(SVsServiceProvider))] System.IServiceProvider serviceProvider,
            IVsEditorAdaptersFactoryService editorFactory,
            IEditorOptionsFactoryService editorOptionsFactory,
            ITextDocumentFactoryService textDocumentFactoryService,
            [Import(typeof(DotNetReferenceSourceProvider))] ReferenceSourceProvider referenceSourceProvider,
            VSLanguageService fsharpVsLanguageService,
            ProjectFactory projectFactory)
        {
            _serviceProvider = serviceProvider;
            _editorFactory = editorFactory;
            _editorOptionsFactory = editorOptionsFactory;
            _textDocumentFactoryService = textDocumentFactoryService;
            _referenceSourceProvider = referenceSourceProvider;
            _fsharpVsLanguageService = fsharpVsLanguageService;
            _projectFactory = projectFactory;

            var dte = serviceProvider.GetService(typeof(SDTE)) as DTE;
            var events = dte.Events as Events2;
            if (events != null)
            {
                _solutionEvents = events.SolutionEvents;
                _solutionEvents.AfterClosing += Cleanup;
            }
        }
开发者ID:bryanhunter,项目名称:VisualFSharpPowerTools,代码行数:25,代码来源:GotoDefinitionFilterProvider.cs

示例8: OnConnection

        /// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
        /// <param term='application'>Root object of the host application.</param>
        /// <param term='connectMode'>Describes how the Add-in is being loaded.</param>
        /// <param term='addInInst'>Object representing this Add-in.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
        {
            Globals.DTE = (DTE2)application;
            Globals.Addin = (AddIn)addInInst;

            solutionEvents = Globals.DTE.Events.SolutionEvents;
            solutionEvents.Opened += new _dispSolutionEvents_OpenedEventHandler(SolutionEvents_Opened);
            solutionEvents.BeforeClosing += new _dispSolutionEvents_BeforeClosingEventHandler(SolutionEvents_BeforeClosing);

            commandManager = new CommandManager(Globals.DTE, Globals.Addin);
            commandBarBuilder = new CommandBarBuilder(Globals.DTE, Globals.Addin);

            switch (connectMode)
            {
                case ext_ConnectMode.ext_cm_UISetup:
                    // Initialize the UI of the add-in
                    break;

                case ext_ConnectMode.ext_cm_Startup:
                    // The add-in was marked to load on startup
                    // Do nothing at this point because the IDE may not be fully initialized
                    // Visual Studio will call OnStartupComplete when fully initialized
                    break;

                case ext_ConnectMode.ext_cm_AfterStartup:
                    // The add-in was loaded by hand after startup using the Add-In Manager
                    // Initialize it in the same way that when is loaded on startup
                    Initialize();
                    break;
            }
        }
开发者ID:ptomasroos,项目名称:ivyvisual,代码行数:36,代码来源:Connect.cs

示例9: SolutionHandler

 private SolutionHandler(DTE2 dte)
 {
     _dte = dte;
     _events = _dte.Events.SolutionEvents;
     _events.Opened += OnSolutionOpened;
     _events.AfterClosing += OnSolutionClosed;
 }
开发者ID:ErikEJ,项目名称:SolutionExtensions,代码行数:7,代码来源:SolutionHandler.cs

示例10: ReloadFactory

 static ReloadFactory()
 {
     var dte = (DTE2)Package.GetGlobalService(typeof(DTE));
     _solutionEvents = dte.Events.SolutionEvents;
     _solutionEvents.AfterClosing += SolutionEvents_AfterClosing;
     _solutionEvents.ProjectRemoved += _solutionEvents_ProjectRemoved;
 }
开发者ID:madskristensen,项目名称:BrowserReloadOnSave,代码行数:7,代码来源:ReloadFactory.cs

示例11: SolutionManager

        internal SolutionManager(DTE dte, IVsSolution vsSolution, IVsMonitorSelection vsMonitorSelection)
        {
            if (dte == null)
            {
                throw new ArgumentNullException("dte");
            }

            _initNeeded = true;
            _dte = dte;
            _vsSolution = vsSolution;
            _vsMonitorSelection = vsMonitorSelection;

            // Keep a reference to SolutionEvents so that it doesn't get GC'ed. Otherwise, we won't receive events.
            _solutionEvents = _dte.Events.SolutionEvents;

            // can be null in unit tests
            if (vsMonitorSelection != null)
            {
                Guid solutionLoadedGuid = VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_guid;
                _vsMonitorSelection.GetCmdUIContextCookie(ref solutionLoadedGuid, out _solutionLoadedUICookie);

                uint cookie;
                int hr = _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
                ErrorHandler.ThrowOnFailure(hr);
            }
            
            _solutionEvents.BeforeClosing += OnBeforeClosing;
            _solutionEvents.AfterClosing += OnAfterClosing;
            _solutionEvents.ProjectAdded += OnProjectAdded;
            _solutionEvents.ProjectRemoved += OnProjectRemoved;
            _solutionEvents.ProjectRenamed += OnProjectRenamed;

            // Run the init on another thread to avoid an endless loop of SolutionManager -> Project System -> VSPackageManager -> SolutionManager
            ThreadPool.QueueUserWorkItem(new WaitCallback(Init));
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:35,代码来源:SolutionManager.cs

示例12: VsEventProvider

 public VsEventProvider( ISourceControlService sourceControlService)
 {
     _vsEnvironment = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SDTE)) as DTE2;
     _sourceControlService = sourceControlService;
     _solutionEvents = _vsEnvironment.Events.SolutionEvents;
     _solutionEvents.AfterClosing += OnSolutionClosing;
     _solutionEvents.Opened += OnSolutionOpened;
 }
开发者ID:glconti,项目名称:tab-context-switch,代码行数:8,代码来源:VSEventProvider.cs

示例13: Storage

 private Storage(RegistryKey storeTarget, DTE2 application)
 {
     _storeTarget = storeTarget;
     _application = application;
     _solutionEvents = application.Events.SolutionEvents;
     _historicProcesses = new List<AttachData>();
     _sessionProcesses = new List<AttachData>();
 }
开发者ID:modulexcite,项目名称:Resurrect,代码行数:8,代码来源:Storage.cs

示例14: VisualStudioConnection

 public VisualStudioConnection(Package package)
 {
     _package = package;
     _dte = (DTE2)Package.GetGlobalService(typeof(DTE));
     _solutionEvents = ((Events2)_dte.Events).SolutionEvents;
     _buildEvents = ((Events2)_dte.Events).BuildEvents;
     _subject = new Subject<EventType>();
 }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:8,代码来源:VisualStudioConnection.cs

示例15: InstallerProjectManagementService

 public InstallerProjectManagementService(InstallBakerEventAggregator eventAggregator, SolutionEvents solutionEvents, Solution solution)
     : base(eventAggregator)
 {
     _solutionEvents = solutionEvents;
     _currentSolution = solution;
     LoadInstallerProject();
     HookEvents();
 }
开发者ID:ashokgelal,项目名称:InstallBaker,代码行数:8,代码来源:InstallerProjectManagementService.cs


注:本文中的SolutionEvents类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。