本文整理汇总了C#中IComponentModel类的典型用法代码示例。如果您正苦于以下问题:C# IComponentModel类的具体用法?C# IComponentModel怎么用?C# IComponentModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IComponentModel类属于命名空间,在下文中一共展示了IComponentModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Apply
public virtual void Apply( IComponentModel model, object component )
{
if (Next != null)
{
Next.Apply( model, component );
}
}
开发者ID:BackupTheBerlios,项目名称:dpml-svn,代码行数:7,代码来源:AbstractConcern.cs
示例2: CSharpResetInteractiveMenuCommand
public CSharpResetInteractiveMenuCommand(
OleMenuCommandService menuCommandService,
IVsMonitorSelection monitorSelection,
IComponentModel componentModel)
: base(ContentTypeNames.CSharpContentType, menuCommandService, monitorSelection, componentModel)
{
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:CSharpResetInteractiveMenuCommand.cs
示例3: InstallCompositionPackagesIfNeeded
private void InstallCompositionPackagesIfNeeded( IComponentModel services, IVsPackageInstallerServices nuget, Lazy<XElement> wizardData )
{
Contract.Requires( services != null );
Contract.Requires( nuget != null );
Contract.Requires( wizardData != null );
// ensure composition is enabled
if ( !GetBoolean( "$compose$" ) )
return;
var packages = wizardData.Value;
var packageIds = new[] { "Microsoft.Composition", "More.Composition" };
var packageVersions = new Dictionary<string, string>();
// build collection of required packages and versions
foreach ( var packageId in packageIds )
{
if ( nuget.IsPackageInstalled( Project, packageId ) )
continue;
var packageVersion = ( from element in packages.Elements( "package" )
let id = (string) element.Attribute( "id" )
where id == packageId
select (string) element.Attribute( "version" ) ).FirstOrDefault();
if ( !string.IsNullOrEmpty( packageVersion ) )
packageVersions[packageId] = packageVersion;
}
InstallPackages( services, packages, packageVersions );
}
开发者ID:WaffleSquirrel,项目名称:More,代码行数:31,代码来源:DbContextTemplateWizard.cs
示例4: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
dteObject = (DTE)automationObject;
serviceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)this.dteObject;
IntPtr zero4 = IntPtr.Zero;
Guid guid = typeof(SComponentModel).GUID;
serviceProvider.QueryService(ref guid, ref IUnknownGuid, out zero4);
componentModel = (IComponentModel)GetObjectFromNativeUnknown(zero4);
replacementsDictionary["$ext_safeprojectname$"] = RootWizard.GlobalDictionary["$ext_safeprojectname$"];
replacementsDictionary["$ext_projectname$"] = RootWizard.GlobalDictionary["$ext_projectname$"];
string localDBInstance = "v11.0";
var localDBInstances = SqlLocalDbApi.GetInstanceNames();
if (localDBInstances.IndexOf("MSSqlLocalDB") >= 0)
localDBInstance = "MSSqlLocalDB";
else if (localDBInstances.IndexOf("v12.0") >= 0)
localDBInstance = "v12.0";
else if (localDBInstances.IndexOf("v11.0") >= 0)
localDBInstance = "v11.0";
else if (localDBInstances.Count > 0)
localDBInstance = localDBInstances[0];
replacementsDictionary["connectionString=\"Data Source=(LocalDb)\\v11.0;"] =
"connectionString=\"Data Source=(LocalDb)\\" + localDBInstance + ";";
if (!replacementsDictionary.TryGetValue("$wizarddata$", out wizardData))
wizardData = null;
}
开发者ID:C-DUCK,项目名称:Sningle,代码行数:30,代码来源:ChildWizard.cs
示例5: FileChange
public FileChange(TextDocument left,
TextDocument right,
IComponentModel componentModel,
AbstractChange parent,
PreviewEngine engine,
IVsImageService2 imageService) : base(engine)
{
Contract.ThrowIfFalse(left != null || right != null);
this.Id = left != null ? left.Id : right.Id;
_left = left;
_right = right;
_imageService = imageService;
_componentModel = componentModel;
var bufferFactory = componentModel.GetService<ITextBufferFactoryService>();
var bufferText = left != null ?
left.GetTextAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None) :
right.GetTextAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None);
_buffer = bufferFactory.CreateTextBuffer(bufferText.ToString(), bufferFactory.InertContentType);
_encoding = bufferText.Encoding;
this.Children = ComputeChildren(left, right, CancellationToken.None);
this.parent = parent;
}
开发者ID:RoryVL,项目名称:roslyn,代码行数:25,代码来源:FileChange.cs
示例6: InstallPackages
private void InstallPackages( IComponentModel services, XElement packages, IDictionary<string, string> packageVersions )
{
Contract.Requires( services != null );
Contract.Requires( packages != null );
Contract.Requires( packageVersions != null );
if ( packageVersions.Count == 0 )
return;
var extensionId = (string) packages.Attribute( "repositoryId" );
var installer = services.GetService<IVsPackageInstaller>();
var unzipped = false;
var skipAssemblyReferences = false;
var ignoreDependencies = false;
// although it's less efficient, we install the packages one at a time to display status.
// the mechanism to report back status is internal and can't be wired up without some
// crafty reflection hacks. this is a more straight forward alternative.
foreach ( var entry in packageVersions )
{
var packageVersion = new Dictionary<string, string>()
{
{ entry.Key, entry.Value }
};
// provide user feedback
DesignTimeEnvironment.StatusBar.Text = SR.PackageInstallStatus.FormatDefault( entry.Key, entry.Value );
// install the package from the vsix location
installer.InstallPackagesFromVSExtensionRepository( extensionId, unzipped, skipAssemblyReferences, ignoreDependencies, Project, packageVersion );
}
}
开发者ID:WaffleSquirrel,项目名称:More,代码行数:32,代码来源:DbContextTemplateWizard.cs
示例7: package
private ILookup<string, FileSystemPath> installedPackages; // there can be several versions of one package (different versions)
#endregion Fields
#region Constructors
public NuGetApi(ISolution solution, Lifetime lifetime, IComponentModel componentModel, IThreading threading, ProjectModelSynchronizer projectModelSynchronizer)
{
this.solution = solution;
this.threading = threading;
this.projectModelSynchronizer = projectModelSynchronizer;
try
{
vsPackageInstallerServices = componentModel.GetExtensions<IVsPackageInstallerServices>().SingleOrDefault();
vsPackageInstaller = componentModel.GetExtensions<IVsPackageInstaller>().SingleOrDefault();
vsPackageInstallerEvents = componentModel.GetExtensions<IVsPackageInstallerEvents>().SingleOrDefault();
}
catch (Exception e)
{
Logger.LogException("Unable to get NuGet interfaces.", e);
}
if (!IsNuGetAvailable)
{
Logger.LogMessage(LoggingLevel.VERBOSE, "[NUGET PLUGIN] Unable to get NuGet interfaces. No exception thrown");
return;
}
lifetime.AddBracket(
() => vsPackageInstallerEvents.PackageInstalled += RecalcInstalledPackages,
() => vsPackageInstallerEvents.PackageInstalled -= RecalcInstalledPackages);
lifetime.AddBracket(
() => vsPackageInstallerEvents.PackageUninstalled += RecalcInstalledPackages,
() => vsPackageInstallerEvents.PackageUninstalled -= RecalcInstalledPackages);
RecalcInstalledPackages(null);
}
开发者ID:netProgrammer,项目名称:resharper-nuget,代码行数:38,代码来源:NuGetApi.cs
示例8: PythonRunSettings
public PythonRunSettings([Import(typeof(SVsServiceProvider))]IServiceProvider serviceProvider) {
_compModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));
var opState = _compModel.GetService<IOperationState>();
opState.StateChanged += StateChange;
_dispatcher = Dispatcher.CurrentDispatcher;
_serviceProvider = serviceProvider;
}
开发者ID:zooba,项目名称:PTVS,代码行数:7,代码来源:PythonRunSettings.cs
示例9: CodeWindowManager
public CodeWindowManager(IVsCodeWindow codeWindow, IWpfTextView textView, IComponentModel componentModel)
{
_window = codeWindow;
_textView = textView;
_editorOperationsFactory = componentModel.GetService<IEditorOperationsFactoryService>();
_analyzer = componentModel.GetService<IPythonAnalyzer>();
}
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:CodeWindowManager.cs
示例10: CodeWindowManager
public CodeWindowManager(IVsCodeWindow codeWindow, IWpfTextView textView, IComponentModel componentModel)
{
_window = codeWindow;
_textView = textView;
_editorOperationsFactory = componentModel.GetService<IEditorOperationsFactoryService>();
_textView.Properties.AddProperty(typeof(CodeWindowManager), this);
}
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:CodeWindowManager.cs
示例11: VsInteractiveWindow
internal VsInteractiveWindow(IComponentModel model, Guid providerId, int instanceId, string title, IInteractiveEvaluator evaluator, __VSCREATETOOLWIN creationFlags)
{
_componentModel = model;
this.Caption = title;
_editorAdapters = _componentModel.GetService<IVsEditorAdaptersFactoryService>();
_evaluator = evaluator;
// The following calls this.OnCreate:
Guid clsId = this.ToolClsid;
Guid empty = Guid.Empty;
Guid typeId = providerId;
IVsWindowFrame frame;
var vsShell = (IVsUIShell)ServiceProvider.GlobalProvider.GetService(typeof(SVsUIShell));
// we don't pass __VSCREATETOOLWIN.CTW_fMultiInstance because multi instance panes are
// destroyed when closed. We are really multi instance but we don't want to be closed.
ErrorHandler.ThrowOnFailure(
vsShell.CreateToolWindow(
(uint)(__VSCREATETOOLWIN.CTW_fInitNew | __VSCREATETOOLWIN.CTW_fToolbarHost | creationFlags),
(uint)instanceId,
this.GetIVsWindowPane(),
ref clsId,
ref typeId,
ref empty,
null,
title,
null,
out frame
)
);
this.Frame = frame;
}
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:34,代码来源:VsInteractiveWindow.cs
示例12: ReplWindowTextViewCreationListener
public ReplWindowTextViewCreationListener(IVsEditorAdaptersFactoryService adaptersFactory, IEditorOperationsFactoryService editorOperationsFactory, [Import(typeof(SVsServiceProvider))]IServiceProvider serviceProvider, IEditorOptionsFactoryService editorOptionsFactory) {
_serviceProvider = serviceProvider;
_adaptersFactory = adaptersFactory;
_editorOperationsFactory = editorOperationsFactory;
_compModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));
_editorOptionsFactory = editorOptionsFactory;
}
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:7,代码来源:TextViewCreationListener.cs
示例13: PreviewEngine
public PreviewEngine(
string title,
string helpString,
string description,
string topLevelItemName,
Glyph topLevelGlyph,
Solution newSolution,
Solution oldSolution,
IComponentModel componentModel,
IVsImageService2 imageService,
bool showCheckBoxes = true)
{
_topLevelName = topLevelItemName;
_topLevelGlyph = topLevelGlyph;
_title = title;
_helpString = helpString;
_description = description;
_newSolution = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, cancellationToken: CancellationToken.None).Result;
_oldSolution = oldSolution;
_diffSelector = componentModel.GetService<ITextDifferencingSelectorService>();
_editorFactory = componentModel.GetService<IVsEditorAdaptersFactoryService>();
_componentModel = componentModel;
this.ShowCheckBoxes = showCheckBoxes;
_imageService = imageService;
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:25,代码来源:PreviewEngine.cs
示例14: ReplCSharpEditorSurface
public ReplCSharpEditorSurface()
{
_CurrentScriptName = System.IO.Path.GetFileName(VSTools.DefaultScriptFileName);
InitializeComponent();
this.DataContext = this;
_componentModel = (IComponentModel)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SComponentModel));
_EditorAdapterFactory = _componentModel.GetService<IVsEditorAdaptersFactoryService>();
}
开发者ID:pgourlain,项目名称:VSREPL,代码行数:8,代码来源:ReplCSharpEditorSurface.xaml.cs
示例15: AbstractResetInteractiveCommand
public AbstractResetInteractiveCommand(
VsInteractiveWindowProvider interactiveWindowProvider,
IServiceProvider serviceProvider)
{
_interactiveWindowProvider = interactiveWindowProvider;
_serviceProvider = serviceProvider;
_componentModel = (IComponentModel)GetService(typeof(SComponentModel));
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:AbstractResetInteractiveCommand.cs
示例16: Initialize
protected override void Initialize()
{
base.Initialize();
_componentModel = (IComponentModel)GetService(typeof(SComponentModel));
_exportProvider = _componentModel.DefaultExportProvider;
_vim = _exportProvider.GetExportedValue<IVim>();
}
开发者ID:aesire,项目名称:VsVim,代码行数:8,代码来源:VsVimPackage.cs
示例17: VsResetInteractive
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;
}
开发者ID:MischkowskyM,项目名称:roslyn,代码行数:8,代码来源:VsResetInteractive.cs
示例18: AbstractEditorFactory
protected AbstractEditorFactory(Package package)
{
_package = package ?? throw new ArgumentNullException(nameof(package));
_componentModel = (IComponentModel)ServiceProvider.GetService(typeof(SComponentModel));
_editorAdaptersFactoryService = _componentModel.GetService<IVsEditorAdaptersFactoryService>();
_contentTypeRegistryService = _componentModel.GetService<IContentTypeRegistryService>();
_waitIndicator = _componentModel.GetService<IWaitIndicator>();
}
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:9,代码来源:AbstractEditorFactory.cs
示例19: ServiceProviderBuildStrategy
public ServiceProviderBuildStrategy(IServiceProvider serviceProvider, ServiceLocatorOptions options)
{
if (serviceProvider == null)
throw new ArgumentNullException(nameof(serviceProvider), $"{nameof(serviceProvider)} is null.");
m_serviceProvider = serviceProvider;
m_componentModel = serviceProvider.GetService<SComponentModel, IComponentModel>();
m_options = options;
}
开发者ID:modulexcite,项目名称:AlphaVSX,代码行数:9,代码来源:ServiceProviderBuildStrategy.cs
示例20: WatchBraceHighlights
/// <summary>
/// Starts watching the provided text view for brace matching. When new braces are inserted
/// in the text or when the cursor moves to a brace the matching braces are highlighted.
/// </summary>
public static void WatchBraceHighlights(ITextView view, IComponentModel componentModel) {
var matcher = new BraceMatcher(view, componentModel);
// position changed only fires when the caret is explicitly moved, not from normal text edits,
// so we track both changes and position changed.
view.Caret.PositionChanged += matcher.CaretPositionChanged;
view.TextBuffer.Changed += matcher.TextBufferChanged;
view.Closed += matcher.TextViewClosed;
}
开发者ID:omnimark,项目名称:PTVS,代码行数:13,代码来源:BraceMatcher.cs
注:本文中的IComponentModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论