• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SolutionEvents类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: BindSolutionEvents

        private void BindSolutionEvents()
        {
            this.solutionEvents = this.events.SolutionEvents;

            this.solutionEvents.Opened += this.SolutionEvents_Opened;
            this.solutionEvents.AfterClosing += SolutionEvents_AfterClosing;

            // TODO CF from NL: implement based on ConnectEvents.cs
        }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:9,代码来源:ATPackageEventBinder.cs


示例17: DteWithEvents

 public DteWithEvents(DTE dte)
 {
     DTE = dte;
     SolutionEvents = dte.Events.SolutionEvents;
     ProjectItemsEvents = ((Events2)dte.Events).ProjectItemsEvents;
     DocumentEvents = ((Events2) dte.Events).DocumentEvents;
     BuildEvents = ((Events2) dte.Events).BuildEvents;
     CodeModelEvents = ((Events2)dte.Events).CodeModelEvents;
 }
开发者ID:ChrisEdwards,项目名称:SpecFlow,代码行数:9,代码来源:DteWithEvents.cs


示例18: VisualStudioSolutionService

        public VisualStudioSolutionService()
        {
            _currentDTE = VSJenkinsManagerPackage.Instance.GetService<DTE>();

            _solutionEvents = _currentDTE.Events.SolutionEvents;
            _solutionEvents.Opened += FireSolutionChangedEvent;
            _solutionEvents.AfterClosing += FireSolutionChangedEvent;
            _solutionEvents.Renamed += RenamedSolution;
        }
开发者ID:bergziege,项目名称:vsjenkinsmanager,代码行数:9,代码来源:VisualStudioSolutionService.cs


示例19: PackageRestorer

 public PackageRestorer(DTE dte, IServiceProvider serviceProvider)
 {
     _dte = dte;
     _errorListProvider = new ErrorListProvider(serviceProvider);
     _buildEvents = dte.Events.BuildEvents;
     _buildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
     _solutionEvents = dte.Events.SolutionEvents;
     _solutionEvents.AfterClosing += SolutionEvents_AfterClosing;            
 }
开发者ID:Newtopian,项目名称:nuget,代码行数:9,代码来源:PackageRestorer.cs


示例20: CoverageOverviewControl

        /// <summary>
        /// Initializes a new instance of the <see cref="CoverageOverviewControl"/> class.
        /// </summary>
        public CoverageOverviewControl()
        {
            _dte = (DTE)CoverageOverviewCommand.Instance.ServiceProvider.GetService(typeof(DTE));
            _solutionEvents = _dte.Events.SolutionEvents;
            _solutionEvents.Opened += SolutionEventsOpened;
            LogFactory.CurrentLogger = new VisualStudioLogger(CoverageOverviewCommand.Instance.ServiceProvider);

            this.InitializeComponent();
            this.Loaded += CoverageOverviewControl_Loaded;
        }
开发者ID:pzielinski86,项目名称:RuntimeTestCoverage,代码行数:13,代码来源:CoverageOverviewControl.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SolutionFolder类代码示例发布时间:2022-05-24
下一篇:
C# SolutionEntityItem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap