ShowFrameTag.cs :  » GUI » SwfDotNet » SwfDotNet » IO » Tags » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » GUI » SwfDotNet 
SwfDotNet » SwfDotNet » IO » Tags » ShowFrameTag.cs
/*
  SwfDotNet is an open source library for writing and reading 
  Macromedia Flash (SWF) bytecode.
  Copyright (C) 2005 Olivier Carpentier - Adelina foundation
  see Licence.cs for GPL full text!
    
  SwfDotNet.IO uses a part of the open source library SwfOp actionscript 
  byte code management, writted by Florian Krsch, Copyright (C) 2004 .
  
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
  
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
  
  You should have received a copy of the GNU General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
using System;
using System.IO;
using System.Xml;
using System.Collections;

using SwfDotNet.IO.Utils;
using SwfDotNet.IO.Tags;

namespace SwfDotNet.IO.Tags{
  
  /// <summary>
  /// ShowFrameTag tag is used to instruct the Flash Player to 
  /// display a single frame in a movie or movie clip.
  /// </summary>
  /// <remarks>
  /// <p>
  /// When a frame is displayed the Flash Player performs the following:
  /// <ul>
  /// <li>The contents of the Flash Player's display list are drawn on the screen.</li>
  /// <li>Any actions defined using a DoActionTag object are executed.</li>
  /// </ul>
  /// </p>
  /// <p>
  /// Objects are placed in the display list using the PlaceObjectTag and 
  /// PlaceObject2Tag classes and removed using the RemoveObjectTag and 
  /// RemoveObject2Tag classes. An object which has been added to the 
  /// display list will be displayed in each frame until it is explicitly 
  /// removed. There is no need to repeatedly add it to the display list.
  /// </p>
  /// <p>
  /// The scope of a frame is delineated by successive ShowFrameTag objects. 
  /// All the commands that affect change the state of the display list or 
  /// define actions to be executed take effect when the Flash Player displays 
  /// the frame. All the objects displayed in a frame must be defined before 
  /// they can be displayed. The movie is displayed as it is downloaded so 
  /// displaying objects that are defined later in a movie is not allowed.
  /// </p>
  /// <p>
  /// This tag was introduced in Flash 1.
  /// </p>
  /// </remarks>
  /// <example>
    /// <p>
    /// <code lang="C#">
    /// Swf swf = new Swf();
    /// // Frame 1 - starts from the beginning of the file....
    /// swf.Add(new ShowFrameTag());
    /// // Frame 2 - starts when the previous frame is displayed.
    /// // All displayable objects are referenced using unique identifier.
    /// int identifer = swf.newIdentifier();
    /// // Define a shape to be displayed.
    /// swf.Add(new DefineShapeTag(identifer, ......));
    /// // Add the shape to the display list - on layer 1 at coordinates (400, 400)
    /// swf.Add(new PlaceObjectTag(identifier, 1, 400, 400));
    /// // Add some actions
    /// DoActionTag frameActions = new DoActionTag(); 
    /// frameActions.add(anAction);
    /// frameActions.add(anotherAction);
    /// swf.Add(frameActions);
    /// // The shape is displayed and the actions executed when the FSShowFrame command is executed.
    /// swf.Add(new ShowFrameTag());
    /// </code>
    /// </p>
  /// </example>
  public class ShowFrameTag : BaseTag 
    {
        #region Ctor

        /// <summary>
        /// Creates a new <see cref="ShowFrameTag"/> instance.
        /// </summary>
    public ShowFrameTag() 
    {
      this._tagCode = (int)TagCodeEnum.ShowFrame;
    }

        #endregion

        #region Methods

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);
        }
    
    /// <summary>
    /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
    /// </summary>
    public override void UpdateData(byte version) 
    {      
      MemoryStream m = new MemoryStream();
      BufferedBinaryWriter w = new BufferedBinaryWriter(m);
      
      RecordHeader rh = new RecordHeader(TagCode, 0);
      rh.WriteTo(w);
      
            w.Flush();
      // write to data array
      _data = m.ToArray();  
    }    

    /// <summary>
    /// Serializes the specified writer.
    /// </summary>
    /// <param name="writer">Writer.</param>
    public override void Serialize(XmlWriter writer)
    {
      writer.WriteStartElement("ShowFrameTag");
      writer.WriteEndElement();
    }

    #endregion
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.