resources

Can't add resources to visual C# 2008 express??

I'm trying to add an image to the resource area of my application and not having very good luck. Is this broken in C# express? I've tried: Add image to project using 'Add->Existing Item'. I have marked it as 'content', 'resource', and 'embedded resource' and nothing works. here's the c# code: ResourceManager oResource = new Resourc...

WPF binding multiple controls to different datacontexts

I have a scenario where I don't really know how to bind data to controls hosted in a UserControl to multiple datacontexts. The data i want to bind comes from 2 classes UserInfo, UserExtendedInfo The datacontext of the UserControl is set to UserInfo so i can bind most controls easily doing the following <Label Name="LblEmail" Text="...

VC++ Resource Files and Lengthy String Resources

In our app we have resource strings that are apparently too long for the compiler. The build breaks stating the "line length is too long." I have found little information about the topic of lengthy string resources and even had a difficult time finding what the limit on such a resource string is. Eventually I found this article which gi...

Adding OCX Control to a Resource Dialog (how Do I control it)

Hi there, I'm adding an OCX to a resource dialog that I've created in my C++ project. The ocx adds properly; but my question is how do I access the ocx programatically? I don't see a member variable (or even a class) attached to it. This is my .rc contents ////////////////////////////////////////////////////////////////////////////...

Reorganizing a project for expansion/reuse

The scope of the project I'm working on is being expanded. The application is fairly simple but currently targets a very specific niche. For the immediate future I've been asked to fork the project to target a new market and continue developing the two projects in tandem. Both projects will be functionally similar so there is a very str...

Loading an image from resources in an unreferenced assembly

I have two silverlight assemblies, CaseManager.Applet and CaseManager.Applet.Sample. The Sample assembly has a reference to the base Applet assembly. The sample assembly has an embedded resource png image. The base applet assembly has a view xaml that I wish to display that image programmatically. In the sample assembly I have a bit of ...

Disappearing icons in WPF

I'm looking to use some icons from the VS2008ImageLibrary/Actions/pngformat in my WPF application to get a more Visual Studio look and feel - like the "Insert Standard Items" command in WinForms. I've added the images as resources, and referenced them in my xaml file: <DockPanel.Resources> <Image x:Key="NewIcon" Source="Toolbar ...

How to detect whether an OS X application is already launched

Normally an application bundle on OS X can only be started once, however by simply copying the bundle the same application can be launched twice. What's the best strategy to detect and stop this possibility? On Windows this effect can simply be achieved by the application creating a named resource at launch and then exit if the named r...

Is it safe to yield from within a "with" block in Python (and why)?

The combination of coroutines and resource acquisition seems like it could have some unintended (or unintuitive) consequences. The basic question is whether or not something like this works: def coroutine(): with open(path, 'r') as fh: for line in fh: yield line Which it does. (You can test it!) The deeper co...

Best resources for starting Jython

I just got my first Jython (and Python) project, and I was wondering what documentation, IDEs, etc. are best suited to a Java buff like me. I know there are a lot of questions about starting out with Python, so I'm asking for things that might be specific to Jython. Where should I start? If it helps, I'm running Linux and Solaris only....

How do I share common web resources between web applications in Visual Studio?

I have three web application projects that share a common library of custom server controls. Sharing the code behind files is easy - they are compiled into a dll that i reference in the other projects using a project reference. But how do I handle files like JavaScript, style sheets and images? I am trying to do this "the Visual Studio w...

Will WPF process an App.xaml file if the hosting application isn't WPF?

First I just want to say I am new to WPF, so please excuse my ignorance... I am creating a .Net plug-in for Rhino 4.0. With the plugin I am developing a UI using WPF. The Rhino 4.0 CAD engine is an MFC/Win32 application. The plugin will execute after the application is run, and it creates the WPF Window and then "sucks" the MFC Windo...

I want to join an open source project. Is there a resource to find projects?

I'm a big PHP programmer. I would like to either learn C# or Python while contributing to a project or use my existing skills to join a project. What do you recommend? ...

Best practice: What is the best way to store exception/error or informational messages in C#.net for internationalization?

Hello gurus, When throwing custom exceptions or issuing messages to the end user, one could use hard-coded the strings (including string constants), use resource-only assemblies or get strings from a table in a database. I would like my application to be able to switch to a different language easily without having to recompile. While ...

Shared resource dictionary between several user controls and across assemblies.

I have an assembly that contains several user controls. For this user controls assembly I want to have a resource dictionary. All the user controls within the assembly should be able to access the resource dictionary. Do I have to add <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> ... ...

WPF: Style based on another one in a separate assembly

Assembly A - ResourceDictionary contains StyleA style. Assembly B - ResourceDictionary.MergedDictionaries to merge resources from Assembly A into B. I would like to create a style in Assembly B "based on" StyleA. Is it possible? I am trying to create this style: <Style x:Key="StyleB" BasedOn="{StaticResource StyleA}"> <Setter Pro...

WPF: Creating Application resource that requires parameter in constructor - how?

Hello, I am having a problem creating a resource in my App.xaml file. My problem is that I want to instantiate an object that requires a parameter in its constructor (my Linq-to-Sql DataContext, in this particular case), but I don't know if it's even possible to pass parameters like this in XAML. Does anyone know of a way to get arou...

Exception thrown when resources declaration order changed.

I get exception when declare resources in this order: <Window.Resources> <sys:Object x:Key="resourceA"></sys:Object> <x:Array x:Key="resourceB" Type="sys:String"> <sys:String>foo</sys:String> </x:Array> </Window.Resources> and when declare this way, all works: <Window.Resources> <x:Array x:Key="resourceB" Typ...

How to edit values in a returned mysql result resource and forward edited result resource

Here's what I'm trying to do ... Im using Flash to call an AMFPHP service that queries my database and returns the result resource. Before returning the result to the Flash movie I need to edit some of the values in the result resource. How can i iterate through the rows of the result, change some values and 'repackage' the resource t...

How do I share user controls between web applications in ASP.NET?

This question is a follow up to my question about sharing resources between web applications, because I have not yet found a good solution. I have a web application with user controls and resources that are shared by three other web applications. Solution | +-CommonControlsWebApp | +- resources | | +- images | | +- scripts | | +- s...