public override void Initialize()
        {
            PRoot              root      = Canvas.Root;
            PLayer             layer     = Canvas.Layer;
            PActivityScheduler scheduler = root.ActivityScheduler;

            PNode singlePulse = new PNode();

            singlePulse.Brush = new SolidBrush(Color.White);
            singlePulse.SetBounds(0, 0, 60, 60);
            PNode repeatPulse = new PNode();

            repeatPulse.Brush = new SolidBrush(Color.White);
            repeatPulse.SetBounds(60, 60, 60, 60);;
            PNode repeatReversePulse = new PNode();

            repeatReversePulse.Brush = new SolidBrush(Color.White);
            repeatReversePulse.SetBounds(120, 120, 60, 60);

            layer.AddChild(singlePulse);
            layer.AddChild(repeatPulse);
            layer.AddChild(repeatReversePulse);

            PColorActivity singlePulseActivity        = new PColorActivity(1000, 0, 1, ActivityMode.SourceToDestination, new PulseTarget(singlePulse), Color.Orange);
            PColorActivity repeatPulseActivity        = new PColorActivity(1000, 0, 5, ActivityMode.SourceToDestination, new PulseTarget(repeatPulse), Color.Blue);
            PColorActivity repeatReversePulseActivity = new PColorActivity(500, 0, 10, ActivityMode.SourceToDestination, new PulseTarget(repeatReversePulse), Color.Green);

            scheduler.AddActivity(singlePulseActivity);
            scheduler.AddActivity(repeatPulseActivity);
            scheduler.AddActivity(repeatReversePulseActivity);

            base.Initialize();
        }
Example #2
0
        public override void Initialize()
        {
            PRoot              root      = Canvas.Root;
            PLayer             layer     = Canvas.Layer;
            PActivityScheduler scheduler = root.ActivityScheduler;

            PNode singlePulse        = PPath.CreateRectangle(0, 0, 100, 80);;
            PPath repeatPulse        = PPath.CreateRectangle(100, 80, 100, 80);;
            PNode repeatReversePulse = PPath.CreateRectangle(200, 160, 100, 80);;

            layer.AddChild(singlePulse);
            layer.AddChild(repeatPulse);
            layer.AddChild(repeatReversePulse);

            PColorActivity singlePulseActivity        = new PColorActivity(1000, 0, 1, ActivityMode.SourceToDestination, new PulseTarget(singlePulse), Color.Orange);
            PColorActivity repeatPulseActivity        = new PColorActivity(1000, 0, 5, ActivityMode.SourceToDestination, new PulseTarget(repeatPulse), Color.Blue);
            PColorActivity repeatReversePulseActivity = new PColorActivity(500, 0, 10, ActivityMode.SourceToDestination, new PulseTarget(repeatReversePulse), Color.Green);

            scheduler.AddActivity(singlePulseActivity);
            scheduler.AddActivity(repeatPulseActivity);
            scheduler.AddActivity(repeatReversePulseActivity);
        }