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; })))); }
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(); } }
private void OnPlayerStartedPlaying(AudioAttachmentUC control) { PlaylistManager.SetAudioAgentPlaylist(this._audios, CurrentMediaSource.AudioSource); }
private void OnPlayerStartedPlaying(AudioAttachmentUC sender) { PlaylistManager.SetAudioAgentPlaylist(this._audioList, this._isFromComment ? StatisticsActionSource.comments : CurrentMediaSource.AudioSource); }