static public bool IsValid(SelectedTimingProvider selectedTimingProvider) { return (selectedTimingProvider != null && !string.IsNullOrEmpty(selectedTimingProvider.ProviderType) && !string.IsNullOrEmpty(selectedTimingProvider.SourceName)); }
public SelectedTimingProviderSurrogate(SelectedTimingProvider selectedTimingProvider) { if (selectedTimingProvider != null) { ProviderType = selectedTimingProvider.ProviderType; SourceName = selectedTimingProvider.SourceName; } }
public static bool IsValid(SelectedTimingProvider selectedTimingProvider) { return selectedTimingProvider != null && !string.IsNullOrEmpty(selectedTimingProvider.ProviderType) && !string.IsNullOrEmpty(selectedTimingProvider.SourceName); }
public ITiming GetTimingSource(SelectedTimingProvider selectedProvider) { ITiming selectedSource = null; var providers = _GetProviders(); ITimingProvider provider; if (SelectedTimingProvider.IsValid(selectedProvider) && providers.TryGetValue(selectedProvider.ProviderType, out provider)) { selectedSource = provider.GetTimingSource(Owner, selectedProvider.SourceName); } return selectedSource; }
public ITiming GetTimingSource(SelectedTimingProvider selectedProvider) { ITiming selectedSource = null; var providers = _GetProviders(); ITimingProvider provider; if (SelectedTimingProvider.IsValid(selectedProvider) && providers.TryGetValue(selectedProvider.ProviderType, out provider)) { selectedSource = provider.GetTimingSource(Owner, selectedProvider.SourceName); } return(selectedSource); }
//*** only do this if the user agrees to do it private void _UpdateTimingSourceToSelectedMedia() { //This sucks so bad, I am so sorry. Magic strings and everything, good god. TimingProviders timingProviders = new TimingProviders(_sequence); string[] mediaTimingSources; try { mediaTimingSources = timingProviders.GetAvailableTimingSources("Media"); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } if (mediaTimingSources.Length > 0) { SelectedTimingProvider mediaTimingProvider = new SelectedTimingProvider("Media", mediaTimingSources.First()); _sequence.SelectedTimingProvider = mediaTimingProvider; _SetTimingToolStripEnabledState(); } }
//*** only do this if the user agrees to do it private void _UpdateTimingSourceToSelectedMedia() { //This sucks so bad, I am so sorry. Magic strings and everything, good god. TimingProviders timingProviders = new TimingProviders(_sequence); string[] mediaTimingSources; try { mediaTimingSources = timingProviders.GetAvailableTimingSources("Media"); } catch (Exception ex) { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm(ex.Message, @"Error parsing time", false, false); messageBox.ShowDialog(); return; } if (mediaTimingSources.Length > 0) { SelectedTimingProvider mediaTimingProvider = new SelectedTimingProvider("Media", mediaTimingSources.First()); _sequence.SelectedTimingProvider = mediaTimingProvider; _SetTimingToolStripEnabledState(); } }