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
  • 相关阅读:
    主元素 .
    Struts2中使用Session .
    不同的路径 .
    判断数独是否合法(LintCode) .
    最大子数组(LintCode) .
    不同的路径 II .
    删除元素(LintCode) .
    Hibernate 与Spring整合出现 hibernate.HibernateException: createCriteria is not valid without active transaction .
    子树(LintCode) .
    Surrounded Regions .
  • 原文地址:https://www.cnblogs.com/starcrm/p/1310995.html
Copyright © 2011-2022 走看看