Custom Expiration policy C# assistance


hi,

i wandering if help, attempting create following policy.

i have named policy filteredexpiration.cs

when go build it, comes following error:

error 1 'expirationtest.filteredexpiration' not implement interface member 'microsoft.office.recordsmanagement.policyfeatures.iexpirationformula.computeexpiredate(microsoft.sharepoint.splistitem, system.xml.xmlnode)' c:\users\alex.nagy\documents\visual studio 2010\projects\expirationtest\expirationtest\filteredexpiration.cs 11 18 expirationtest


using system.web;  using microsoft.sharepoint;  using microsoft.office.recordsmanagement;  using microsoft.office.recordsmanagement.policyfeatures;  using microsoft.office.documentmanagement;  using microsoft.sharepoint.utilities;  using system;    namespace expirationtest  {      public class filteredexpiration : iexpirationformula      {          public datetime? computeexpitedate(splistitem item, system.xml.xmlnode parametersdata)          {                //check if item in warning period              //if is, send warning email stating              //that document expire in month                datetime expirydate = new datetime();              if (item["_dlc_expiredate"] != null)              {                    //get item's expiry date.                  expirydate = (datetime)item["_dlc_expiredate"];                    //find remaining time expiry                  timespan diff = expirydate.subtract(datetime.now);                    //if less month, send warning email                  if (diff.minutes <= 2)                      sendwarningemail(item);                }                if (item["collectme"].tostring().equals("true"))                  return datetime.now;              else                  return ((datetime)item["modified"]).adddays(365);            }            private void sendwarningemail(splistitem item)          {              try              {                  spsite thissite = new spsite("http://sharepoint:14236");                  spweb thisweb = thissite.rootweb;                  string tofield = "alex.nagy@centraxtcl.com";                  string subject = "test message";                  string body = "document - " + item.name + " - expire in month.";                  httpcontext oldcontext = httpcontext.current;                  httpcontext.current = null;                  bool success = sputility.sendemail(thisweb, true, true, tofield, subject, body);                  httpcontext.current = oldcontext;                }              catch (exception ex)              {                  //handle exception              }            }      }  }  

anyone have ideas?

probably method signature of computeexpitedate not valid class.

you can 1 thing: right click on interface name use refactor > implement interface

if  get new method, place method code inside it.

try building it.


resolving n evolving in c# (http://jeanpaulva.com)



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user