Beispiel #1
0
        public void DeleteSpeaker(Speaker s)
        {
            _local.Remove(s);
            _online.Remove(s);
            _document.Remove(s);
            _temp.Remove(s);

            var cont = _allSpeakers.FirstOrDefault(sc => sc.Speaker == s);

            if (cont != null)
            {
                _allSpeakers.Remove(cont);
                Refresh();
            }
        }
        public static Speaker SynchronizedAdd(SpeakerCollection speakers, Speaker s)
        {
            var found = speakers.FirstOrDefault(sp => sp.DBID == s.DBID);

            if (found == null)
            {
                speakers.Add(s);
            }
            else
            {
                if (found.Synchronized < s.Synchronized)
                {
                    speakers.Remove(found);
                    speakers.Add(s);
                    return(found);
                }
            }

            return(null);
        }
Beispiel #3
0
        public static Speaker SynchronizedAdd(SpeakerCollection speakers, Speaker s)
        {
            var found = speakers.FirstOrDefault(sp=>sp.DBID == s.DBID);

            if (found == null)
            {
                speakers.Add(s);

            }
            else
            {
                if(found.Synchronized < s.Synchronized)
                {
                    speakers.Remove(found);
                    speakers.Add(s);
                    return found;
                }
            }

            return null;
        }