protected override void AssignDefaultValuesToSceneNode(SceneNode2D node) { base.AssignDefaultValuesToSceneNode(node); var c = node as ShapeNode2D; c.StrokeDashArray = StrokeDashArray == null ? new float[0] : StrokeDashArray.Select(x => (float)x).ToArray(); c.StrokeDashCap = StrokeDashCap.ToD2DCapStyle(); c.StrokeDashOffset = (float)StrokeDashOffset; c.StrokeEndLineCap = StrokeEndLineCap.ToD2DCapStyle(); c.StrokeLineJoin = StrokeLineJoin.ToD2DLineJoin(); c.StrokeMiterLimit = (float)StrokeMiterLimit; c.StrokeStartLineCap = StrokeStartLineCap.ToD2DCapStyle(); c.StrokeThickness = (float)StrokeThickness; c.StrokeDashStyle = DashStyle.ToD2DDashStyle(); }
protected override void AssignDefaultValuesToSceneNode(SceneNode2D node) { base.AssignDefaultValuesToSceneNode(node); var c = node as BorderNode2D; c.CornerRadius = (float)CornerRadius; c.Padding = Padding.ToD2DThickness(); c.StrokeDashCap = StrokeDashCap.ToD2DCapStyle(); c.StrokeDashOffset = (float)StrokeDashOffset; c.StrokeDashStyle = StrokeDashStyle.ToD2DDashStyle(); c.StrokeEndLineCap = StrokeEndLineCap.ToD2DCapStyle(); c.StrokeLineJoin = StrokeLineJoin.ToD2DLineJoin(); c.StrokeMiterLimit = (float)StrokeMiterLimit; c.StrokeStartLineCap = StrokeStartLineCap.ToD2DCapStyle(); c.BorderThickness = BorderThickness.ToD2DThickness(); }
public virtual bool AddChildNode(SceneNode2D node) { if (!itemHashSet.ContainsKey(node.GUID)) { itemHashSet.Add(node.GUID, node); ItemsInternal.Add(node); node.Parent = this; if (IsAttached) { node.Attach(RenderHost); } return(true); } else { return(false); } }
/// <summary> /// Tries the get node. /// </summary> /// <param name="guid">The unique identifier.</param> /// <param name="node">The node.</param> /// <returns></returns> public bool TryGetNode(Guid guid, out SceneNode2D node) { return(itemHashSet.TryGetValue(guid, out node)); }
public SceneNode2DCreatedEventArgs(SceneNode2D node) { Node = node; }
protected virtual void AssignDefaultValuesToSceneNode(SceneNode2D node) { }