Esempio n. 1
0
        public override T Clone <T>()
        {
            PowerShellEventItem item = base.Clone <PowerShellEventItem>();

            if (!K2Field.IsNullOrEmpty(_powerShellScript))
            {
                item.PowerShellScript = _powerShellScript.Clone <K2Field>();
            }

            if (_inputVariables != null)
            {
                foreach (VariableItem varItem in _inputVariables)
                {
                    item.InputVariables.Add(varItem.Clone <VariableItem>());
                }
            }

            if (_outputVariables != null)
            {
                foreach (VariableItem varItem in _outputVariables)
                {
                    item.OutputVariables.Add(varItem.Clone <VariableItem>());
                }
            }

            return(item as T);
        }
        // for copy'n'paste
        public override T Clone <T>()
        {
            DesignCRMClient.CRMClientEventItem item = base.Clone <DesignCRMClient.CRMClientEventItem>();

            // not sure how to close non K2Fields???
            if (!string.IsNullOrEmpty(_InternetPlatform))
            {
                item.InternetPlatform = _InternetPlatform.Clone().ToString();
            }
            item.InsertSN    = _InsertSN;
            item.CreateTasks = _CreateTasks;

            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_SN))
            {
                item.SN = _SN.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_ActivityName))
            {
                item.ActivityName = _ActivityName.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_ProcessName))
            {
                item.ProcessName = _ProcessName.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_SmartObjectServer))
            {
                item.SmartObjectServer = _SmartObjectServer.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_SmartObjectServer))
            {
                item.SmartObjectServer = _SmartObjectServer.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_CRMFunctionsSmartObject))
            {
                item.CRMFunctionsSmartObject = _CRMFunctionsSmartObject.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_CRMServerURL))
            {
                item.CRMServerURL = _CRMServerURL.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_CRMOrganisation))
            {
                item.CRMOrganisation = _CRMOrganisation.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_CRMFormURL))
            {
                item.CRMFormURL = _CRMFormURL.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_CRMEntityId))
            {
                item.CRMEntityId = _CRMEntityId.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_CRMEntityType))
            {
                item.CRMEntityType = _CRMEntityType.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_CRMEntityForm))
            {
                item.CRMEntityForm = _CRMEntityForm.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_CRMCustomSNParameter))
            {
                item.CRMCustomSNParameter = _CRMCustomSNParameter.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskCategory))
            {
                item.TaskCategory = _TaskCategory.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskDescription))
            {
                item.TaskDescription = _TaskDescription.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskDueDate))
            {
                item.TaskDueDate = _TaskDueDate.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskDuration))
            {
                item.TaskDuration = _TaskDuration.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskOwnerFQN))
            {
                item.TaskOwnerFQN = _TaskOwnerFQN.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskOwner))
            {
                item.TaskOwner = _TaskOwner.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskOwnerId))
            {
                item.TaskOwnerId = _TaskOwnerId.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskPriority))
            {
                item.TaskPriority = _TaskPriority.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskRegarding))
            {
                item.TaskRegarding = _TaskRegarding.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskRegardingId))
            {
                item.TaskRegardingId = _TaskRegardingId.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskState))
            {
                item.TaskState = _TaskState.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskStatus))
            {
                item.TaskStatus = _TaskStatus.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskSubcategory))
            {
                item.TaskSubcategory = _TaskSubcategory.Clone <K2Field>();
            }
            if (!SourceCode.Workflow.Authoring.K2Field.IsNullOrEmpty(_TaskSubject))
            {
                item.TaskSubject = _TaskSubject.Clone <K2Field>();
            }

            return(item as T);
        }