kamagra how much to take

Get All Workflow Names Including Content Type Reference In SharePoint

Started using this handy method at the advice of a co-worker:

  1.          public static List<string> GetWorkflowNames(SPList list)
  2.         {
  3.             List<string> workflowNames = new List<string>();
  4.             if (list != null)
  5.             {
  6.                 foreach (SPWorkflowAssociation workflowAssociation in list.WorkflowAssociations.Cast<SPWorkflowAssociation>().Where(workflowAssociation => !workflowNames.Contains(workflowAssociation.Name)))
  7.                 {
  8.                     workflowNames.Add(workflowAssociation.Name);
  9.                 }
  10.                 foreach (SPWorkflowAssociation workflowAssociation in
  11.                     from SPContentType type in list.ContentTypes
  12.                     from SPWorkflowAssociation workflowAssociation in type.WorkflowAssociations
  13.                     where !workflowNames.Contains(workflowAssociation.Name)
  14.                     select workflowAssociation)
  15.                 {
  16.                     workflowNames.Add(workflowAssociation.Name);
  17.                 }
  18.             }
  19.             return workflowNames;
  20.         }
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>