コード例 #1
0
 private List <AudioAttachmentUC> CreateControls()
 {
     return((List <AudioAttachmentUC>)Enumerable.ToList <AudioAttachmentUC>(Enumerable.Select <AudioObj, AudioAttachmentUC>(this._audioList, (Func <AudioObj, AudioAttachmentUC>)(audio =>
     {
         AudioAttachmentUC audioAttachmentUc = new AudioAttachmentUC();
         double width = this.Width;
         ((FrameworkElement)audioAttachmentUc).Width = width;
         Attachment attachment = new Attachment();
         attachment.type = "audio";
         attachment.audio = audio;
         string parentPostId = this._parentPostId;
         AttachmentViewModel attachmentViewModel = new AttachmentViewModel(attachment, parentPostId);
         ((FrameworkElement)audioAttachmentUc).DataContext = attachmentViewModel;
         Action <AudioAttachmentUC> action = new Action <AudioAttachmentUC>(this.OnPlayerStartedPlaying);
         audioAttachmentUc.NotifyStartedPlayingCallback = action;
         return audioAttachmentUc;
     }))));
 }
コード例 #2
0
        protected override void GenerateChildren()
        {
            List <AudioAttachmentUC> controls = this.CreateControls();
            double num1 = 0.0;
            double num2 = 0.0;

            List <AudioAttachmentUC> .Enumerator enumerator = controls.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    AudioAttachmentUC current = enumerator.Current;
                    ((FrameworkElement)current).Margin = (new Thickness(num2, num1, 0.0, num2));
                    this.Children.Add((FrameworkElement)current);
                    num1 += 72.0;
                }
            }
            finally
            {
                enumerator.Dispose();
            }
        }
コード例 #3
0
 private void OnPlayerStartedPlaying(AudioAttachmentUC control)
 {
     PlaylistManager.SetAudioAgentPlaylist(this._audios, CurrentMediaSource.AudioSource);
 }
コード例 #4
0
 private void OnPlayerStartedPlaying(AudioAttachmentUC sender)
 {
     PlaylistManager.SetAudioAgentPlaylist(this._audioList, this._isFromComment ? StatisticsActionSource.comments : CurrentMediaSource.AudioSource);
 }