zoukankan      html  css  js  c++  java
  • Sharepoint中EventHander的例子

    public class ListEvenClass : SPListEventReceiver
        {

            public override void FieldAdded(SPListEventProperties properties)
            {
                LogEvent(properties, "添加");
            }

            public override void FieldDeleted(SPListEventProperties properties)
            {
                LogEvent(properties, "删除");
            }

            private void LogEvent(SPListEventProperties properties, string eventName)
            {
                StreamWriter sw = File.AppendText(@"C:\listeventlog.txt");
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("[{0}] {1} Event Occurred:\n", DateTime.Now.ToString(), eventName);
                sb.AppendFormat("\tList : {0}", properties.ListTitle);
                sb.AppendFormat("\t{0} - Field {1}", properties.EventType.ToString(), properties.FieldName);
                sw.WriteLine(sb.ToString());
                sw.Close();
            }
        }

    关于作者: 王昕(QQ:475660) 在广州工作生活30余年。十多年开发经验,在Java、即时通讯、NoSQL、BPM、大数据等领域较有经验。
    目前维护的开源产品:https://gitee.com/475660
  • 相关阅读:
    学习的原动力
    “六顶思考帽”给我的启示
    关于DataSet与Strongly typed DataSet几点思考(原创)
    设计模式之Singleton和Factory
    CentOS修改网络配置
    Proxmox VE(PVE)安装教程
    CentOS开启SELinux导致samba无法访问的解决办法
    nano编辑器使用教程
    CentOS 如何挂载硬盘
    PVE硬盘直通
  • 原文地址:https://www.cnblogs.com/starcrm/p/1310995.html
Copyright © 2011-2022 走看看