用于托管MDI应用程序的WinForm应用程序的集中式图像提供程序 [英] Centralized image provider for WinForm Application hosting MDI Applications

查看:101
本文介绍了用于托管MDI应用程序的WinForm应用程序的集中式图像提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
最近,我在考虑一种为winform应用程序全局提供图像的方法,该方法使我们能够全局管理和更改/替换图像.

我们有一个大型WinForm应用程序,该应用程序在MDI容器中托管多个dll/exe.
尽管许多开发人员经过了多年的岁月,但在他们的dll中添加了映像,但没有满足任何法规要求.

首先,我想提供一个全局dll,用于将图像托管在资源文件中,并通过密钥将其提供给调用应用程序.

然后,我想出了UITypeEditor,它可以使用某些键从数据库提供图像.尽管这似乎是一种有用的方法,但我仍然想知道周围是否有任何好的解决方案,尤其是当涉及到对VS2010的设计时支持时.

对此主题的任何提示/想法,敬请见谅,
最好的问候
Andy

Hi all,
I was recently thinking about a way to globally provide images for our winform applications which allows us to globally manage and change/replace images.

We have a big WinForm app that hosts multiple dlls/exes in MDI containers.
While the years passed by many developers added images to their dlls wich didn''t suite any regulations.

First I thought about providing a global dll that hosts the images in a resource file and supplies them to the calling application via keys.

Then I came up with UITypeEditors that can supply images from a database using certain keys. While this seems to be a usefull approach I was still wondering if there are any good solutions around, especially when it comes to design-time support for VS2010.

Any hints/ideas on this topic are kindly appreciated,
best regards
Andy

推荐答案

我过去的方法是创建资源库.我写了一篇大约两年前的文章,跨多个项目共享资源 [
My approach in the past has been to create a resource library. I wrote an article about two years ago, Share Resources Across Multiple Projects[^], that might be helpful.

Basically, you create a DLL project and add all your images (and any other resources you want to share.) Then create a class with static read-only properties that export those resource images. You can create different classes to export different types of resources, such as toolbar icons, button images, etc. Then compile to create a library you can link in to your projects.


这篇关于用于托管MDI应用程序的WinForm应用程序的集中式图像提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆