Beispiel #1
0
        private void OnMessageCreated(ChatMessage message)
        {
            var item = _chatRooms.FirstOrDefault(r => r.Room.Id == message.RoomId);

            if (item == null)
            {
                return;
            }

            item.Messages.Add(message);

            GuiDispatcher.GlobalDispatcher.AddAction(() =>
            {
                if (item != SelectedRoom)
                {
                    item.HasNewItems = true;
                    UnreadMessages.SafeInvoke(true);
                }
                else
                {
                    var scroll = Messages.FindVisualChild <ScrollViewer>();
                    if (scroll != null)
                    {
                        scroll.ScrollToEnd();
                    }
                }
            });
        }
Beispiel #2
0
 public void addTuioCursor(TuioCursor tcur)
 {
     Console.WriteLine("add cur " + tcur.CursorID + " (" + tcur.SessionID + ") " + tcur.X + " " + tcur.Y);
     if (cursors.FirstOrDefault <TuioCursor>(tmp => tmp.CursorID == tcur.CursorID) == null)
     {
         cursors.Add(tcur);
     }
 }
Beispiel #3
0
        public FmodEqualizer(FmodSystem system, Channel channel)
        {
            IsPreampAvailable = false;
            FSystem           = system;
            FChannel          = channel;
            Bands             = new ThreadSafeObservableCollection <IEqualizerBand>();
            Presets           = new ThreadSafeObservableCollection <EqualizerSettings>((IEnumerable <EqualizerSettings>) new ConfigSaver().GetSettings());
            EqualizerSettings = InitializeSwitch.EqualizerSettingsHelper.LoadEqualizerSettings("CustomEq").settings;
            Name           = EqualizerSettings.Name;
            SelectedPreset = Presets.IndexOf(Presets.FirstOrDefault(t => t.Name == EqualizerSettings.Name));

            IsEnabled = EqualizerSettings == null || EqualizerSettings.IsEnabled;
            Init();
            this.PropertyChanged += OnPropertyChanged;
        }
Beispiel #4
0
        public BassEqualizer(int coreHandle)
        {
            _handle = coreHandle;
            var version = BassFx.Version;

            IsPreampAvailable = true;

            Bands             = new ThreadSafeObservableCollection <IEqualizerBand>();
            Presets           = new ThreadSafeObservableCollection <EqualizerSettings>((IEnumerable <EqualizerSettings>) new ConfigSaver().GetSettings());
            EqualizerSettings = InitializeSwitch.EqualizerSettingsHelper.LoadEqualizerSettings("CustomEq").settings;
            Name           = EqualizerSettings.Name;
            SelectedPreset = Presets.IndexOf(Presets.FirstOrDefault(t => t.Name == EqualizerSettings.Name));

            IsEnabled = EqualizerSettings == null || EqualizerSettings.IsEnabled;
            Init();
            this.PropertyChanged += OnPropertyChanged;
        }
Beispiel #5
0
        public void UpdateStats()
        {
            if (IsPartyStats)
            {
                return;
            }

            //update stats
            DamageFraction = _tracker.TotalDealt.Damage == 0 ? 1 : (double)Damage / _tracker.TotalDealt.Damage;
            Dps            = _tracker.CalculateDps(Damage);

            //update personal DPS
            var firstOrDefault = _skillLog.FirstOrDefault(s => _tracker.IsValidAttack(s));
            var lastOrDefault  = _skillLog.LastOrDefault(s => _tracker.IsValidAttack(s));

            PersonalDps = (firstOrDefault != null && lastOrDefault != null)
                ? _tracker.CalculateDps(Damage, lastOrDefault.Time - firstOrDefault.Time)
                : _tracker.CalculateDps(Damage, TimeSpan.Zero);
        }
Beispiel #6
0
 public static Mediafile GetSongByPath(this ThreadSafeObservableCollection <Mediafile> collection, string path)
 {
     return(collection?.FirstOrDefault(t => t.Path == path) ?? null);
 }
Beispiel #7
0
 public static Mediafile GetSongInCollection(this ThreadSafeObservableCollection <Mediafile> collection, Mediafile song)
 {
     return(collection?.FirstOrDefault(t => t.Id == song.Id) ?? null);
 }
Beispiel #8
0
 public static Mediafile GetCurrentlyPlaying(this ThreadSafeObservableCollection <Mediafile> collection)
 {
     return(collection?.FirstOrDefault(t => t.State == Core.Common.PlayerState.Playing) ?? null);
 }