Пример #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     mediaControl = new MediaControl();
     mediaControl.Dock = DockStyle.Fill;
     Controls.Add(mediaControl);
     mediaControl.BringToFront();
 }
Пример #2
0
        public static void Release(MediaControl mc)
        {
            mc.Close();
            mc.WMP.close();
            mc.WMP.Dispose();
            mc.WMP.Parent = null;

            mc.Dispose();
            mc.Parent = null;
            mc.mediaToDisplay = null;

            /*lock (poolOfControls)
            {
                if (poolOfControls.Contains(mc) == false)
                {
                    poolOfControls.Add(mc);
                }
            }*/
        }
Пример #3
0
 public DoubleClickMessageFilter(MediaControl c)
 {
     control = c;
 }
Пример #4
0
        public static MediaControl Get()
        {
            MediaControl mc = null;

            lock (poolOfControls)
            {
                if (poolOfControls.Count > 1)
                {
                    mc = poolOfControls[0];
                    poolOfControls.Remove(mc);
                }

                if (mc == null)
                {
                    mc = new MediaControl();
                    mc.Name = string.Format("MediaControl#{0}", ++controlsIDGenerator);
                }
            }

            return mc;
        }