예제 #1
0
 /// <summary>
 /// Initializes a new instance of the PLayerList class that contains layers copied
 /// from the specified list and that has the same initial capacity as the number
 /// of layers copied.
 /// </summary>
 /// <param name="list">The list whose layers are copied to the new list.</param>
 public PLayerList(PLayerList list)
 {
     foreach (PLayer layer in list)
     {
         List.Add(layer);
     }
 }
예제 #2
0
		/// <summary>
		/// Initializes a new instance of the PLayerList class that contains layers copied
		/// from the specified list and that has the same initial capacity as the number
		/// of layers copied.
		/// </summary>
		/// <param name="list">The list whose layers are copied to the new list.</param>
		public PLayerList(PLayerList list) {
			foreach(PLayer layer in list) {
				List.Add(layer);
			}
		}
예제 #3
0
		/// <summary>
		/// Adds the layers of the given list to the end of this list.
		/// </summary>
		/// <param name="list">
		/// The list whose layers should be added to the end of this list.
		/// </param>
		public void AddRange(PLayerList list) {
			InnerList.AddRange(list);
		}
예제 #4
0
 /// <summary>
 /// Adds the layers of the given list to the end of this list.
 /// </summary>
 /// <param name="list">
 /// The list whose layers should be added to the end of this list.
 /// </param>
 public void AddRange(PLayerList list)
 {
     InnerList.AddRange(list);
 }
예제 #5
0
		//****************************************************************
		// 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));
		}
예제 #6
0
		/// <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;
		}