private void handlePublishing(Document doc, documentCarrier carrier, umbraco.BusinessLogic.User user)
 {
     switch (carrier.PublishAction)
     {
         case documentCarrier.EPublishAction.Publish:
             if (doc.PublishWithResult(user))
             {
                 umbraco.library.UpdateDocumentCache(doc);
             }
             break;
         case documentCarrier.EPublishAction.Unpublish:
             if (doc.PublishWithResult(user))
             {
                 umbraco.library.UnPublishSingleNode(doc);
             }
             break;
         case documentCarrier.EPublishAction.Ignore:
             if (doc.Published)
             {
                 if (doc.PublishWithResult(user))
                 {
                     umbraco.library.UpdateDocumentCache(doc);
                 }
             }
             else
             {
                 if (doc.PublishWithResult(user))
                 {
                     umbraco.library.UpdateDocumentCache(doc);
                 }
             }
             break;
     }
 }
		public static bool PublishWithChildrenWithResult(Document doc, User u)
		{
			if (doc.PublishWithResult(u))
			{
				foreach (var dc in doc.Children.ToList())
				{
					dc.PublishWithChildrenWithResult(u);
				}
				return true;
			}
			return false;
		}