本文整理汇总了C#中VisualStudio类的典型用法代码示例。如果您正苦于以下问题:C# VisualStudio类的具体用法?C# VisualStudio怎么用?C# VisualStudio使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VisualStudio类属于命名空间,在下文中一共展示了VisualStudio类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: VsTextViewCreated
public void VsTextViewCreated(VisualStudio.TextManager.Interop.IVsTextView textViewAdapter)
{
ITextView textView = AdapterService.GetWpfTextView(textViewAdapter);
if (textView != null) {
BraceMatcher.WatchBraceHighlights(textView, IronRubyToolsPackage.ComponentModel);
}
}
示例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);
}
示例4: DismissAllSessions
public void DismissAllSessions(VisualStudio.Text.Editor.ITextView textView) {
foreach (var session in _stackMap.GetStackForTextView(textView).Sessions) {
if (session is ISignatureHelpSession) {
session.Dismiss();
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}