Exemplo n.º 1
0
 public override void onPressClearBtn()
 {
     p1    = new Polygon();
     p2    = new Polygon();
     state = StateEnumWA.NonEnter;
     Shell.Instance.Clear();
     BTNEnter.Content = "Start Entering";
 }
Exemplo n.º 2
0
        public override void onPressMainBtn()
        {
            switch (state)
            {
            case StateEnumWA.NonEnter:
                state = StateEnumWA.FirstEnter;
                Shell.Instance.Clear();
                p1 = new Polygon();
                p2 = new Polygon();
                BTNEnter.Content   = "Enter First";
                BTNEnter.IsEnabled = false;
                break;

            case StateEnumWA.FirstEnter:
                Shell.Instance.StrokePolygon(p1, Colors.Green);
                state              = StateEnumWA.SecondEnter;
                BTNEnter.Content   = "Enter Second";
                BTNEnter.IsEnabled = false;
                break;

            case StateEnumWA.SecondEnter:
                Shell.Instance.StrokePolygon(p2, Colors.Blue);
                state            = StateEnumWA.ThirdEnter;
                BTNEnter.Content = "Clip";
                break;

            case StateEnumWA.ThirdEnter:
                foreach (Polygon p in Polygon.ClipWA(p1, p2))
                {
                    Shell.Instance.StrokePolygon(p, Colors.Red);
                }
                state            = StateEnumWA.NonEnter;
                BTNEnter.Content = "Start Entering";
                break;
            }
        }