Ejemplo n.º 1
0
        private void menu_item_Click(object sender, RoutedEventArgs e)
        {
            var clickindex = 0;
            var buttons    = ZJVTHelper.FindChilds <Button>(toolbar_list, "toolbar_item");

            for (var i = 0; i < buttons.Count; i++)
            {
                if (buttons[i] == sender)
                {
                    clickindex = i;
                    break;
                }
            }
            if (clickindex < pageData.menuList.Count)
            {
                var menudata = pageData.menuList[clickindex];
                if (clickindex == 0)
                {
                    pageData.menuList[0].Selected = true;
                    pageData.menuList[1].Selected = false;
                    pageData.menuList[0].Pic      = "../Images/Blackboard/class_2s.png";
                    pageData.menuList[1].Pic      = "../Images/Blackboard/class_3un.png";
                    myblackboard.change_pen();
                }
                else if (clickindex == 1)
                {
                    pageData.menuList[0].Selected = false;
                    pageData.menuList[1].Selected = true;
                    pageData.menuList[0].Pic      = "../Images/Blackboard/class_2un.png";
                    pageData.menuList[1].Pic      = "../Images/Blackboard/class_3s.png";
                    myblackboard.change_erase();
                }
                else if (clickindex == 2)
                {
                    myblackboard.clear();
                }
                else if (clickindex == 3)
                {
                    myblackboard.undo();
                }
                else if (clickindex == 4)
                {
                    myblackboard.redo();
                }
                else if (clickindex == 5)
                {
                    this.Hide();
                }
            }
        }
Ejemplo n.º 2
0
        private void toolbar_item_Click(object sender, RoutedEventArgs e)
        {
            var clickindex = 0;
            var buttons    = ZJVTHelper.FindChilds <Button>(toolbar_list, "toolbar_item");

            for (var i = 0; i < buttons.Count; i++)
            {
                if (buttons[i] == sender)
                {
                    clickindex = i;
                    break;
                }
            }
            var item = pageData.menuList[clickindex];

            if (clickindex == 0)
            {
                this.Close();
            }
            else if (clickindex == 2)
            {
                if (blackboardWin == null)
                {
                    blackboardWin         = new BlackboardWin();
                    blackboardWin.Topmost = true;
                    blackboardWin.Width   = pwidth;
                    blackboardWin.Height  = pHeight;
                    blackboardWin.Left    = 0;
                    blackboardWin.Top     = 0;
                    blackboardWin.Owner   = this;
                }

                blackboardWin.ShowDialog();
            }
            else if (clickindex == 3)
            {
                if (blackboardWin2 == null)
                {
                    blackboardWin2         = new ZBlackboardWin();
                    blackboardWin2.Topmost = true;
                    blackboardWin2.Width   = pwidth;
                    blackboardWin2.Height  = pHeight;
                    blackboardWin2.Left    = 0;
                    blackboardWin2.Top     = 0;
                    blackboardWin2.Owner   = this;
                }
                blackboardWin2.ShowDialog();
            }
            else if (clickindex == 4)
            {
                this.Hide();
                PracticeWin practiceWin = new PracticeWin();
                practiceWin.Topmost = true;
                practiceWin.Width   = pwidth;
                practiceWin.Height  = pHeight;
                practiceWin.Left    = 0;
                practiceWin.Top     = 0;
                practiceWin.Owner   = this;
                practiceWin.ShowDialog();
                practiceWin.Unloaded += PracticeWin_Unloaded;
            }
            else if (clickindex == 7)
            {
                if (item.Name == "熄屏")
                {
                    item.Name = "恢复";
                }
                else
                {
                    item.Name = "熄屏";
                }
            }
            else if (clickindex == 8)
            {
                var rtmpWin = new ZJRtmpWin();
                rtmpWin.Topmost = true;
                rtmpWin.Width   = 360;
                rtmpWin.Height  = 400;
                rtmpWin.ShowDialog();
                rtmpWin.Owner = this;
            }
        }