Is the redistributable ReportViewer 2010 RC available in other languages? - visual-studio-2010

I need to deploy the language packs for the ReportViewer 2010 control (the english one is installed and working perfectly). Before, with ReportViewer 2008 and 2005, all the supported laguages were available on the MS downloads site. I can't seem to find them for the RC of 2010 -- are they available anywhere?
From MSDN:
To use the localized version of the
ReportViewer control redistributable
that comes with Visual Studio, do the
following:
1.Run ReportViewer.exe.
2.Navigate to the folder that contains the language pack you want to use.
Language pack folders are located at
%PROGRAMFILES%\Microsoft
SDKs\Windows\v7.0A\BootStrapper\Packages\ReportViewer\.
3.Run ReportViewerLP.exe.
Is there a generic language pack for VS 2010 RC that would have the localized report viewers as well?

It is not more easy to implement the IReportViewerMessages3 interface?
From MSDN
public interface IReportViewerMessages3 :
IReportViewerMessages2, IReportViewerMessages
This implementation is loaded by the ReportViewer control via a custom application setting in the Web.config configuration file with the key ReportViewerMessages
<appSettings>
<add key="ReportViewerMessages" value="MyNamespace.MyClass, APP_CODE" />
</appSettings>
Or if you are on winForms or WPF:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
CCustomMessageClass myMessageClass = new CCustomMessageClass();
reportViewer1.Messages = myMessageClass;
this.reportViewer1.RefreshReport();
}
}
public class CCustomMessageClass : IReportViewerMessages
{
#region IReportViewerMessages Members
public string BackButtonToolTip
{
get { return ("BackButtonToolTip here."); }
}
...
#endregion
}

Related

How to detect that Library code is executed within VS Addin or VS Package vsix

I use Addin in VS 2010 and VS Package (vsix) in VS 2012.
Addin and VSPackage uses common libraries.
I need detect if the library code (in execution time) is executed by Addin OR VSPackage.
Now, I have this code, but always true for Addin AND VSPackage
public static bool VSAddinVSPackageMode
{
get { return (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"); }
}
I would like
public static bool VSAddinMode { get { ... } }
public static bool VSPackageMode { get { ... } }
Any suggestions for do best way about it?
Add-ins and packages are like different installers for the code. The actual code is the same and executed in the same VS process.
To detect the caller, if you know your host module names, you can walk the call stack until you find the add-in or package module.
You should probably not be using add-ins for Visual Studio 2010 or newer, but that's beside the point.
Add-Ins always use the same entry point. You could use a property like the following:
public bool VSAddinMode
{
get;
internal set;
}
Then, in your OnConnection method, set VSAddinMode = true; before calling other code.
VS Packages do not always have a single entry point, so the best way to implement VSPackageMode is the following:
public bool VSPackageMode
{
get { return !VSAddinMode; }
}

Extending VS2012 Javascript Intellisense with custom ICompletionSourceProvider

I have created a new classes like following
[Order(Before = "High")] [Export(typeof(ICompletionSourceProvider))]
[ContentType("JavaScript"), Name("EnhancedJavaScriptCompletion")]
internal sealed class JavaScriptCompletionSourceProvider
: ICompletionSourceProvider
{ }
And the CompletionSource
internal sealed class CompletionSource : ICompletionSource, IDisposable
{
public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
{
}
public void Dispose()
{
}
}
These are both Added to a Visual Studio Package project.
So when I try to debug (with F5) I can see the debugging symbols are loading and the debugging stops in the
protected override void Initialize()
{
Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
base.Initialize();
}
However when I'm editing a .js file, and invoking the intellisense (with that . dot that is) the deubbger won't break into ICompletionSourceProvider nor ICompletionSource methods of my classes.
So my question are:
1-5 Questions about standard Javascript Intellisense addressed in this screencast http://screencast.com/t/TwDlnpfOV0bX
6 how can we extend the standard javascript intellisense with extra options?
7 Is it possible to have two ICompletionSourceProvider classes for the same ContentType?
The reason your extension isn't getting composed is you haven't added it as MEF component to in your .vsixmanifest. To add it,
open the .vsixmanifest designer by double clicking the file in your solution explorer.
click asserts
click "new" on the right-hand-side
choose "Microsoft.VisualStudio.MefComponent" as the type
choose "project in current solution
choose your extension project

Getting the current project directory from experimental instance of visual studio 2010?

I'm currently implementing uml validation http://msdn.microsoft.com/en-us/library/ee329482.aspx,
when i debug, it opens a new experimental instance of visual studio for me to validate uml diagrams.
Is there a way to get the path of project directory selected by the user when the experimental instance of visual studio is running??
To be more clear,
project A - has VSIX and Class library components to validate uml validation. These class Library components are added to VSIX as MEF components
when i debug Project A -> new experimental instance of VS will open-> Then creating a new project (ctrl+shift+N)-> select modelling project-> browse to the directory (to store the modelling project)->Name the Project as "MYMODEL" -> then press OK
Now, In my Project A i need the path of MYMODEL. Can you please tell me how do i get that path??
Thanks in Advance,
This is a bit roundabout, but works.
You need references to EnvDTE and Microsoft.VisualStudio.Shell.Immutable.10.0 as well as the usual bits.
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.ArchitectureTools.Extensibility;
using Microsoft.VisualStudio.ArchitectureTools.Extensibility.Uml;
using Microsoft.VisualStudio.Modeling.Validation;
using Microsoft.VisualStudio.Uml.AuxiliaryConstructs;
namespace Validation
{
public class MyValidationExtensions
{
[Import]
public Microsoft.VisualStudio.Shell.SVsServiceProvider ServiceProvider { get; set; }
[Export(typeof(System.Action<ValidationContext, object>))]
[ValidationMethod(
ValidationCategories.Open
| ValidationCategories.Menu)]
public void ValidateClassNames
(ValidationContext context,
// This type determines what elements
// will be validated by this method:
IModel elementToValidate)
{
IModelStore store = elementToValidate.GetModelStore();
EnvDTE.DTE dte = ServiceProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
//dynamic projects = dte.ActiveSolutionProjects;
foreach (EnvDTE.Project project in dte.Solution.Projects)
{
IModelingProject mp = project as IModelingProject;
if (mp.Store == store)
{
System.Windows.Forms.MessageBox.Show(project.FullName);
}
}
}
// Add more validation methods for different element types.
}
}

How to encapsulate User Setting (Options Page) in Visual Studio 2010 AddIn

I'm currently developping a Visual Studio Extension and I have a question about Options Page. Options Page allows user to save setting about your Extension. Visual Studio handle a lot of work for us.
I created the Options Page.
public class VisualStudioParameter : DialogPage
{
private string _tfsServerUrl = DefaultParameter.TfsServerUrl;
[Category("TFS Parameters")]
[DisplayName(#"Server Name")]
[Description("The URL of your TFS Server")]
public string TfsServerUrl
{
get { return _tfsServerUrl; }
set { _tfsServerUrl = value; }
}
}
First, I created a method in the Visual Studio Package to acces to the Options Page.
Okay so now, from my Package, I can easily acces to the settings.
partial class SpecFlowTfsLinkerExtensionPackage : Package : IParameter
{
....
....
public string GetTfsServerUrl()
{
return ((VisualStudioParameter) GetDialogPage(typeof (VisualStudioParameter))).TfsServerUrl;
}
}
Now, I want to be able, in another library (Another project, included in the VSIX Package), to get easily these values. I don't want to reference the Visual Studio AddIn Package in my library.
I also have Unit Test so I'm going to create an Interface. During Unit Test, I going to Mock the object.
public interface IParameter
{
string GetTfsServerUrl();
}
Do you have any idea about how I can develop a clean solution to get these parameters from another assembly ?
Do you think the better solution is to inject the AddIn dependency in my library ?
If you already developed a Visual Studio Extension, How did you encapsulated the user setting from your core assembly ?
Thanks a lot.
You can try something like that:
// Access DTE infrastructure
EnvDTE.DTE dte = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
// Access options page
var props = dte.get_Properties(#"Your Extension", "General");
var pathProperty = props.Item("TfsServerUrl");
path = pathProperty.Value as string;

Setting a registry value based on dialog in a visual studio setup project

I have visual studio setup project with a custom RadioButtons dialog.
How do I get it to write the value of the ButtonProperty in the registry after it is selected in the UI?
If using a .Net Installer class do the following:
Pipe the data through to your Custom Action using CustomActionData eg: If your property is called MYPROP: /MyVar=[MYPROP]
You can now access the data from your installer class:
protected override void OnAfterInstall(IDictionary savedState) {
string myVar = Context.Parameters["MyVar"];
RegistryKey key = Registry.LocalMachine;
using (key = key.CreateSubKey(#"SOFTWARE\MyCompany\MyApp")) {
key.SetValue("MyVar", myvar);
key.Close();
}
}

Resources