private static void webService_WSVersionCompleted(object sender, tracm.Cablecast.WSVersionCompletedEventArgs e) { try { Cablecast.CablecastWS webService = (Cablecast.CablecastWS)e.UserState; bool previousState = m_cablecastCanCreateShows; int version = 0; Int32.TryParse(e.Result.Replace(".", ""), out version); if (version >= 300) m_cablecastCanCreateShows = true; else m_cablecastCanCreateShows = false; if (m_cablecastCanCreateShows != previousState && CanUseShowsChangedEvent != null) CanUseShowsChangedEvent(m_cablecastCanCreateShows); Cablecast.Location[] locations = webService.GetLocations(); if (LocationsChangedEvent != null) LocationsChangedEvent(locations); } catch { } }
private void webService_GetShowInformationCompleted(object sender, tracm.Cablecast.GetShowInformationCompletedEventArgs e) { Cablecast.CablecastWS webService = (Cablecast.CablecastWS)e.UserState; Cablecast.ShowInfo showInfo = e.Result; Title.Text = showInfo.Title; Producer.Text = showInfo.Producer; Genre.Text = showInfo.Category; // requires 4.9 --> if (CablecastFactory.CanCreateShows) { Cablecast.ProducerInfo producerInfo = webService.GetProducerInfo(showInfo.ProducerID, CablecastUsername.Text, CablecastPassword.Text); if (String.IsNullOrEmpty(Email.Text)) Email.Text = producerInfo.Email; Cablecast.ReelInfo[] reels = webService.GetShowReels(showInfo.ShowID); if (reels.Length > 0) Cue.Text = reels[0].Cue.ToString(); } }
void webService_GetCategoriesCompleted(object sender, tracm.Cablecast.GetCategoriesCompletedEventArgs e) { throw new Exception("The method or operation is not implemented."); }
void webService_GetFormatsCompleted(object sender, tracm.Cablecast.GetFormatsCompletedEventArgs e) { int idx = 0; Cablecast.Format[] formats = e.Result; cablecastFormats.Items.Clear(); foreach (tracm.Cablecast.Format format in formats) { if (format.FormatID == Settings.Default.CablecastFormat) idx = cablecastFormats.Items.Count; cablecastFormats.Items.Add(new NameID(format.FormatID, format.Name)); } if (cablecastFormats.Items.Count > 0) cablecastFormats.SelectedIndex = idx; }
private void CablecastFactory_LocationsChangedEvent(tracm.Cablecast.Location[] locations) { int idx = 0; cablecastLocation.Items.Clear(); foreach (tracm.Cablecast.Location location in locations) { if (location.LocationID == Settings.Default.CablecastLocation) idx = cablecastLocation.Items.Count; cablecastLocation.Items.Add(new NameID(location.LocationID, location.Name)); } if (cablecastLocation.Items.Count > 0) cablecastLocation.SelectedIndex = idx; }