Example #1
0
        private void HandleShapeChanged(object sender, ShapeEventArgs e)
        {
            Shape s = (Shape)sender;

            Console.WriteLine($"收到消息,当前面积是:{e.NewArea}");
            s.Draw();
        }
Example #2
0
 protected virtual void OnShapeChanged(ShapeEventArgs e)
 {
     //EventHandler<ShapeEventArgs> handler = ShapeChanged;
     //if (handler != null)
     //{
     //    handler(this, e);
     //}
     ShapeChanged?.Invoke(this, e);
 }
Example #3
0
 protected override void OnShapeChanged(ShapeEventArgs e)
 {
     base.OnShapeChanged(e);
 }