示例#1
0
 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;
     }
 }
示例#3
0
 public static bool IsValid(SelectedTimingProvider selectedTimingProvider)
 {
     return
         selectedTimingProvider != null &&
         !string.IsNullOrEmpty(selectedTimingProvider.ProviderType) &&
         !string.IsNullOrEmpty(selectedTimingProvider.SourceName);
 }
示例#4
0
        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;
        }
示例#5
0
        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);
        }
示例#6
0
        //*** 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();
            }
        }
示例#7
0
        //*** 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();
            }
        }