Beispiel #1
0
 internal virtual void Bind(ITask iTask)
 {
     if (_v1Trigger == null)
     {
         ushort num;
         _v1Trigger = iTask.CreateTrigger(out num);
     }
     SetV1TriggerData();
 }
Beispiel #2
0
 internal virtual void Bind(ITask iTask)
 {
     if (_v1Trigger == null)
     {
         ushort num;
         _v1Trigger = iTask.CreateTrigger(out num);
     }
     SetV1TriggerData();
 }
Beispiel #3
0
        /// <summary>
        ///   Add a new trigger to the collections of triggers for the task.
        /// </summary>
        /// <param name="taskTriggerType"> The type of trigger to create. </param>
        /// <returns> A <see cref="Trigger" /> instance of the specified type. </returns>
        public Trigger AddNew(TaskTriggerType taskTriggerType)
        {
            if (v1Task != null)
            {
                ushort idx;
                return(Trigger.CreateTrigger(v1Task.CreateTrigger(out idx), Trigger.ConvertToV1TriggerType(taskTriggerType)));
            }

            return(Trigger.CreateTrigger(v2Coll.Create(taskTriggerType)));
        }
Beispiel #4
0
        /// <summary>
        /// Add the supplied Trigger to the collection.  The Trigger to be added must be unbound,
        /// i.e. it must not be a current member of a TriggerList--this or any other.
        /// </summary>
        /// <param name="trigger">Trigger to add.</param>
        /// <returns>Index of added trigger.</returns>
        /// <exception cref="ArgumentException">Trigger being added is already bound.</exception>
        public int Add(Trigger trigger)
        {
            // if trigger is already bound a list throw an exception
            if (trigger.Bound)
            {
                throw new ArgumentException("A Trigger cannot be added if it is already in a list.");
            }
            // Add a trigger to the task for this TaskList
            ITaskTrigger iTrigger;
            ushort       index;

            iTask.CreateTrigger(out index, out iTrigger);
            // Add the Trigger to the TaskList
            trigger.Bind(iTrigger);
            int index2 = oTriggers.Add(trigger);

            // Verify index is the same in task and in list
            if (index2 != (int)index)
            {
                throw new ApplicationException("Assertion Failure");
            }
            return((int)index);
        }
Beispiel #5
0
 internal virtual void Bind(ITask iTask)
 {
     if (v1Trigger == null) {
         ushort idx;
         v1Trigger = iTask.CreateTrigger(out idx);
     }
     SetV1TriggerData();
 }