public bool IsParentOf(object id)
        {
            if (id is string)
            {
                return(m_contentTypeId.IsParentOf(new SPContentTypeId(id as string)));
            }

            if (id is SPContentTypeIdInstance)
            {
                return(m_contentTypeId.IsParentOf((id as SPContentTypeIdInstance).m_contentTypeId));
            }

            return(false);
        }
Exemplo n.º 2
0
        private bool useInfoPathOrAspx(string contentTypeId)
        {
            SPContentType contentType = __ActivationProperties.Web.FindContentType(new SPContentTypeId(contentTypeId));
            if (contentType == null) return false;
            SPContentType listContentType = __ActivationProperties.TaskList.ContentTypes[contentType.Name];
            CustomFormSettings customFormSettings = listContentType.GetCustomSettings<CustomFormSettings>(IOfficeFeatures.Infrastructure);
            SPContentTypeId ctid = new SPContentTypeId(Constants.CCI_WORKFLOW_TASK_CONTENT_TYPE_ID);

            return true;

            if (customFormSettings == null && ctid.IsParentOf(listContentType.Id))
                return true;

            if (customFormSettings == null)
                return false;

            if (customFormSettings.EditItemFormType == CCIFormType.ASPXForm)
                return true;

            if (customFormSettings.EditItemFormType == CCIFormType.InfoPath &&
                !string.IsNullOrEmpty(customFormSettings.EditItemFormXsnLocation) &&
                customFormSettings.EditItemFormXsnLocation.EndsWith(".xsn", StringComparison.CurrentCultureIgnoreCase))
                return true;

            return false;
        }