本文整理汇总了C#中IVsSolution类的典型用法代码示例。如果您正苦于以下问题:C# IVsSolution类的具体用法?C# IVsSolution怎么用?C# IVsSolution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVsSolution类属于命名空间,在下文中一共展示了IVsSolution类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SolutionEventsListener
public SolutionEventsListener(IVsSolution service, IVsSolutionBuildManager3 buildManager = null) {
if (service == null) {
throw new ArgumentNullException("service");
}
_solution = service;
_buildManager = buildManager;
}
开发者ID:bnavarma,项目名称:ScalaTools,代码行数:7,代码来源:SolutionEventsListener.cs
示例2: 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
示例3: LocatorWindowCommand
/// <summary>
/// Initializes a new instance of the <see cref="LocatorWindowCommand"/> class.
/// Adds our command handlers for menu (commands must exist in the command table file)
/// </summary>
/// <param name="package">Owner package, not null.</param>
private LocatorWindowCommand(Package package)
{
if (package == null)
{
throw new ArgumentNullException("package");
}
this.package = package;
OleMenuCommandService commandService = ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
if (commandService != null)
{
var menuCommandID = new CommandID(CommandSet, CommandId);
var menuItem = new MenuCommand(this.ShowToolWindow, menuCommandID);
commandService.AddCommand(menuItem);
}
// Get the instance number 0 of this tool window. This window is single instance so this instance
// is actually the only one.
// The last flag is set to true so that if the tool window does not exists it will be created.
_locatorWindow = package.FindToolWindow(typeof(LocatorWindow), 0, true) as LocatorWindow;
if ((null == _locatorWindow) || (null == _locatorWindow.Frame))
{
throw new NotSupportedException("Cannot create tool window");
}
_locator = new Locator();
_solution = ServiceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
_solution.AdviseSolutionEvents(_locator, out _cookie);
_locatorWindow.SetLocator(_locator);
_locator.StartWorkerThread();
}
开发者ID:SoulForMachine,项目名称:QtCreatorPack,代码行数:37,代码来源:LocatorWindowCommand.cs
示例4: VisualStudioProjectTracker
public VisualStudioProjectTracker(IServiceProvider serviceProvider)
{
_projectMap = new Dictionary<ProjectId, AbstractProject>();
_projectPathToIdMap = new Dictionary<string, ProjectId>(StringComparer.OrdinalIgnoreCase);
_serviceProvider = serviceProvider;
_workspaceHosts = new List<WorkspaceHostState>(capacity: 1);
_vsSolution = (IVsSolution)serviceProvider.GetService(typeof(SVsSolution));
_runningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
uint solutionEventsCookie;
_vsSolution.AdviseSolutionEvents(this, out solutionEventsCookie);
_solutionEventsCookie = solutionEventsCookie;
// It's possible that we're loading after the solution has already fully loaded, so see if we missed the event
var shellMonitorSelection = (IVsMonitorSelection)serviceProvider.GetService(typeof(SVsShellMonitorSelection));
uint fullyLoadedContextCookie;
if (ErrorHandler.Succeeded(shellMonitorSelection.GetCmdUIContextCookie(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_guid, out fullyLoadedContextCookie)))
{
int fActive;
if (ErrorHandler.Succeeded(shellMonitorSelection.IsCmdUIContextActive(fullyLoadedContextCookie, out fActive)) && fActive != 0)
{
_solutionLoadComplete = true;
}
}
}
开发者ID:nemec,项目名称:roslyn,代码行数:28,代码来源:VisualStudioProjectTracker.cs
示例5: SolutionEventsListener
public SolutionEventsListener(IServiceProvider serviceProvider)
{
solution = serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
if (solution != null)
{
solution.AdviseSolutionEvents(this, out solutionEventsCookie);
}
}
开发者ID:Powerino73,项目名称:paradox,代码行数:8,代码来源:SolutionEventsListener.cs
示例6: SolutionChangeEventListener
/// <summary>
/// Constructor.
/// Register Solution events.
/// </summary>
public SolutionChangeEventListener() {
InitNullEvents();
solution = Package.GetGlobalService(typeof(SVsSolution)) as IVsSolution;
if(solution != null) {
solution.AdviseSolutionEvents(this, out solutionEventsCookie);
}
}
开发者ID:nkcsgexi,项目名称:SrcML.NET,代码行数:12,代码来源:SolutionReloadEventListener.cs
示例7: CreateItem
/// <summary>
/// Create an IItemContainer wrapper object against pHier
/// </summary>
internal static IItemContainer CreateItem(IServiceProvider serviceProvider, IVsSolution solution, IVsHierarchy pHier)
{
Debug.Assert(serviceProvider != null && solution != null && pHier != null);
using (HierarchyNode current = new HierarchyNode(solution, pHier))
{
return CreateItem(serviceProvider, current);
}
}
开发者ID:NuPattern,项目名称:NuPattern,代码行数:11,代码来源:ItemFactory.cs
示例8: ProjectNode
public ProjectNode(IVsSolution vsSolution, Guid projectGuid)
: base(vsSolution, projectGuid)
{
this.project = this.Hierarchy as IVsProject;
// Commented because it will show up an error dialog before getting back control to the recipe (caller)
//Debug.Assert(project != null);
Debug.Assert(ItemId == VSConstants.VSITEMID_ROOT);
}
开发者ID:attilah,项目名称:ProjectLinker,代码行数:8,代码来源:ProjectNode.cs
示例9: AdviceSolutionEvents
private void AdviceSolutionEvents()
{
solution = Package.GetGlobalService(typeof(SVsSolution)) as IVsSolution;
if (solution != null)
{
ErrorHandler.ThrowOnFailure(solution.AdviseSolutionEvents(this, out solutionCookie));
}
}
开发者ID:FreeFrags,项目名称:Typewriter,代码行数:8,代码来源:SolutionMonitor.cs
示例10: SolutionEventSinks
public SolutionEventSinks()
{
solution = (IVsSolution)Package.GetGlobalService(typeof(SVsSolution));
if (null == solution)
Trace.WriteLine("Can't access solution service");
else
solution.AdviseSolutionEvents((IVsSolutionEvents)this, out solutionEventsCookie);
}
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:8,代码来源:ISolutionEvents.cs
示例11: SelectItemInSolutionExplorer
public static void SelectItemInSolutionExplorer(this IVsUIShell uiShell, IVsSolution solution, string fileName)
{
HierarchyNodeIterator it = new HierarchyNodeIterator(solution);
HierarchyNode hierarchyNode = it.FirstOrDefault(node => node.FullName == fileName);
uiShell.SelectItemInSolutionExplorer(hierarchyNode);
}
开发者ID:henritersteeg,项目名称:cuke4vs,代码行数:8,代码来源:IVsUIShellExtensions.cs
示例12: SolutionEvents
public SolutionEvents([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
{
Guard.NotNull(() => serviceProvider, serviceProvider);
this.serviceProvider = serviceProvider;
this.solution = serviceProvider.GetService<SVsSolution, IVsSolution>();
this.solutionEvents = new VsSolutionEvents(this);
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(this.solution.AdviseSolutionEvents(this.solutionEvents, out this.solutionEventsCookie));
}
开发者ID:NuPattern,项目名称:NuPattern,代码行数:9,代码来源:SolutionEvents.cs
示例13: ProjectItemsSynchronizer
public ProjectItemsSynchronizer(Project sourceProject, Project targetProject, ILogger logger, IVsSolution solution, IHierarchyHelper hierarchyHelper, IProjectItemsFilter projectItemsFilter)
{
this.logger = logger;
this.solution = solution;
this.hierarchyHelper = hierarchyHelper;
SourceProject = sourceProject;
TargetProject = targetProject;
this.projectItemsFilter = projectItemsFilter;
}
开发者ID:attilah,项目名称:ProjectLinker,代码行数:9,代码来源:ProjectItemsSynchronizer.cs
示例14: SolutionEventListener
public SolutionEventListener([Import(typeof (SVsServiceProvider))] IServiceProvider serviceProvider)
{
ValidateArg.NotNull(serviceProvider, "serviceProvider");
_solution = (IVsSolution) serviceProvider.GetService(typeof (IVsSolution));
if (_solution != null)
{
_solution.AdviseSolutionEvents(this, out _solutionEventsCookie);
}
}
开发者ID:smkanadl,项目名称:CTestTestAdapter,代码行数:10,代码来源:SolutionEventListener.cs
示例15: SolutionListener
/// <summary>
/// Initializes a new instance of the SolutionListener class.
/// </summary>
/// <param name="serviceProvider">The system service provider.</param>
internal SolutionListener(IServiceProvider serviceProvider)
{
Param.AssertNotNull(serviceProvider, "serviceProvider");
this.solution = serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
if (this.solution == null)
{
throw new InvalidOperationException();
}
}
开发者ID:jonthegiant,项目名称:StyleCop,代码行数:14,代码来源:SolutionListener.cs
示例16: SolutionListener
protected SolutionListener(IServiceProvider serviceProviderParameter)
{
Utilities.ArgumentNotNull("serviceProviderParameter", serviceProviderParameter);
this.serviceProvider = serviceProviderParameter;
this.solution = this.serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
Debug.Assert(this.solution != null, "Could not get the IVsSolution object from the services exposed by this project");
Utilities.CheckNotNull(this.solution);
}
开发者ID:borota,项目名称:JTVS,代码行数:10,代码来源:SolutionListener.cs
示例17: SolutionEvent
public SolutionEvent(ServiceProvider sp)
{
serviceProvider = sp;
solution = (IVsSolution)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(IVsSolution));
dte = (EnvDTE.DTE)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(EnvDTE.DTE));
//serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
if (solution != null)
{
solution.AdviseSolutionEvents(this, out solutionEventsCookie);
}
}
开发者ID:MagnusTiberius,项目名称:NugetVsPlugin,代码行数:11,代码来源:SolutionEvent.cs
示例18: SolutionEventsListener
public SolutionEventsListener(IServiceProvider serviceProvider)
{
solution = serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
solution?.AdviseSolutionEvents(this, out solutionEventsCookie);
buildManager = serviceProvider.GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager3;
buildManager?.AdviseUpdateSolutionEvents3(this, out updateSolutionEventsCookie);
monitorSelection = serviceProvider.GetService(typeof(IVsMonitorSelection)) as IVsMonitorSelection;
monitorSelection?.AdviseSelectionEvents(this, out selectionEventsCoockie);
}
开发者ID:cg123,项目名称:xenko,代码行数:11,代码来源:SolutionEventsListener.cs
示例19: SolutionEventsListener
/// <summary>Initializes a new instance of the <see cref="SolutionEventsListener"/> class.</summary>
public SolutionEventsListener(IVsEnvironmentHelper helper)
{
this.environment = helper;
this.InitNullEvents();
this.solution = Package.GetGlobalService(typeof(SVsSolution)) as IVsSolution;
if (this.solution != null)
{
this.solution.AdviseSolutionEvents(this, out this.solutionEventsCookie);
}
}
开发者ID:kanchanachalla,项目名称:VSSonarQubeExtension,代码行数:13,代码来源:SolutionEventsListener.cs
示例20: SolutionListener
protected SolutionListener(IServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
this.solution = serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
Debug.Assert(this.solution != null, "Could not get the IVsSolution object from the services exposed by this project");
if (this.solution == null)
{
throw new InvalidOperationException();
}
}
开发者ID:zooba,项目名称:wix3,代码行数:12,代码来源:solutionlistener.cs
注:本文中的IVsSolution类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论