I create the simple Windows Forms Application project in vs 2019 version 16.3.1 with target .NetCore 3.0.
when I'm trying to use the SqlClient in System.Data.SqlClient and use the open Method, Appears two open() Methods.
one of this method has * chars, that is IntelliCode Suggestion.
this image:
how to use IntelliCode Suggestion?
IntelliCode appends suggestions based on context on top of the suggestion list (with a star). In your case it means that based on the context you are the most common used property/method is Open(). Both Open methods in the list are the same.
Related
Can I create an extension for Visual Studio that runs in the background as soon as the user opens the Visual Studio IDE? For example, I am building an extension that gets the current active file address in Visual Studio (with C#), but I would like this extension to always run in the background without having to be activated by the user clicking a button or pressing some key combination.
Is this possible, and if so, what is the best way of doing it?
Any help would be greatly appreciated! Regards, Erfan
Since you tagged your question with visual-studio-2010 I assume you are working on an "Add-in" rather than a "VSPackage Extensions".
In this case, you can use the OnConnection event handler.
If you are working on a VSPackage Extensions, you can use the attribute ProvideAutoLoad.
Just search for these, you will find sufficient information. Both ways are also described shortly here under "How can I run my add-in code in a VSPackage?"
For Extension add following attribute to Package class, this will load the extension when a solution is not open in visual studio. I have tested this with VS 2015 and 2017.
[ProvideAutoLoad(UIContextGuids80.NoSolution)]
For VS 2010 and higher the recommended extensibility approach is a package (VS 2015 won't allow add-ins).
To get the package loaded when Visual Studio is loaded see HOWTO: Autoload a Visual Studio package.
Once loaded, your package may be interested in two different kind of selection change events:
To get notified when the selection in the Solution Explorer changes, get the IVsMonitorSelection interface and call the AdviseSelectionEvents/UnadviseSelectionEvents and provide a class that implements the IVsSelectionEvents interface.
To get notified when the active window changes (which can be a document window or a toolwindow), implement the IVsWindowFrameNotify interface.
I want to write an Editor extension for Visual Studio 2010.
In my extension I want to get information about the Class, method which is at the current caret position.
For example, if I am in an Event Handler and I have some code that shows a MessageBox using MessageBox.show(…) and the caret is at .Show,
I want to query VS Services to get a response which tell me that I the caret is at Show method of MessageBox class which is in System.Windows.Froms.dll version 4.0.40319 etc.
Is it possible?
There is no way to do this with the current APIs in Visual Studio 2010. This is why we're building the Roslyn APIs so you could. When you install the CTP, we setup a Roslyn instance that replaces the standard language services with the Roslyn ones, and you can ask your question directly to it.
If you don't want to be dependent upon running in the Roslyn instance (which I assume is the case), then it gets a bit trickier. You can invoke the parsers to understand you're on a call named MessageBox.Show, but to get the semantics you'd have build up a Compilation making sure you get all the project references and source files right. That's a far trickier proposition, so depending on your scenario you might want to "cheat" as much as possible.
Disclosure: I'm on the Roslyn team.
I have control designed for VS2008 and VS2010. Will it work in Power Builder 12 designer as well? or Would I need to create any design.dll
It depends on the control but in general PowerBuilder 12 (and prior versions) can use external controls via OLE without any problem. You add them to your application via Insert --> Control --> OLE menu item, then you'll be prompted with a list of registered object to select from.
When coding you'll need to use the "object reference" or dot notation to reference properties and/or methods. Everything works fine in PB but it's not as user friendly you can't do named arguments and need to get your syntax just (and catch exceptions) right to avoid null object reference crashes.
Hope that I understood your question correctly and this helps.
Regards,
Rich
what version of PowerBuilder are you targetting? If its a .Net control and you are targetting PB.Net, its based on the visual studio shell and will work fine with what you've done for Visual Studio.
Developing Java with Eclipse, it's easy to move variables from one class to another, and have the references be updated. (So if you move size from being a class variable to a class named Constants, every reference to size in the original class will be replaced by Constants.size automatically.)
Is there a way to do this in C# XNA Visual Studio 2010?
The Devexpress RefactorPro! plugin has similar refactorings (though not I don't think that exact one). I think they're even all available in the free version. If you want a specific one that's not available though you can check the free DxCore plugins page or develop one yourself. It's not all that hard.
All the links are on the DxCore community plugins page.
Oh but, to answer your question very specifically no, I have never heard of that exact refactoring being available anywhere - it's not generally seen as CSharp-y.
Move variable is not one of the refactoring operations that is supported by C# out of the box in Visual Studio 2010 (or 2008 / 2005 for that matter). In order to get that kind of operation you will need to use a 3rd party plugin such as Resharper or DevExpress`s RefactorPro.
Is it possible to enable users to drag and drop a Table from the Visual Studio Server Explorer onto my own DSL Diagram?
I can drop custom Domain Classes I have created but want to make use of the build in funcationality.
I am working in Visual Studio 2010.
I suppose you could override the CreateDiagramView method in your DocView class, and call CreateDiagramView to get to the diagram. From there, you could listen to the DragDrop event. If you can understand what was dropped on you, you could do something with it.
Note: I haven't tested any of this - just happened to have a DSL open and played a bit.
You can find a working example here
http://altinoren.com/activewriter/