if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ internal Color(ColorChangedCallback cb, Color other) : this(cb, other.R, other.G, other.B, other.A)
+ {
+ }
+
internal delegate void ColorChangedCallback(float r, float g, float b, float a);
private ColorChangedCallback callback = null;
return shadow;
}
+ /// <summary>
+ /// Deep copy method
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ override public object Clone()
+ {
+ return new Shadow() {
+ Offset = offset,
+ Scale = scale,
+ Color = color,
+ BlurRadius = blurRadius
+ };
+ }
+
private void OnColorChanged(float r, float g, float b, float a)
{
UpdateColor();
}
set
{
- color = value;
+ color = value == null? null : new Color(OnColorChanged, value);
UpdateColor();
}
}
/// <summary>
/// The offset value that tansform should have in common
/// </summary>
- protected internal Vector2 offset = defaultOffset;
+ protected internal Vector2 offset;
/// <summary>
/// The size value in scale that tansform should have in common
/// </summary>
- protected internal Vector2 scale = noScale;
+ protected internal Vector2 scale;
/// <summary>
/// The output property map
/// Constructor
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public TransformablePropertyMap()
+ public TransformablePropertyMap() : this(defaultOffset, noScale)
+ {
+ }
+
+ /// <summary>
+ /// Copy Constructor
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TransformablePropertyMap(TransformablePropertyMap other) : this(other.offset, other.scale)
+ {
+ }
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ protected internal TransformablePropertyMap(Vector2 offset, Vector2 scale)
{
- // Initialize maps
propertyMap = new PropertyMap();
transformMap = new PropertyMap();
-
- // Offet has default value, so need to update map
transformMap[(int)VisualTransformPropertyType.OffsetPolicy] = new PropertyValue(defaultOffsetPolicy);
- transformMap[(int)VisualTransformPropertyType.Offset] = PropertyValue.CreateWithGuard(offset);
+
+ Offset = offset;
+ Scale = scale;
propertyMap[Visual.Property.Transform] = new PropertyValue(transformMap);
}
/// The value indicates percentage of the container size. <br />
/// e.g. (0.5f, 1.0f) means 50% of the container's width and 100% of container's height.
/// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Vector2 Scale
{
get
abstract internal bool IsValid();
+ /// <summary>
+ /// Deep copy method
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ abstract public object Clone();
+
static internal PropertyValue ToPropertyValue(TransformablePropertyMap instance)
{
return (instance != null && instance.IsValid()) ? new PropertyValue(instance.propertyMap) : new PropertyValue();