/// <summary> /// Constructs a new camera with no layers and a default white color. /// </summary> public PCamera() : base() { viewMatrix = new PMatrix(); layers = new PLayerList(); viewConstraint = CameraViewConstraint.None; Brush = new SolidBrush(Color.White); }
//**************************************************************** // Serialization - Cameras conditionally serialize their layers. // This means that only the layer references that were unconditionally // (using GetObjectData) serialized by someone else will be restored // when the camera is deserialized. //****************************************************************/ /// <summary> /// Read this this camera and all its children from the given SerializationInfo. /// </summary> /// <param name="info">The SerializationInfo to read from.</param> /// <param name="context"> /// The StreamingContext of this serialization operation. /// </param> /// <remarks> /// This constructor is required for Deserialization. /// </remarks> protected PCamera(SerializationInfo info, StreamingContext context) : base(info, context) { layers = new PLayerList(); int count = info.GetInt32("layerCount"); for (int i = 0; i < count; i++) { PLayer layer = (PLayer)info.GetValue("layer" + i, typeof(PLayer)); if (layer != null) { layers.Add(layer); } } canvas = (PCanvas)info.GetValue("canvas", typeof(PCanvas)); }
/// <summary> /// Constructs a new camera with no layers and a default white color. /// </summary> public PCamera() : base() { viewMatrix = new PMatrix(); layers = new PLayerList(); viewConstraint = CameraViewConstraint.None; }