Ejemplo n.º 1
0
        /// <summary>
        /// 包厢管理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbRoom_Click(object sender, EventArgs e)
        {
            if (null == roomWindow || roomWindow.IsDisposed)
            {
                roomWindow            = new RoomWindow();
                roomWindow.MdiParent  = this;
                roomWindow.StartLoad += (obj, ev) =>
                {
                    StartLoad(obj);
                };
                roomWindow.StopLoad += (obj, ev) =>
                {
                    StopLoad(obj);
                };
                roomWindow.ChangeName += (obj, ev) =>
                {
                    if (null != homeWindow && !homeWindow.IsDisposed)
                    {
                        homeWindow.RoomNoChange(obj as Room);
                    }
                    if (null != deviceWindow && !deviceWindow.IsDisposed)
                    {
                        deviceWindow.RealoadRoomNo();
                    }
                };
                roomWindow.RemoveRoom += (obj, ev) =>
                {
                    if (null != homeWindow && !homeWindow.IsDisposed)
                    {
                        homeWindow.RoomRemove(obj as Room);
                    }
                };
                roomWindow.AddRoom += (obj, ev) =>
                {
                    if (null != homeWindow && !homeWindow.IsDisposed)
                    {
                        homeWindow.RefreshSome(new List <long>()
                        {
                            (obj as Room).RoomId
                        });
                    }
                };


                roomWindow.Show();
            }

            SetSelect(tsbRoom, tsmiRoom);
            roomWindow.Activate();
        }