Hi I've been tinkering around with the two techniques to modify the ribbon with an MS Word addin (Visual Studio 2010, .NET 3.5), a Microsoft.Office.Tools.Ribbon.OfficeRibbon and Microsoft.Office.Core.IRibbonExtensibility. I was hoping to switch between the two in my addin's CreateRibbonExtensibilityObject, but for some reason it is not called now. The documentation says that if an addin implements CreateRibbonExtensibilityObject that it will be called. When I create a fresh project to test doing this very thing, it works. I'd prefer not to abandon my project as-is. Any ideas? Thank you.
They're not really interchangeable. The issue is that if you use the OfficeRibbon object (which is really pretty nice, it's got a nice designer etc) then IT implements the createribbonextensibility stuff and you don't have a chance to intercept it.
I did a blog post last year that discussed the problem with respect to adding support for the new Office 2010 "Backstage view" from a VSTO 3 addin (VSTO 3 doesn't support Backstage, but it's still doable, and you'd basically use the same technique to swap out implementations of the ribbon support).
the real question is, why bother? If you've done the work to support IExtensibility2 (and then have the ability to completely define your ribbon object in XML), there's not much of a need for the OfficeRibbon. and if you're using the officeribbon control, it can do jsut about everything you could do specifying the xml directly, so why suffer the pain?
Blog post here
http://www.vbfengshui.com/integrating-with-the-new-office-backstage-from-a-vsto-3-addin/
Related
Hello is there any tool/api available to generate a customize sequence diagram based on certain user input?
One way to attack this would be to use Visio (if your licensing scheme is compatible):
Here is a codeplex project that is supposed to make this easier from .NET (I haven't used it):
http://visioautomation.codeplex.com/
Another way to do this would be to just write some WPF code. I think that there are a number of open source projects that might help you in this effort as well.
A really expensive (but really good) implementation is from yWorks - it's yEd. I've used it and it's extremely powerful.
VS2010 provides such a feature, you might need the premium or ultimate version. If you need a whole bunch, you might write a macro or even an extension to VS.
I've been playing with Java for years as a means of developing quick and easy tools for repetitive tasks. I am not a true "developer" in the traditional sense, but I have lots of experience creating a wide assortment of tools and PoCs.
Unfortunately for me, I have noticed many shops are specifically looking for experience with C#, and not so many for Java. Even here on SO, there are more questions and more followers to C# related issues than Java. My preference will always be Java over C# simply for the cross-platform compatibility, but since the languages are so similar, I believe it would be beneficial for me to cross-train. I have already dabbled in other languages and scripts (VB and other BASIC flavors, Javascript, VBScript, ASP, JSP, PHP, etc.) so adding another isn't out of the question.
My current Java environment simply consists of a text editor (primarily jEdit for its plugins and layout) and homemade scripts to compile/jar my projects. I don't like to use IDEs because I want full control over my code and don't want a program writing code for me. (I also prefer to write my own code as opposed to using any sort of external library/package, if feasible. It helps me learn and greatly reduces unnecessary code.)
Therefore, what are my options for a non-IDE C# SDK? Libraries are obviously not that important to me. I've heard of Mono, which appears to separate the functions, but haven't tried it yet. What other SDKs exist that are similar to a simple Java SDK combined with a text editor?
Using an IDE doesn't have to mean anything writing code for you. I'm not generally keen on designer-generated code, but unless you decide to use a designer (or snippets etc), Visual Studio won't be writing code for you. Of course it will create a skeleton class for you when you create one, add the appropriate method signatures when you implement an interface etc - but is that boilerplate really something you want to write yourself?
I'd also suggest that your policy of not using external libraries is a bad one. I agree that it's useful for educational purposes to sometimes reimplement something, but it means that the code quality is likely to end up being worse... why would you not want to use code that has already been used and improved by many other people? Yes, you need to be careful about what libraries you use - but you really don't want to do everything yourself... not if you want to be productive, anyway.
I often use a text editor and command line myself for simple test code (e.g. for Stack Overflow questions) but I wouldn't dream of doing that for "real" code that I plan to keep.
Honestly, a lot of C# and .NET is about learning the tools; Visual Studio gives you a lot that you wouldn't be able to do with a text editor. There's a free version, and I highly suggest you check it out! People hiring will want to know that you're familiar with the tools they'll most likely be using.
You can just start with Notepad and csc.exe, the the command-line C# compiler that ships with the .NET SDK.
However, IDE is not necessarily synonym for code generator. I would download Visual Studio Express and start with empty Console projects.
Have fun!
Don't forget you can build/assemble C# projects using MSBuild and a .sln file if you really want. But the IDEs will make life a lot easier.
The IDE will not write code for you, it will help you writing code. Using libraries will help you concentrate on what you really want to program, not the things that already have been done.
Check into AvalonEdit, the text editor component of SharpDevelop. It is an open source text editor that has classes that could implement features such as intellisense and syntax highlighting. You would only have to use as much of it as you wanted and you could embed it anywhere you would use a text box control.
If you are familiar with Ant from Java then you could also check out NAnt to do your compile phase.
As far as I know, with Visual Studio you also get a command line C# compiler, csc. You could use a text editor and manually compile your C# code with that on the command line if you really want - that wouldn't be very practical however when your project contains more than a handful of source files.
If your project becomes bigger, you could use a tool like NAnt, which is a .NET version of the popular Java build tool Ant.
I agree with Jon Skeet about that your way of working is not very practical. If you are really looking for a software development job, you'd better learn to use the tools that other developers use. An employer will also not accept the fact that you'd want to write all the code yourself instead of using libraries. By using libraries instead of writing it all yourself you save lots of time, you are reusing well-tested code and your code will be much easier to maintain by other developers.
i am a junior c# programmer and would like to learn silverlight.
is silverlight for progrmmers or for designers?
It is for neither - Silverlight is simply the branding for the runtime engine, library set, etc. The only thing that "uses" Silverlight directly is (broadly speaking) the browser.
The important thing for developers is Visual Studio (regular or Express:Web), and for designers: the Expression suite. Both can contribute to a Silverlight project. Also consider that you may be targeting Moonlight, so even "Silverlight" becomes misleading.
Silverlight is for both developers/programmers and designers.
The User Interface of a Silverlight application is defined in XAML script, which is based upon XML.
Microsoft explicitly target the Microsoft Expression (specifically Expression Blend) suite of products at designers, whilst Microsoft's Visual Studio is aimed at developers (although Visual Studio 2010 can be used for design work as well).
If you have a designer and a programmer working together to create the overall Silverlight application, you can utilise a programming design pattern called MVVM (Model-View-ViewModel) to help separate the concerns between the UI and the back-end functional program code. This effectively allow the programmer to not really care about the names and ID values of specific UI elements that may have been defined by the designer, but simply to "bind" together specific User Interface elements with their "back-end" program code counterparts to create the complete Silverlight application.
It is for both.
Both,
As a programmer it's good to be familiar with the programming model, the related MVVM pattern, the object model etc.
As a designer you can build your designs in Blend and XAML. Then integrate them with the rest of the software
Both.
Usually a developer will do it all, but using the Expression products, designers and developers can work on the same project to utilise their skills.
I guess like most peep said, it is for both.
Being a developer myself, I tend to sway towards the coding.
But when I want to do animation, I will go back to xaml, which is way more simpler than doing in the code behind.
One good thing about silverlight that certainly prove that it is suitable for both is that, no matter how a designer place his UI and animations, and no matter how a developer codes, as long as 1 focus on functionality, another focus on UI.
Things will work out perfect, unless the designer deleted some UI that is suppose to have functionality. :)
It's for both.
However you're also going to need both developer and designer to make it quite good.
I want to write my first Visual Studio 2010 add-in. My aim is to create an add-in that helps to automatically generate code for things like:
implement superclass constructors
create delegation methods for composed object
etc.
Of course, in order to know what to generate, my add-in must have a knowledge of the code-file the user is going to insert generated code into. (classes, base-classes ...)
My first thought was to use a C#-parser. Is this the right way to go? Isn't there any .NET-Framework part, COM-Object or whatever "built-in"?
Thank you in advance.
P.S: Is noticed that CSharpCodeProvider's class Parse() method has not been implemented by Microsoft yet. -_-
You can get a lot of info from the MS Visual Studio Extensibility site. This post from the Visual Studio blog may also get you started with dealing with the in memory code file.
You could start by looking at EnvDTE, which will help you browse through project files and code trees already parsed and analyzed by Visual Studio, as well as modifying them. EnvDTE is pretty basic and error-prone (for the few times I used it). Finding good in-depth tutorials is also difficult.
If you're trying to implement such features yourself, good luck, it's definitely doable but the learning curve might be quite steep. Otherwise, you could have a look at ReSharper which already implements the features you're trying to code (and much more). Plus it also has a very well designed API compared to EnvDTE (although not very well documented), allowing to use its internal C# parser / analyzer.
I'm trying to evaluate C# code as it gets typed, think of it as if I'm trying to write an IDE.
So a person types code, I want to find out what code did he just write:
String x = "";
I want to now register that x is a type of String. And now everytime the user types x again, and I want to show him all the things he can do with x, basically like Visual Studio Intellisense.
Will I need some lexers or parsers for this? Will that make it easier? I've heard VS 2010 has some features around this that Microsoft has released. Any ideas?
You can use the DLR to help with this. See DLRPad on codeplex for an example
If you use the DLR interrogate types in the CLR more easy than using reflection in C#. last time I looked (about 9 months ago) I thought the intellisense had been implemented using this technique as we were going to do it the same way.
I would avoid trying to write this yourself if you can. SharpDevelop is an open source .NET IDE which has Intellisense-like functionality. I believe you can embed their editor in your own project. According to Wikipedia, the license is LGPL so you could probably use it even in closed source projects. Of course, you should verify this for yourself before doing so.
Actipro SyntaxEditor is a third party control you can buy which does this. There are WinForms and WPF versions of the control. It has worked well for us. It doesn't currently support Intellisense with LINQ and lambda expressions. I don't know if SharpDevelop supports this or not.
I don't think .NET 4 has anything to help with this. You might look at Mono REPL. It also might help if you give more details about what you actually want to do.