Example #1
0
        public void LoadSchedules()
        {
            var allSchedules = Schedules;

            allSchedules.Clear();

            var schedules = _Service.ListSchedules();

            foreach (var schedule in schedules)
            {
                allSchedules.Add(schedule.Name, schedule);
            }
        }
        private void PickSchedule_Load(object sender, EventArgs e)
        {
            rs             = new ReportingService2005();
            rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
            Schedule[] schedules = null;

            try
            {
                schedules = rs.ListSchedules();
                if (schedules != null)
                {
                    //Build list items
                    ArrayList aList = new ArrayList();
                    // Now add the Do not schedule item
                    aList.Add(new ComboItem("Do not schedule", "NS"));
                    // And the Snapshot schedule
                    aList.Add(new ComboItem("Schedule with Snapshot", "SS"));
                    foreach (Schedule s in schedules)
                    {
                        aList.Add(new ComboItem(s.Description, s.ScheduleID));
                        Debug.WriteLine(String.Format("Desc: {0} - ID: {1}", s.Description,
                                                      s.ScheduleID));
                    }
                    //Bind list items to combo box
                    sharedSchedules.DataSource    = aList;
                    sharedSchedules.DisplayMember = "Display";
                    sharedSchedules.ValueMember   = "Value";
                }
            }
            catch (SoapException ex)
            {
                MessageBox.Show(ex.Detail.InnerXml.ToString());
            }
        }