Ejemplo n.º 1
0
        /// <summary>
        /// Read <see cref="SwfOp.ByteCode.Actions.ActionGotoFrame2">ActionGotoFrame2</see> from swf.
        /// </summary>
        private ActionGotoFrame2 ReadActionGotoFrame2(BinaryReader br)
        {
            int len = Convert.ToInt32(br.ReadUInt16());

            byte[] b = br.ReadBytes(len);

            ActionGotoFrame2 a = new ActionGotoFrame2(b);

            //a.ByteSize = len+3;

            return(a);
        }
Ejemplo n.º 2
0
        XElement IActionVisitor <XElement, XElement> .Visit(ActionGotoFrame2 action, XElement param)
        {
            var res = new XElement(XActionNames.FromAction(action),
                                   new XAttribute("play", CommonFormatter.Format(action.Play)));

            if (action.SceneBias.HasValue)
            {
                res.Add(new XAttribute("bias", action.SceneBias.Value));
            }
            if (action.Reserved != 0)
            {
                res.Add(new XAttribute("reserved", action.Reserved));
            }
            return(res);
        }
Ejemplo n.º 3
0
        ActionBase IActionVisitor <XElement, ActionBase> .Visit(ActionGotoFrame2 action, XElement xAction)
        {
            var xBias     = xAction.Attribute("bias");
            var xReserved = xAction.Attribute("reserved");

            action.Play = xAction.RequiredBoolAttribute("play");
            if (xBias != null)
            {
                action.SceneBias = ushort.Parse(xBias.Value);
            }
            if (xReserved != null)
            {
                action.Reserved = byte.Parse(xReserved.Value);
            }
            return(action);
        }