Пример #1
0
        void cb_Checked(object sender, RoutedEventArgs e)
        {
            if (sender == cbPlayground)
            {
                if (draw != null)
                {
                    draw.SetPlaygroundVisible(Visibility.Visible);
                }
            }

            if (sender == cbTitle)
            {
                if (draw != null)
                {
                    draw.Add(label);
                }
            }

            if (sender == cbColor)
            {
                if (draw != null)
                {
                    draw.SetPlaygroundColor(Webb.Playbook.Data.PlaygroundColors.Color);
                }
            }

            if (sender == cbSymbolColor)
            {
                if (draw != null)
                {
                    draw.SetFiguresColor(true);
                }
            }
        }
Пример #2
0
        private void listBoxTool_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (Mouse.DirectlyOver is FrameworkElement)
            {
                Tool selectedTool = (Mouse.DirectlyOver as FrameworkElement).DataContext as Tool;

                if (selectedTool != null)
                {
                    switch (selectedTool.Command)
                    {
                    case Commands.Label:
                    {
                        string file = AppDomain.CurrentDomain.BaseDirectory + "Labels\\" + selectedTool.Text;
                        if (System.IO.File.Exists(file))
                        {
                            PBLabel label = new PBLabel();
                            Drawing.Add(label);
                            label.LoadLabel(file);
                            label.Coordinates = new Point(-8, 5);
                            label.UpdateVisual();
                            this.DialogResult = false;
                            this.CloseWindow();
                        }
                    }
                    break;

                    case Commands.CreateNewLabel:
                    {
                        this.DialogResult = true;
                        this.CloseWindow();
                    }
                    break;
                    }
                }
            }
        }