关于Developer Express v2010汉化问题缺少程序集引用


在项目中加入附件中的DevExpress.Localization.v10.1.dll引用
winform:

在MDI MainForm 的FormLoad事件中加入以下sources
DevExpress.Utils.Localization.AccLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressUtilsLocalizationCHS();
DevExpress.XtraBars.Localization.BarLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraBarsLocalizationCHS();
DevExpress.XtraCharts.Localization.ChartLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraChartsLocalizationCHS();
DevExpress.XtraEditors.Controls.Localizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraEditorsLocalizationCHS();
DevExpress.XtraGrid.Localization.GridLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraGridLocalizationCHS();
DevExpress.XtraLayout.Localization.LayoutLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraLayoutLocalizationCHS();
DevExpress.XtraNavBar.NavBarLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraNavBarLocalizationCHS();
DevExpress.XtraPivotGrid.Localization.PivotGridLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraPivotGridLocalizationCHS();
DevExpress.XtraPrinting.Localization.PreviewLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraPrintingLocalizationCHS();
DevExpress.XtraReports.Localization.ReportLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraReportsLocalizationCHS();
DevExpress.XtraRichTextEdit.Localization.XtraRichTextEditLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraRichTextEditLocalizationCHS();
DevExpress.XtraRichEdit.Localization.XtraRichEditLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraRichEditLocalizationCHS();
DevExpress.XtraScheduler.Localization.SchedulerLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraSchedulerLocalizationCHS();
DevExpress.XtraScheduler.Localization.SchedulerExtensionsLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraSchedulerExtensionsLocalizationCHS();
DevExpress.XtraSpellChecker.Localization.SpellCheckerLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraSpellCheckerLocalizationCHS();
DevExpress.XtraTreeList.Localization.TreeListLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraTreeListLocalizationCHS();
DevExpress.XtraVerticalGrid.Localization.VGridLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraVerticalGridLocalizationCHS();
DevExpress.XtraWizard.Localization.WizardLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraWizardLocalizationCHS();


webform:
Default.aspx的Page_Load事件中加入以下sources

DevExpress.Web.ASPxClasses.Localization.ASPxperienceLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWebASPxClassesLocalizationCHS();
DevExpress.Web.ASPxEditors.Localization.ASPxEditorsLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWebASPxEditorsLocalizationCHS();
DevExpress.Web.ASPxGridView.Localization.ASPxGridViewLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWebASPxGridViewLocalizationCHS();
DevExpress.Web.ASPxHtmlEditor.Localization.ASPxHtmlEditorLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWebASPxHtmlEditorLocalizationCHS();
DevExpress.Web.ASPxScheduler.Localization.ASPxSchedulerLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWebASPxSchedulerLocalizationCHS();
DevExpress.Web.ASPxSpellChecker.Localization.ASPxSpellCheckerLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWebASPxSpellCheckerLocalizationCHS();
DevExpress.Web.ASPxTreeList.Localization.ASPxTreeListLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWebASPxTreeListLocalizationCHS();

WPF:
DevExpress.Wpf.Editors.Localization.EditorLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWpfEditorsLocalizationCHS();
DevExpress.Wpf.Grid.Localization.GridControlLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWpfGridLocalizationCHS();
DevExpress.Wpf.NavBar.Localization.NavBarLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressWpfNavBarLocalizationCHS();


注:若在项目中没有用到相关控件,则不需要创建类的实例。例如:沒有使用到XtraScheduler控件就不需要
DevExpress.XtraScheduler.Localization.SchedulerLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraSchedulerLocalizationCHS();


以下sources为建立界面风格菜单,打开用户设置的界面风格,语言
DevExpress.FOSOYO.LookAndFeelSettings.Load("FOSOYO.ini");
DevExpress.FOSOYO.LanguageSettings.Load("FOSOYO.ini");
//DevMenu
new DevExpress.FOSOYO.DevExpressLookAndFeelMenu(barManager1, barSubItem1, defaultLookAndFeel1);
//DevRibbonMenu
new DevExpress.FOSOYO.DevExpressRibbonMenu(ribbon, ribbonPageGroup1, defaultLookAndFeel1, true);
//VS2002 2003Menu
new DevExpress.FOSOYO.VS2003LookAndFeelMenu(this, defaultLookAndFeel1, "FOSOYO");
//VS2005 2008Menu
new DevExpress.FOSOYO.VS20052008LookAndFeelMenu(this, PaintStyle);          

在FormClosing事件中加入以下Source,保存用户设置的界面风格,语言
DevExpress.FOSOYO.LookAndFeelSettings.Save("FOSOYO.ini");
DevExpress.FOSOYO.LanguageSettings.Save("FOSOYO.ini");

特别强调这里一定用很多人按照上面的步骤后报错,“xxx”中不存在类型或命名空间名称“Localization”(是缺少程序集引用吗?),运行出现了错误和警告。

一般的话一定是关注错误的,但是问题所在是警告如图

$)9AU9@@@`@97}KX8UWQ8BQ看到“目标框架”了吧,其实问题出在这里,一般用vs2010建立程序它都帮你选择了

NET 4 Client Profile这个架构,正因为这个架构是相对NET Framework 4精简,所以导致汉化引用一些东西没有,没有细心看很难发觉这个错误。这个问题解决方法是

项目右键属性进入里面

_B53F50S]F{JS`T])`Z`9EL目标架构改成NET Framework 4问题就解决了。

弄了整晚,都两点多了,洗洗睡觉了,╮(╯▽╰)╭。

你可能感兴趣的:(developer)