コード例 #1
0
 public async void SetStationInfo()
 {
     await Task.Factory.StartNew(() =>
     {
         Dispatcher.Invoke(() => RadioName.BeginAnimation(Label.OpacityProperty, AnimDown));          //NOT WORKING
         Dispatcher.Invoke(() => RadioArtist.BeginAnimation(Label.OpacityProperty, AnimDown));        //NOT WORKING
         Dispatcher.Invoke(() => RadioSongName.BeginAnimation(Label.OpacityProperty, AnimDown));      //NOT WORKING
         Dispatcher.Invoke(() => RadioInfo.BeginAnimation(Label.OpacityProperty, AnimDown));          //NOT WORKING
         Dispatcher.Invoke(() => RadioLogo.BeginAnimation(Image.OpacityProperty, AnimDown));          //NOT WORKING
     })
     .ContinueWith((prevTask) =>
     {
         prevTask.Wait();
         Dispatcher.Invoke(() => ClearStationInfo());
         Dispatcher.Invoke(() => RadioName.Content     = StationToPlay.StationName);
         Dispatcher.Invoke(() => RadioArtist.Content   = StationToPlay.TrackArtist);
         Dispatcher.Invoke(() => RadioSongName.Content = StationToPlay.TrackName);
         Dispatcher.Invoke(() => RadioInfo.Content     = StationToPlay.ChannelInfo);
         Dispatcher.Invoke(() => RadioLogo.Source      = StationToPlay.TrackPicture);
     })
     .ContinueWith((prevTask) =>
     {
         prevTask.Wait();
         Dispatcher.Invoke(() => RadioName.BeginAnimation(Label.OpacityProperty, AnimHigh));
         Dispatcher.Invoke(() => RadioArtist.BeginAnimation(Label.OpacityProperty, AnimHigh));
         Dispatcher.Invoke(() => RadioSongName.BeginAnimation(Label.OpacityProperty, AnimHigh));
         Dispatcher.Invoke(() => RadioInfo.BeginAnimation(Label.OpacityProperty, AnimHigh));
         Dispatcher.Invoke(() => RadioLogo.BeginAnimation(Image.OpacityProperty, AnimHigh));
     });
 }
コード例 #2
0
ファイル: ApplicationToolStrip.cs プロジェクト: x893/WDS
        public void setLogo(RadioLogo logo)
        {
            switch (logo)
            {
                case RadioLogo.Receiver:
                    tslRadioLogo.Image = ToolStripResources.RX_24x24;
                    tslRadioLogo.ToolTipText = "Receiver";
                    return;

                case RadioLogo.Transmitter:
                    tslRadioLogo.Image = ToolStripResources.TX_24x24;
                    tslRadioLogo.ToolTipText = "Transmitter";
                    return;

                case RadioLogo.Transceiver:
                    tslRadioLogo.Image = ToolStripResources.TRX_24x24;
                    tslRadioLogo.ToolTipText = "Transceiver";
                    return;
            }
            tslRadioLogo.Image = ToolStripResources.X_24x24;
            tslRadioLogo.ToolTipText = "Radio";
        }