Exemplo n.º 1
0
        private void btOK_Click(object sender, EventArgs e)
        {
            updateCurrentSchedule();
            StringCollection sc = new StringCollection();

            Ret = new SchedulerCollection();
            for (int i = 0; i < treeView1.Nodes.Count; i++)
            {
                ScheduleDisplay sd = treeView1.Nodes[i] as ScheduleDisplay;
                if (sd != null)
                {
                    Scheduler s = sd.Schedule;

                    Ret.Add(s);
                    if (sc.Contains(s.Name))
                    {
                        MessageBox.Show(this, "Edit scheduler", string.Format(CultureInfo.InvariantCulture, "The schedule name [{0}] is duplicated. Please change the names.", s.Name), MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
                        sc.Add(s.Name);
                    }
                }
            }
            this.DialogResult = DialogResult.OK;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts a ISchedulerCollection of ISchedulerJob into corresponding wrappers
        /// </summary>
        /// <param name="collection">Collection to be converted</param>
        /// <returns>A new collection with wrappers</returns>
        private static ISchedulerCollection ConvertJobList(ISchedulerCollection collection)
        {
            SchedulerCollection <ISchedulerJob> newCollection = new SchedulerCollection <ISchedulerJob>();

            foreach (ISchedulerJob job in collection)
            {
                newCollection.Add(job);
            }

            return(newCollection);
        }