本文整理汇总了C#中SPListItem.GetCustomSettings方法的典型用法代码示例。如果您正苦于以下问题:C# SPListItem.GetCustomSettings方法的具体用法?C# SPListItem.GetCustomSettings怎么用?C# SPListItem.GetCustomSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPListItem
的用法示例。
在下文中一共展示了SPListItem.GetCustomSettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetValueToApprovalConfigurationObject
private void SetValueToApprovalConfigurationObject(SPListItem item)
{
_approvalConfiguration.TaskConfigurationName = item[TaskConfigurationFieldIds.CogfigName].ToString();
_approvalConfiguration.ContentTypeId = item[TaskConfigurationFieldIds.TaskContentTypeId].ToString();
__ActivationProperties.TaskList.EnsureContentTypeInListWithoutPrivileges(_approvalConfiguration.ContentTypeId);
//_infoPathForm = true;
_infoPathForm = useInfoPathOrAspx(_approvalConfiguration.ContentTypeId);
_approvalConfiguration.TaskRuleConfiguration = item.GetCustomSettings<TaskRuleSettings>(IOfficeFeatures.Infrastructure);
_approvalConfiguration.TaskEventConfiguration = item.GetCustomSettings<TaskEventSettings>(IOfficeFeatures.Infrastructure);
_approvalConfiguration.ExpandGroup = (bool)item[TaskConfigurationFieldIds.ExpandGroup];
if (item[TaskConfigurationFieldIds.UseMetaDataAssignment] != null)
_approvalConfiguration.UseMetadataAssignment = (bool)item[TaskConfigurationFieldIds.UseMetaDataAssignment];
else
_approvalConfiguration.UseMetadataAssignment = false;
if (item[TaskConfigurationFieldIds.ByPassTask] != null)
_approvalConfiguration.ByPassTask = (bool)item[TaskConfigurationFieldIds.ByPassTask];
else
_approvalConfiguration.ByPassTask = false;
if (item[TaskConfigurationFieldIds.IgnoreIfNoParticipant] != null)
_approvalConfiguration.IgnoreIfNoParticipant = (bool)item[TaskConfigurationFieldIds.IgnoreIfNoParticipant];
else
_approvalConfiguration.IgnoreIfNoParticipant = false;
_approvalConfiguration.AssignmentType = (ExecutionType)Enum.Parse(typeof(ExecutionType), item[TaskConfigurationFieldIds.AssignmentType].ToString(), true);
if (item[TaskConfigurationFieldIds.EmailTemplateUrl] != null)
_approvalConfiguration.URLEmailTemplate = (string)item[TaskConfigurationFieldIds.EmailTemplateUrl];
else
_approvalConfiguration.URLEmailTemplate = "";
if (item[TaskConfigurationFieldIds.AssignmentEmailTemplate] != null)
_approvalConfiguration.AssignmentEmailTemplate = item[TaskConfigurationFieldIds.AssignmentEmailTemplate].ToString();
if (item[TaskConfigurationFieldIds.ReminderEmailTemplate] != null)
_approvalConfiguration.ReminderEmailTemplate = (string)item[TaskConfigurationFieldIds.ReminderEmailTemplate];
if (item[TaskConfigurationFieldIds.EscalationEmailTemplate] != null)
_approvalConfiguration.EscalationEmailTemplate = item[TaskConfigurationFieldIds.EscalationEmailTemplate].ToString();
if (item[TaskConfigurationFieldIds.DueDateDuration] != null)
_approvalConfiguration.DueDateDuration = GetDuration((double)item[TaskConfigurationFieldIds.DueDateDuration],
item[TaskConfigurationFieldIds.DueDateMeasure].ToString());
if (item[TaskConfigurationFieldIds.ReminderDateDuration] != null)
_approvalConfiguration.ReminderDuration = GetDuration((double)item[TaskConfigurationFieldIds.ReminderDateDuration],
item[TaskConfigurationFieldIds.ReminderDateMeasure].ToString());
if (item[TaskConfigurationFieldIds.EscalationDateDuration] != null)
_approvalConfiguration.EscalationDuration = GetDuration((double)item[TaskConfigurationFieldIds.EscalationDateDuration],
item[TaskConfigurationFieldIds.EscalationDateMeasure].ToString());
if (item[TaskConfigurationFieldIds.EscalationParty] != null)
_approvalConfiguration.EscalationPartyEmail = GetEslacationPartyEmail(item[TaskConfigurationFieldIds.EscalationParty].ToString());
_approvalConfiguration.UseNumberRequired = (bool)item[TaskConfigurationFieldIds.UseNumberRequired];
if (_approvalConfiguration.UseNumberRequired)
_approvalConfiguration.NumberRequired = (int)item[TaskConfigurationFieldIds.NumberRequired];
if (item[TaskConfigurationFieldIds.TaskContributors] != null)
_approvalConfiguration.TaskContributors = GetListUsers(item[TaskConfigurationFieldIds.TaskContributors].ToString(), false);
if (item[TaskConfigurationFieldIds.TaskObservers] != null)
_approvalConfiguration.TaskObservers = GetListUsers(item[TaskConfigurationFieldIds.TaskObservers].ToString(), false);
if (ApprovalWorkflowParameter != null && !string.IsNullOrEmpty(ApprovalWorkflowParameter.TaskInstructions))
{
_approvalConfiguration.TaskInstruction = ApprovalWorkflowParameter.TaskInstructions;
}
else
{
if (item[TaskConfigurationFieldIds.TaskInstructions] != null)
_approvalConfiguration.TaskInstruction = item[TaskConfigurationFieldIds.TaskInstructions].ToString();
else
_approvalConfiguration.TaskInstruction = "";
}
if (item[TaskConfigurationFieldIds.TaskTitlePrefix] != null)
_approvalConfiguration.TaskTitlePrefix = item[TaskConfigurationFieldIds.TaskTitlePrefix].ToString();
else
_approvalConfiguration.TaskTitlePrefix = "";
_approvalConfiguration.AllowReassign = (bool)item[TaskConfigurationFieldIds.AllowReassign];
_approvalConfiguration.AllowDueDateChangeOnReassignment = (bool)item[TaskConfigurationFieldIds.AllowDueDateChangeRessignment];
_approvalConfiguration.AlloRequestInfomation = (bool)item[TaskConfigurationFieldIds.AllowRequestInfomation];
_approvalConfiguration.AllowDueDateChangeOnRequestInformation = (bool)item[TaskConfigurationFieldIds.AllowDueDateChangeRequestInfomation];
_approvalConfiguration.AllowPlaceOnHold = (bool)item[TaskConfigurationFieldIds.AllowPlaceHoldOn];
_approvalConfiguration.AllowSendEEC = (bool)item[TaskConfigurationFieldIds.AllowSendEEC];
_strApprovers = item[TaskConfigurationFieldIds.Approvers] != null ? item[TaskConfigurationFieldIds.Approvers].ToString() : string.Empty;
_approverFieldId = item[TaskConfigurationFieldIds.ApproversFieldId] != null ? item[TaskConfigurationFieldIds.ApproversFieldId].ToString() : string.Empty;
}