Example #1
0
		public Line(Line prototype): base(prototype)
		{
			mAllowMove = prototype.AllowMove;
			mLineJoin = prototype.LineJoin;
			mDrawSelected = prototype.DrawSelected;
			mInteraction = prototype.Interaction;
			
			//Set up new origins
			Start = new Origin(prototype.FirstPoint);
			End = new Origin(prototype.LastPoint);

			Start.Marker = prototype.Start.Marker;
			End.Marker = prototype.End.Marker;

			mPoints = (ArrayList) prototype.Points.Clone();

			//Copy ports
			Ports = new Elements(typeof(Port),"Port");
			foreach (Port port in prototype.Ports.Values)
			{
				Port clone = (Port) port.Clone();
				Ports.Add(port.Key,clone);
				
				clone.SuspendValidation();
				clone.Location = port.Location;
				clone.ResumeValidation();
			}

			if (prototype.Animation != null) mAnimation = (Animation) prototype.Animation.Clone();

			DrawPath();
		}
Example #2
0
		//Creates a new element by copying an existing element
		public Animation(Animation prototype)
		{
			mTotalFrames = prototype.TotalFrames;
			mFramesPerSecond = prototype.FramesPerSecond;
		}
Example #3
0
		public Shape(Shape prototype): base(prototype)
		{
			mAllowMove = prototype.AllowMove;
			mAllowScale = prototype.AllowScale;
			mAllowRotate = prototype.AllowRotate;
			mDrawSelected = prototype.DrawSelected;
			mDirection = prototype.Direction;
			mInteraction = prototype.Interaction;
			
			mMaximumSize = prototype.MaximumSize;
			mMinimumSize = prototype.MinimumSize;
			mKeepAspect = prototype.KeepAspect;

			//Copy ports
			Ports = new Elements(typeof(Port),"Port");
			foreach (Port port in prototype.Ports.Values)
			{
				Port clone = (Port) port.Clone();
				Ports.Add(port.Key,clone);
				
				clone.SuspendValidation();
				clone.Location = port.Location;
				clone.ResumeValidation();
			}

			if (prototype.Animation != null) mAnimation = (Animation) prototype.Animation.Clone();
		}