zoukankan      html  css  js  c++  java
  • WSS3.0 WebPart 多语言支持的实现

    WSS3.0支持两中类型的WebPart:
    wss风格的WebPart - 从 Microsoft.SharePoint.WebPartPages.WebPart继承;
    asp.net风格的WebPart - 从 System.Web.UI.WebControls.WebParts.WebPart继承;

    对wss风格的webpart,采用系统提供的Microsoft.SharePoint.WebPartPages.ResourcesAttribute指定资源字符串key,然后
    重载LoadResource方法处理资源文件的加载,示例如下:
    ResTestWP

    若是asp.netf风格的webpart,则实现稍微复杂一点,需要重新实现CategoryAttribute,WebDisplayNameAttribute的相关方法:
    ResTestWP

    通过以上的代码,可以实现WebPart编辑面板的多语言支持,webpart内部代码也可以通过ResourceHelper.GetResourceString获取资源字符串.

    其他的Attribute类也可用上面的方法重新实现。
    以上示例代码的命名不是很规范,ResCategory 应改成 ResCategoryAttribute.
    ResWebDisplayName 应改成 ResWebDisplayNameAttribute. 编辑器不好用啊,就不改了~

    下载代码:
    /Files/jianyi0115/ResTestWP.rar


  • 相关阅读:
    虚拟机环境
    R语言里一些画图程序不能在循环里正常保存的解决办法
    python 图片处理(更新)
    服务器跑代码小tips
    [论文笔记] :Temporal Graph Networks for Deep Learning on Dynamic Graphs
    [论文笔记] Detecting early-warning signals for sudden deterioration of complex diseases by dynamical network biomarkers
    堆和优先队列的写法
    [论文笔记] :Detection for disease tipping points by landscape dynamic network biomarkers
    Computational Physics
    WCSPH实现方法
  • 原文地址:https://www.cnblogs.com/jianyi0115/p/1013192.html
Copyright © 2011-2022 走看看