当前位置: 首页>>代码示例>>C#>>正文


C# Shape.Clone方法代码示例

本文整理汇总了C#中Shape.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Shape.Clone方法的具体用法?C# Shape.Clone怎么用?C# Shape.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shape的用法示例。


在下文中一共展示了Shape.Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShapeInfoDialog

        /// <summary>
        /// Displays a dialog showing various information on the given shape:
        /// Template, shape type, shape library and the shape's control points including their capabilities and connected shapes.
        /// </summary>
        public ShapeInfoDialog(Project project, Shape shape)
        {
            if (project == null) throw new ArgumentNullException("project");
            if (shape == null) throw new ArgumentNullException("shape");
            InitializeComponent();

            this.project = project;

            Rectangle shapeBounds = shape.GetBoundingRectangle(false);
            this.shape = shape;
            this.shapeClone = shape.Clone();
            this.shapeClone.Fit(0, 0, shapeBounds.Width, shapeBounds.Height);

            this.diagram.Size = shapeBounds.Size;
            this.diagram.Shapes.Add(shapeClone);

            diagramSetController.Project = project;
            display.DrawDiagramSheet = false;
            display.Diagram = diagram;
            display.ShowGrid = false;
            display.GripSize = 5;
            display.HighQualityRendering = true;
            display.RenderingQualityHighQuality = RenderingQuality.MaximumQuality;
            display.CurrentTool = tool;

            UpdateShapeInfo();
        }
开发者ID:kjburns31,项目名称:vixen-modules,代码行数:31,代码来源:ShapeInfoDialog.cs

示例2: CanRotateShape

        public bool CanRotateShape(Shape shape)
        {
            Shape rotatedShape = (Shape)shape.Clone();
            rotatedShape.Rotate();

            return !IsSidesCollision(rotatedShape) && !IsRoofCollision(rotatedShape);
        }
开发者ID:leandro86,项目名称:TetrisXNA,代码行数:7,代码来源:Board.cs

示例3: DoCloneShape

		private static Shape DoCloneShape(Shape shape, bool cloneModelObject)
		{
			Shape result = shape.Clone();
			if (cloneModelObject) DoCloneShapeModelObject(result);
			else {
				// ToDo: For now, we delete assigned model objects. Resolve this issue later ("Cannot delete modelObject if there is a copied shape referencing the model object")
				if (result.ModelObject != null) result.ModelObject = null;
			}
			return result;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:10,代码来源:ShapeDuplicator.cs

示例4: Fixture

        public Fixture(PhysicsBody body, Shape shape, object userData)
        {
            if (Settings.UseFPECollisionCategories)
                _collisionCategories = Category.All;
            else
                _collisionCategories = Category.Cat1;

            _collidesWith = Category.All;
            _collisionGroup = 0;

            //Fixture defaults
            Friction = 0.2f;
            Restitution = 0;

            IsSensor = false;

            Body = body;
            UserData = userData;

            if (Settings.ConserveMemory)
                Shape = shape;
            else
                Shape = shape.Clone();

            RegisterFixture();
        }
开发者ID:LostCodeStudios,项目名称:GameLib,代码行数:26,代码来源:Fixture.cs


注:本文中的Shape.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。