Page copy protected against web site content infringement by Copyscape

In some cases, it may be useful to query the existing Content Types in your site collection that have an associated Workflow defined. Use this query to loop through your content types and find the ones that have workflow enabled.

         string siteCollectionName = "http://devsite";
            SPSite siteCollection = new SPSite(siteCollectionName);
            SPWeb site = siteCollection.OpenWeb();
            foreach (SPContentType contentType in site.AvailableContentTypes)
               if ((contentType.Group.ToString() != "_Hidden") && (contentType.WorkflowAssociations.Count > 0))
                Console.WriteLine("Content Type Name: " + contentType.Name.ToString() + " Content Type Group: " + contentType.Group.ToString());
            Console.WriteLine("Press any key to continue….");

I am filtering out the hidden groups and using the WorkflowAssociations property to track the content types that have workflows associated with them.

Time for April 2009 Code Camp.

If you are in the Philly area, you should plan on attending. There are about 60 sessions and all of them are free.

I will be doing a session on SharePoint 2007 HA (High Availability). Will discuss about WFE(Web Front End Servers), NLB (Network Load Balancers) & SQL Server HA (Clustering, Mirrorring).

Follow the link

Join in and see you there!