Example #1
0
        //[UnitTest]
        static bool TestCloneability()
        {
            MagicDocument fixture = CreateDocumentFixture();
            MagicDocument result  = fixture.Clone();

            if (Object.ReferenceEquals(fixture, result))
            {
                Console.Error.WriteLine("dude, come on...");
            }

            return(CompareDocuments(fixture, result));
        }
Example #2
0
    private void hover_AnimateClicked(object sender, EventArgs e)
    {
        dbg.WriteLine("----- hover_AnimateClicked -----");

        PhysicsIllustrator.SmartTag.SmartTag tag = sender as PhysicsIllustrator.SmartTag.SmartTag;

        // Running or stopping?
        if (inkoverlay.Enabled)
        {
            // Lock down all editing operations.
            DisableInkOverlay();
            if (bodytag.Visible)
            {
                bodytag.Hide();
            }

            // Change tag to red x.
            hover.Enabled = false;
            tag.Image     = Global.LoadImage("Resources.StopAnimation.ico");
            menuttip.SetToolTip(tag, "Stop!");
            tag.Show();

            // Fork the document for animation.
            MagicDocument animedoc = doc.Clone();

            // Run the animation!
            engine = new AnimationEngine();
            engine.Start(animedoc, this);
        }
        else         // stopping
        {
            engine.Stop();

            inkoverlay.Enabled = true;

            tag.Image = Global.LoadImage("Resources.Animate.ico");
            menuttip.SetToolTip(tag, "Animate!");
            hover.Enabled = true;
            hover.DisplayInitial();
            Invalidate();
        }
    }