context: #if XNATOUCH
  using XnaTouch.Framework;
  using XnaTouch.Framework.Audio;
  using XnaTouch.Framework.Content;
  using XnaTouch.Framework.GamerServices;
  using XnaTouch.Framework.Graphics;
  using XnaTouch.Framework.Input;
  using XnaTouch.Framework.Media;
  using XnaTouch.Framework.Net;
  using XnaTouch.Framework.Storage;
  #else
  using Microsoft.Xna.Framework;
  using Microsoft.Xna.Framework.Audio;
  using Microsoft.Xna.Framework.Content;
  
  using Microsoft.Xna.Framework.Graphics;
  using Microsoft.Xna.Framework.Input;
  using Microsoft.Xna.Framework.Media;
  
  
  #endif
  
  using System;
  using System.Collections.Generic;
  using System.Text;
  using System.ComponentModel;
  using IceCream.Components;
  using System.Xml.Serialization;
  using System.Xml;
  using System.Reflection;
  using IceCream.SceneItems;
  using IceCream.Attributes;
  
  namespace IceCream
  {
      public class SceneItem : IceBase
      {
          #region Fields
  
          private bool _visible = true;
          internal int spatialIndex = 0;
          private float _rotation;
          private int _layer;
          private bool _markForDelete;
          private bool _ignoreCamera;
          private bool _isTemplate = false;
          private bool _isRegistered;
          private Vector2 _lastposition;
          private Vector2 _position;
          private Vector2 _pivot;
          private bool _isPivotRelative;
          private Vector2 _scale = Vector2.One;
          private List<IceComponent> _components = new List<IceComponent>();
          private IceScene _sceneParent = null; // null if global for now        
          private Rectangle _boundingRect = new Rectangle(0, 0, 20, 20);
          private uint _objectType;
          internal List<LinkFuse> fuses = new List<LinkFuse>();
  
          // Link points and mount specifics
          private List<LinkPoint> _linkPoints = new List<LinkPoint>();
          private SceneItem _mountOwner = null;
          private LinkPoint _mountedLinkPoint = null;
          private LinkPoint _mountedTargetLinkPoint = null;
  
          private static Vector2[] verticesBuffer = new Vector2[4];
  
          #endregion
  
          #region Properties
  
          [BrowsableAttribute(false), XmlIgnore]
          public IceScene SceneParent
          {
              get { return _sceneParent; }
              set { _sceneParent = value; }
          }
  
          public bool LockedPosition { get; set; }
  
          /// <summary>
          /// Gets the value of wether this SceneItem is Mounted to another object
          /// </summary>
          [BrowsableAttribute(false)]
          public bool IsMounted
          {
              get { return (_mountOwner != null); }
          }
  
          [BrowsableAttribute(false), XmlIgnore]
          public bool IsRegistered { get { return _isRegistered; } set { _isRegistered = value; } }
  
          [BrowsableAttribute(false), XmlIgnore]
          public SceneItem MountOwner
          {
              get { return _mountOwner; }
          }
  
          [BrowsableAttribute(false), XmlIgnore]
          public bool MarkForDelete
          {
              get { return _markForDelete; }
              set { _markForDelete = value; }
          }
  
          [CategoryAttribute("Layout"), DescriptionAttribute("The position of the item inside the scene")]
          public virtual Vector2 Position
          {
              get { return _position; }
              set
              {
                  if (LockedPosition)
                  {
                      return;
                  }
                  _position = value;
                  UpdateBoundingRect();
              }
          }
  
          [CategoryAttribute("Layout"), DescriptionAttribute("The pivot point around which the rotation will be performed")]
          public virtual Vector2 Pivot
          {
              get { return _pivot; }
              set
              {
                  _pivot = value;
                  UpdateBoundingRect();
              }
          }
  
          [CategoryAttribute("Layout"), DescriptionAttribute("The scale factor of the SceneItem on both axis")]
          public virtual Vector2 Scale
          {
              get { return _scale; }
              set 
              { 
                  _scale = value;
                  UpdateBoundingRect();
              }
          }
  
          [CategoryAttribute("Layout"), DescriptionAttribute("The opacity of the SceneItem, if applicable, from 0 to 255")]
          public virtual byte Opacity
          {
              get;
              set;
          }
  
          [CategoryAttribute("Layout"), DescriptionAttribute("If set to true, the scene items position will be absoloute on the screen")]
          public bool IgnoreCameraPosition
          {
              get { return _ignoreCamera; }
              set
              {
                  _ignoreCamera = value;
              }
          }
  
          [XmlIgnore()]
          public virtual float PositionY
          {
              get { return _position.Y; }
              set
              {
                  if (LockedPosition)
                      return;
                  _position.Y = value;
                  UpdateBoundingRect();
              }
          }
          
          [XmlIgnore()]
          public virtual float PositionX
          {
              get { return _position.X; }
              set
              {
                  if (LockedPosition)
                      return;
                  _position.X = value;
                  UpdateBoundingRect();
              }
          }
  
          [BrowsableAttribute(false),XmlIgnore]
          public virtual Rectangle BoundingRect
          {
              get { return _boundingRect; }
              set { _boundingRect = value; }
          }
  
          [CategoryAttribute("Layout"), DescriptionAttribute("The rotation angle of the scene item")]
          public virtual float Rotation
          {
              get { return _rotation; }
              set { _rotation = value; }
          }
  
          [CategoryAttribute("Layout"), DescriptionAttribute("The layer in which the item is located inside the scene")]
          #if WINDOWS
          [TypeConverter(typeof(IceCream.SceneItems.TypeConverters.LayerConverter))]
          #endif
          public virtual int Layer
          {
              get { return _layer; }
              set { _layer = value; }
          }
  
          [BrowsableAttribute(false)]
          public virtual bool IsTemplate
          {
  
gt:             get { return _isTemplate; }