Example #1
0
        public void AddSignalSourceToList(Common.SignalSource src)
        {
            BaseSourceModel primarySrc = GetProcessorForStreamingSource(src);

            if (primarySrc != null)
            {
                AddSignalSourceModelToList(primarySrc);
                //sub-items...
                BaseSourceModel[] subSources = primarySrc.GetSubSourceModels();
                if (subSources != null)
                {
                    foreach (BaseSourceModel subSrc in subSources)
                    {
                        AddSignalSourceModelToList(subSrc);
                    }
                }
            }
        }
Example #2
0
 private void ProcessRefreshSubItems(BaseSourceModel curProcessor)
 {
     if (curProcessor == null || !curProcessor.SupportsSubSources)
     {
         return;
     }
     BaseSourceModel[] curSubSources = _signalSources.Where(s => s.ParentSourceId == curProcessor.SignalSourceId).ToArray();
     BaseSourceModel[] cfgSubSources = curProcessor.GetSubSourceModels();
     if (curSubSources == null || curSubSources.Length <= 0)
     {
         return;
     }
     if (cfgSubSources == null || cfgSubSources.Length <= 0)
     {
         foreach (BaseSourceModel subSrc in curSubSources)
         {
             _signalSources.Remove(subSrc);
         }
     }
     else
     {
         foreach (BaseSourceModel subSrc in curSubSources)
         {
             if (!cfgSubSources.Contains(subSrc))
             {
                 _signalSources.Remove(subSrc);
             }
         }
         foreach (BaseSourceModel cgfSrc in cfgSubSources)
         {
             if (!_signalSources.Contains(cgfSrc))
             {
                 _signalSources.Add(cgfSrc);
             }
         }
     }
     _signalSources.Sort();
     foreach (BaseSourceModel subSrc in _signalSources)
     {
         subSrc.DoRefreshSource();
     }
     curProcessor.DoRefreshVisuals();
 }