当前位置: 首页>>代码示例>>C#>>正文


C# SPListItem.GetCustomSettings方法代码示例

本文整理汇总了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;
        }
开发者ID:chutinhha,项目名称:tvmcorptvs,代码行数:95,代码来源:ApprovalWorkflow.cs


注:本文中的SPListItem.GetCustomSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。