コード例 #1
0
ファイル: Detached.cs プロジェクト: KristianKKD/SSUtility2
        public void Detach(Detached detachable, bool destroy)
        {
            TabPage tp = detachable.settings.myLinkedPage;

            if (tp != null && settings.tC_PlayerSettings.TabPages.Contains(tp))
            {
                settings.tC_PlayerSettings.TabPages.Remove(tp);
            }

            detachable.RemoveSelfFromList();

            attachedPlayers.Remove(detachable);

            if (destroy)
            {
                detachable.DestroyPlayer();
                return;
            }

            detachable.settings.myLinkedPage = null;
            detachable.settings.isAttached   = false;

            bool wasPlaying = false;

            if (detachable.IsPlaying())
            {
                wasPlaying = true;
            }

            detachable.StopPlaying();
            detachable.settings.b_Detach.Text = "Attach";

            detachable.p_Player.Dispose();

            detachable.p_Player = (Panel)Tools.GetAllType(detachable, typeof(Panel)).First();
            detachable.Show();

            if (wasPlaying)
            {
                detachable.Play(false, false);
            }
        }
コード例 #2
0
 private void b_Stop_Click(object sender, EventArgs e)
 {
     myDetached.StopPlaying();
 }