Beispiel #1
0
 ///GENMHASH:4641DDCC05BB52F8555772EA9ADE8A42:FC9C9EE51368094AC252B1C35729FDF7
 internal RegistryEncodedTaskStepImpl(RegistryTaskImpl taskImpl) : base(taskImpl.Inner().Step)
 {
     this.inner = new EncodedTaskStep();
     if (taskImpl.Inner().Step != null && !(taskImpl.Inner().Step is EncodedTaskStep))
     {
         throw new ArgumentException("Constructor for RegistryEncodedTaskStepImpl invoked for class that is not an EncodedTaskStep");
     }
     this.taskImpl = taskImpl;
     this.encodedTaskStepUpdateParameters = new EncodedTaskStepUpdateParameters();
 }
        ///GENMHASH:1A8659F8D549D364C509FEE6D051EC24:7BFFB4FD72D26704E97C0D470D44EE51
        internal RegistrySourceTriggerImpl(string sourceTriggerName, RegistryTaskImpl registryTaskImpl, bool creation)
        {
            if (creation)
            {
                this.registryTaskImpl = registryTaskImpl;
                if (registryTaskImpl.Inner().Id == null)
                {
                    this.inner = new SourceTrigger
                    {
                        SourceRepository = new SourceProperties(),
                        Name             = sourceTriggerName
                    };
                }
                else
                {
                    this.sourceTriggerUpdateParameters = new SourceTriggerUpdateParameters
                    {
                        SourceRepository = new SourceUpdateParameters(),
                        Name             = sourceTriggerName
                    };
                }
            }
            else
            {
                this.registryTaskImpl = registryTaskImpl;
                this.inner            = new SourceTrigger
                {
                    SourceRepository = new SourceProperties()
                };

                bool foundSourceTrigger = false;
                foreach (var stup in registryTaskImpl.taskUpdateParameters.Trigger.SourceTriggers)
                {
                    if (stup.Name.Equals(sourceTriggerName, StringComparison.OrdinalIgnoreCase))
                    {
                        this.sourceTriggerUpdateParameters = stup;
                        foundSourceTrigger = true;
                    }
                }

                if (!foundSourceTrigger)
                {
                    throw new ArgumentException("The trigger you are trying to update does not exist. If you are trying to define a new trigger while updating a task, please use the defineSourceTrigger function instead.");
                }
            }
        }