private static void PutAnimationBlock(AnimationBlock block, MessageFrameBuilder builder)
        {
            var animation = block.Animation;

            builder.Put(MessageType.Short, DataOrder.Little, animation.Id);
            builder.Put(MessageType.Byte, DataTransformation.Negate, animation.Delay);
        }
示例#2
0
        public void TestFileBlockIds()
        {
            var fileBlock       = new FileBlock();
            var animBlock       = new AnimationBlock();
            var animHeaderBlock = new AnimationHeaderBlock();
            var sheetBlock      = new AnimationSheetBlock();
            var frameBlock      = new FrameBlock();
            var treeBlock       = new ProjectTreeBlock();

            // Assert block IDs
            Assert.AreEqual(FileBlock.BLOCKID_NULL, fileBlock.BlockID,
                            "The ID for the FileBlock must equal to FileBlock.BLOCKID_NULL");

            Assert.AreEqual(FileBlock.BLOCKID_ANIMATION, animBlock.BlockID,
                            "The ID for the AnimationBlock instance does not match the ID specified for it on the FileBlock class");

            Assert.AreEqual(FileBlock.BLOCKID_ANIMATION_HEADER, animHeaderBlock.BlockID,
                            "The ID for the AnimationHeaderBlock instance does not match the ID specified for it on the FileBlock class");

            Assert.AreEqual(FileBlock.BLOCKID_ANIMATIONSHEET, sheetBlock.BlockID,
                            "The ID for the AnimationSheetBlock instance does not match the ID specified for it on the FileBlock class");

            Assert.AreEqual(FileBlock.BLOCKID_FRAME, frameBlock.BlockID,
                            "The ID for the frameBlock instance does not match the ID specified for it on the FileBlock class");

            Assert.AreEqual(FileBlock.BLOCKID_PROJECTTREE, treeBlock.BlockID,
                            "The ID for the treeBlock instance does not match the ID specified for it on the FileBlock class");
        }
示例#3
0
 private void ApplyWithoutAnimation(AnimationBlock animations)
 {
     if (animations!=null)
     {
         CATransaction.Begin();
         CATransaction.SetValueForKey(new NSNumber(true),CATransaction.DisableActionsKey);
         animations();
         CATransaction.Commit();
     }
 }