Пример #1
0
        private void ColorCircle_Click(object sender, EventArgs e)
        {
            if (!diagram.PageSettings.ShowGrid)
            {
                return;
            }
            ColorCircle circle = (ColorCircle)sender;

            diagram.PageSettings.GridColor = circle.m_color;
            circle.Selected = true;
            circle.SetWillNotDraw(true);
            circle.SetWillNotDraw(false);
            for (int i = 0; i < scrollLayout.ChildCount; i++)
            {
                ColorCircle colorCircle = scrollLayout.GetChildAt(i) as ColorCircle;
                if (colorCircle.m_color.ToString().Equals(circle.m_color.ToString()))
                {
                    continue;
                }
                else if (colorCircle.Selected)
                {
                    colorCircle.Selected = false;
                    colorCircle.SetWillNotDraw(true);
                    colorCircle.SetWillNotDraw(false);
                }
            }
        }
Пример #2
0
 private void ShowGridSwitch_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e)
 {
     diagram.PageSettings.ShowGrid = e.IsChecked;
     snapToGridSwitch.Enabled      = e.IsChecked;
     if (!e.IsChecked)
     {
         for (int i = 0; i < scrollLayout.ChildCount; i++)
         {
             ColorCircle circle = scrollLayout.GetChildAt(i) as ColorCircle;
             if (circle.Selected)
             {
                 circle.Selected = false;
                 circle.SetWillNotDraw(true);
                 circle.SetWillNotDraw(false);
             }
         }
         diagram.PageSettings.SnapToGrid = false;
         snapToGridSwitch.Checked        = false;
     }
 }