本文整理汇总了C#中VisualStudio类的典型用法代码示例。如果您正苦于以下问题:C# VisualStudio类的具体用法?C# VisualStudio怎么用?C# VisualStudio使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VisualStudio类属于命名空间,在下文中一共展示了VisualStudio类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: EnumFilenames
public int EnumFilenames(out VisualStudio.OLE.Interop.IEnumString ppEnumString)
{
// this method doesn't work. no matter what I do, EnumString throws
// a null ref inside of Next
ppEnumString = new EnumString(this.pathProvider);
return VSConstants.E_NOTIMPL;
}
开发者ID:ligershark,项目名称:vsfolders,代码行数:7,代码来源:FindScope.cs
示例2: VsTextViewCreated
public void VsTextViewCreated(VisualStudio.TextManager.Interop.IVsTextView textViewAdapter)
{
ITextView textView = AdapterService.GetWpfTextView(textViewAdapter);
if (textView != null) {
BraceMatcher.WatchBraceHighlights(textView, IronRubyToolsPackage.ComponentModel);
}
}
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:TextViewCreationListener.cs
示例3: TextViewCreated
public override void TextViewCreated(IReplWindow window, VisualStudio.Text.Editor.ITextView view)
{
var adapterFactory = IronPythonToolsPackage.ComponentModel.GetService<IVsEditorAdaptersFactoryService>();
new EditFilter(IronPythonToolsPackage.ComponentModel.GetService<IPythonAnalyzer>(), (IWpfTextView)view, adapterFactory.GetViewAdapter(view));
window.UseSmartUpDown = IronPythonToolsPackage.Instance.OptionsPage.ReplSmartHistory;
base.TextViewCreated(window, view);
}
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:RemotePythonVsEvaluator.cs
示例4: DismissAllSessions
public void DismissAllSessions(VisualStudio.Text.Editor.ITextView textView) {
foreach (var session in _stackMap.GetStackForTextView(textView).Sessions) {
if (session is ISignatureHelpSession) {
session.Dismiss();
}
}
}
开发者ID:omnimark,项目名称:PTVS,代码行数:7,代码来源:MockSignatureHelpBroker.cs
示例5: TriggerSignatureHelp
public ISignatureHelpSession TriggerSignatureHelp(VisualStudio.Text.Editor.ITextView textView) {
ObservableCollection<ISignature> sets = new ObservableCollection<ISignature>();
var session = new MockSignatureHelpSession(
textView,
sets,
textView.TextBuffer.CurrentSnapshot.CreateTrackingPoint(
textView.Caret.Position.BufferPosition.Position,
PointTrackingMode.Negative
)
);
foreach (var provider in _sigProviders) {
foreach (var targetContentType in provider.Metadata.ContentTypes) {
if (textView.TextBuffer.ContentType.IsOfType(targetContentType)) {
var source = provider.Value.TryCreateSignatureHelpSource(textView.TextBuffer);
if (source != null) {
source.AugmentSignatureHelpSession(session, sets);
}
}
}
}
if (session.Signatures.Count > 0 && !session.IsDismissed) {
_stackMap.GetStackForTextView(textView).PushSession(session);
}
return session;
}
开发者ID:omnimark,项目名称:PTVS,代码行数:28,代码来源:MockSignatureHelpBroker.cs
示例6: RenderCompleteDiagramToView
public static void RenderCompleteDiagramToView(VisualStudio visualStudio, ref ArchView view)
{
var modelGen = new DiagramGenerator(visualStudio.Solution);
var tree = modelGen.GenerateDiagram(DiagramDefinition.RootDefault);
var viewModel = LayerMapper.TreeModelToArchViewModel(tree,true,true);
view.Diagram.RenderModel(viewModel);
}
开发者ID:davidkron,项目名称:DevArch,代码行数:7,代码来源:DevArch.cs
示例7: GetBufferAdapter
public VisualStudio.TextManager.Interop.IVsTextBuffer GetBufferAdapter(VisualStudio.Text.ITextBuffer textBuffer) {
MockVsTextLines textLines;
if (!textBuffer.Properties.TryGetProperty<MockVsTextLines>(typeof(MockVsTextLines), out textLines)) {
textBuffer.Properties[typeof(MockVsTextLines)] = textLines = new MockVsTextLines(_serviceProvider, (MockTextBuffer)textBuffer);
}
return textLines;
}
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:7,代码来源:MockVsEditorAdaptersFactoryService.cs
示例8: IsSignatureHelpActive
public bool IsSignatureHelpActive(VisualStudio.Text.Editor.ITextView textView) {
foreach (var session in _stackMap.GetStackForTextView(textView).Sessions) {
if (session is ISignatureHelpSession) {
return true;
}
}
return false;
}
开发者ID:omnimark,项目名称:PTVS,代码行数:8,代码来源:MockSignatureHelpBroker.cs
示例9: NormalCompletionAnalysis
public NormalCompletionAnalysis(VsProjectAnalyzer vsProjectAnalyzer, ITextSnapshot snapshot, VisualStudio.Text.ITrackingSpan applicableSpan, VisualStudio.Text.ITextBuffer textBuffer, GetMemberOptions options)
: base(applicableSpan, textBuffer) {
_analyzer = vsProjectAnalyzer;
_snapshot = snapshot;
_applicableSpan = applicableSpan;
_textBuffer = textBuffer;
_options = options;
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:8,代码来源:NormalCompletionAnalysis.cs
示例10: RequireCompletionAnalysis
public RequireCompletionAnalysis(VsProjectAnalyzer vsProjectAnalyzer, ITextSnapshot snapshot, VisualStudio.Text.ITrackingSpan applicableSpan, VisualStudio.Text.ITextBuffer textBuffer, bool quote)
: base(applicableSpan, textBuffer) {
_analyzer = vsProjectAnalyzer;
_snapshot = snapshot;
_applicableSpan = applicableSpan;
_textBuffer = textBuffer;
_quote = quote;
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:8,代码来源:RequireCompletionAnalysis.cs
示例11: VsTextViewCreated
internal IPythonAnalyzer PythonAnalyzer = null; // Set by MEF
#endregion Fields
#region Methods
public void VsTextViewCreated(VisualStudio.TextManager.Interop.IVsTextView textViewAdapter)
{
// TODO: We should probably only track text views in Python projects or loose files.
ITextView textView = AdapterService.GetWpfTextView(textViewAdapter);
if (textView != null) {
PythonAnalyzer.AnalyzeTextView(textView);
}
}
开发者ID:TerabyteX,项目名称:main,代码行数:14,代码来源:XamlTextViewCreationListener.cs
示例12: GetSessions
public ReadOnlyCollection<ISignatureHelpSession> GetSessions(VisualStudio.Text.Editor.ITextView textView) {
List<ISignatureHelpSession> res = new List<ISignatureHelpSession>();
foreach (var session in _stackMap.GetStackForTextView(textView).Sessions) {
if (session is ISignatureHelpSession) {
res.Add(session as ISignatureHelpSession);
}
}
return new ReadOnlyCollection<ISignatureHelpSession>(res);
}
开发者ID:omnimark,项目名称:PTVS,代码行数:9,代码来源:MockSignatureHelpBroker.cs
示例13: GotoSource
protected override void GotoSource(VisualStudio.Shell.Interop.VSOBJGOTOSRCTYPE gotoType)
{
// We do not support the "Goto Reference"
if (VSOBJGOTOSRCTYPE.GS_REFERENCE == gotoType)
{
return;
}
base.OpenSourceFile();
}
开发者ID:klewin,项目名称:NDjango,代码行数:10,代码来源:ModelNode.cs
示例14: EditFilterQueryStatus
public override int? EditFilterQueryStatus(ref VisualStudio.OLE.Interop.OLECMD cmd, IntPtr pCmdText) {
var activeView = CommonPackage.GetActiveTextView(_serviceProvider);
if (activeView != null && activeView.TextBuffer.ContentType.IsOfType(PythonCoreConstants.ContentType)) {
cmd.cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
} else {
cmd.cmdf = (uint)(OLECMDF.OLECMDF_INVISIBLE);
}
return VSConstants.S_OK;
}
开发者ID:omnimark,项目名称:PTVS,代码行数:10,代码来源:RemoveImportsCurrentScopeCommand.cs
示例15: RefactoringSetup
private static void RefactoringSetup(TestWorkspace workspace, CodeRefactoringProvider provider, List<CodeAction> refactorings, out ICodeActionEditHandlerService editHandler, out EditorLayerExtensionManager.ExtensionManager extensionManager, out VisualStudio.Text.ITextBuffer textBuffer)
{
var document = GetDocument(workspace);
var span = document.GetSyntaxRootAsync().Result.Span;
var context = new CodeRefactoringContext(document, span, (a) => refactorings.Add(a), CancellationToken.None);
provider.ComputeRefactoringsAsync(context).Wait();
var action = refactorings.Single();
editHandler = workspace.ExportProvider.GetExportedValue<ICodeActionEditHandlerService>();
extensionManager = document.Project.Solution.Workspace.Services.GetService<IExtensionManager>() as EditorLayerExtensionManager.ExtensionManager;
textBuffer = document.GetTextAsync().Result.Container.GetTextBuffer();
}
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:11,代码来源:PreviewExceptionTests.cs
示例16: EditFilterQueryStatus
public override int? EditFilterQueryStatus(ref VisualStudio.OLE.Interop.OLECMD cmd, IntPtr pCmdText) {
var view = CommonPackage.GetActiveTextView(_serviceProvider);
var analyzer = view?.GetAnalyzerAtCaret(_serviceProvider);
var pythonCaret = view?.GetPythonCaret();
if (view != null && analyzer != null && pythonCaret.HasValue) {
cmd.cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
} else {
cmd.cmdf = (uint)(OLECMDF.OLECMDF_INVISIBLE);
}
return VSConstants.S_OK;
}
开发者ID:jsschultz,项目名称:PTVS,代码行数:12,代码来源:RemoveImportsCommand.cs
示例17: QueryStatusCommand
protected override int QueryStatusCommand(uint itemid, ref Guid pguidCmdGroup, uint cCmds, VisualStudio.OLE.Interop.OLECMD[] prgCmds, IntPtr pCmdText) {
if (pguidCmdGroup == GuidList.guidOfficeSharePointCmdSet) {
for (int i = 0; i < prgCmds.Length; i++) {
// Report it as supported so that it's not routed any
// further, but disable it and make it invisible.
prgCmds[i].cmdf = (uint)(OLECMDF.OLECMDF_SUPPORTED | OLECMDF.OLECMDF_INVISIBLE);
}
return VSConstants.S_OK;
}
return base.QueryStatusCommand(itemid, ref pguidCmdGroup, cCmds, prgCmds, pCmdText);
}
开发者ID:zooba,项目名称:PTVS,代码行数:12,代码来源:PythonWebProject.cs
示例18: VsTextViewCreated
public void VsTextViewCreated(VisualStudio.TextManager.Interop.IVsTextView textViewAdapter) {
// TODO: We should probably only track text views in Python projects or loose files.
ITextView textView = AdapterService.GetWpfTextView(textViewAdapter);
if (textView != null) {
var analyzer = textView.GetAnalyzer(_serviceProvider);
if (analyzer != null) {
var monitorResult = analyzer.MonitorTextBuffer(textView, textView.TextBuffer);
textView.Closed += TextView_Closed;
}
}
}
开发者ID:omnimark,项目名称:PTVS,代码行数:12,代码来源:XamlTextViewCreationListener.cs
示例19: EditFilterQueryStatus
public override int? EditFilterQueryStatus(ref VisualStudio.OLE.Interop.OLECMD cmd, IntPtr pCmdText)
{
var activeView = CommonPackage.GetActiveTextView();
if (activeView != null && activeView.TextBuffer.ContentType.IsOfType(RubyCoreConstants.ContentType)) {
if (activeView.Selection.IsEmpty || activeView.Selection.Mode == TextSelectionMode.Box) {
cmd.cmdf = (uint)(OLECMDF.OLECMDF_SUPPORTED);
} else {
cmd.cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
}
} else {
cmd.cmdf = (uint)(OLECMDF.OLECMDF_INVISIBLE);
}
return VSConstants.S_OK;
}
开发者ID:TerabyteX,项目名称:main,代码行数:15,代码来源:SendToReplCommand.cs
示例20: GetDesiredIndentation
public int? GetDesiredIndentation(VisualStudio.Text.ITextSnapshotLine line) {
var dte = (EnvDTE.DTE)NodejsPackage.GetGlobalService(typeof(EnvDTE.DTE));
var props = dte.get_Properties("TextEditor", "Node.js");
switch ((EnvDTE._vsIndentStyle)(int)props.Item("IndentStyle").Value) {
case EnvDTE._vsIndentStyle.vsIndentStyleNone:
return null;
case EnvDTE._vsIndentStyle.vsIndentStyleDefault:
return DoBlockIndent(line);
case EnvDTE._vsIndentStyle.vsIndentStyleSmart:
return DoSmartIndent(line);
}
return null;
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:15,代码来源:SmartIndent.cs
注:本文中的VisualStudio类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论