I started C# a while ago and really like it.
I work with VS 2008 and really like it.
I tried Resharper and loved it.
Now I am starting with Macros in VS2008 to increase my coding speed a little more. And stumble upon visual basic. And I do not like that.
Is there any way to write macros in C#. Or a workaround, in writing a plugin for VS to reach the same goal. Just let me stress out, its a productivity issue. I just want to automate some features I use often (create macro, assign shortcut, tell my touchscreen-app to send this shortcut)...
So from an experts point of view, is there an easy way to e.g. "collapse all items in the solution explorer, but expand all starting with the letter A" (just a silly example) without using visual basic?
Thanks for any tips,
Chris
PS: I was nearly happy with recording and playback. But, as it turns out, some "external" resharper command (like collapse all) do not play well with macros (getting strange com errors). So I thought, hey, a loop to collapse all items, I can do that. But unfortunately not really quick in VB :-)
Try writing a DLL in C# and referencing it in a VB macro.
This way, the only VB you'll need to write is the code to connect the DLL to the IDE.
Unfortunately no, Visual Studio only supports VB.NET for macros.
I wouldn't stress too much about not having C# for macros (many C# developers seem mortified that VB.NET code will stick to their shoe like toilet paper). Rather take pride in your ability to be productive in multiple languages!
Visual Commander (developed by me) lets you write Visual Studio 2010+ (macro) commands in C#.
Snippets are the closest which I've come across. Snippet Editor 2.1 does a pretty good job setting them up without to much hassle.
Related
This extension is broken for me. I already contacted the developer and the bug will be fixed upon it's next release. In the meantime, I'd really like to start learning DirectX (but I want to keep a safe distance from C++). Could anyone be so kind as to copy and paste the template the extension creates in it's whole? And also give me a list of the references it adds to the project. Thanks a lot. Sorry if the question is not well written, but I'm very ill at the moment. Thanks for any cooperation.
I would like to develop an add-in for Microsoft PowerPoint. I have Visual Studio 2012 installed and ready, but i can't seem to find any simple tutorials or getting started guides on the subject except this brilliant (sarcasm) guide from Microsoft:
http://msdn.microsoft.com/en-us/library/vstudio/cc668192.aspx
I have been searching the net for a few days, but without any luck.
Is there anyone with experience in developing add-ins for PowerPoint, who could give me a hint on how to get started?
It would be great to know if you prefer Visual Basic or C# and why.
Lastly, sorry if I sound like a rookie. I am for sure.
Kind regards.
http://blogs.msdn.com/b/jasonz/archive/2012/05/24/my-favorite-features-creating-storyboards-with-powerpoint.aspx
http://www.codeproject.com/Articles/420406/PowerPoint-timer-addin
http://msdn.microsoft.com/en-us/library/office/bb960904%28v=office.12%29.aspx
I guess these are good one's for starting up...with code..
Visual Basic (.NET, I assume) or C#?
If you're new to automating PowerPoint, neither.
Use VBA. It's built into PPT, much quicker to work with, you can test little snippets of code right there in the IDE w/o having to compile first.
If you decide you want to move it into VB.NET or C# later, it shouldn't be that big a struggle, assuming you know either of those tongues.
Or once having developed it, you can save the PPT containing your VBA as an add-in (PPA or PPAM file, depending on the version of PPT you want to target). And distribute it with very little more than that needed; no megs of runtimes/frameworks etc.
I'm working on a visual studio 2010 extension and was wondering on how to obtain an existing language service ( the one for C# specifically ). All the articles I've seen on the web so far are about "Implementing your own language service", but I haven't been able to find any info on obtaining an M<existing one.
Just to provide some context here, the extension needs to open a custom wpf form on demand,in which i want to host a C# code editor window.
I'm not yet sure this is even possible, however any tips would be appreciated.
Well, it took me forever to word this question correctly, but I found a blog post answering the question on Google: Hosting the C# Code Editor in a Tool Window
I know it's kind of rude to just dump a link, but helpful nonetheless I hope.
One thing you can have a look at is the Roslyn CTP. I've seen a demo of it at the Dutch Tech Days last week and it looks quite nice.
It can help you in hosting your own coding environment and easily compile snippets. But it's still really beta and it doesn't support all the language features yet.
This question already has answers here:
C# Console/CLI Interpreter?
(17 answers)
Closed 7 years ago.
Some programming language implementations provide a Read, Evaluate, Print Loop interactive shell to allow the programmer to evaluate expressions and program fragments, and to program in an incremental, interactive manner.
What implementations of a C# REPL have you used, and liked? It would be nice to have one that could integrate with Visual Studio as well.
I have found, but not tried, the Mono C# REPL and Don Box's C# REPL
Mono comes with a REPL tool called "csharp". I just tried it on Mac OS X and it works like magic. The only feature it currently lacks is Intellisense, promised to appear in Mono 2.6
Visual Studio 2008 includes REPL-like capabilities, though I wouldn't necessarily call them "good". I think they have the advantage of being included and always available--which can be handy when trying to do work at a workstation other than your own.
In Visual Studio, you can instantiate and invoke methods of objects using the Object Test Bench. You can also write interactive C# code (with many limits) using the Immediate Window (Debug->View->Immediate Window). Immediate Window can be used outside of a debugging session.
The best tool I've found for writing interactive c# code is the C# Snippet Compiler.
Not sure if it's exactly REPL but it is a great way to test out almost anything using C#/.NET.
It supports framework versions up to 3.5. It is not designed to integrate directly with Visual Studio, however it even provides its own intellisense.
Of course it's very easy to copy/export the code from this into your Visual Studio projects.
One that I've only seen is at the end of this video from PDC where Hejlsberg is going beyond C#4.
I do not know of an interactive shell for running c# code snippets. There is one for the mono project, but I have not tried it: http://www.mono-project.com/CsharpRepl
I tried the C# snippet compiler, and it seems to be pretty much the same as creating a new console application in Visual Studio, but with limited intellisense, and none of the debugging features.
Right now I use the built in console application template anytime I want to try out simple input-output type experimental code. I use console Console.ReadLine() and Console.WriteLine() for input and output.
It actually works pretty well for me. I typically save all my little test programs so I can go back and find something I worked with a few months ago, and you get the full debugging features of Visual Studio.
Have you tried the VisualStudio C# REPL - O2 Platform (v5.1) plugin (more info at O2Platform question on 'Interactive development with Visual Studio' )
There is also the stand alone version C# REPL Script (see this readme for more details on the APIs https://github.com/o2platform/FluentSharp/blob/master/README.md )
Will making WPF forms in VS2010 be easier than it is now? I’m just a beginner and I’m finding just learning C# itself is a ton of info to get my head around. But I’ve seen some projects done with WPF and they look awesome. Is it worth my time to start looking into WPF now, or wait till VS2010 where, if I understand correctly, there are better tools for working with it?
Thanks
Even given its improvements, VS 2010 will not suddenly become the holy grail of WPF application creation. You're better off learning the fundamentals (binding, templates, commands, etc) of .NET 3.0/3.5 now. I'd also recommend downloading the trial of Expression Blend if you're interested in the visual aspects of WPF. While you can certainly do most everything coding XAML by hand, Blend makes it much quicker.
Visual Studio will provided better tools to work with WPF, see here for details.
We certainly hope you will find the new Visual Studio 2010 WPF and Silverlight designer helps make working with Forms easier than it was in Visual Studio 2008.
Check out this link for some useful resources on the new designer:
http://blogs.msdn.com/wpfsldesigner/pages/faq-for-wpf-and-silverlight-designer-in-visual-studio-2010.aspx
Let us know what you think!
Mark Wilson-Thomas
Program Manager, WPF & Silverlight Designer, Visual Studio