}
/// <summary>
- /// Create a Shadow from a propertyMap.
+ /// Create a Shadow from a property map.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
internal Shadow(PropertyMap propertyMap) : base(propertyMap)
{
+ Color = noColor;
+ propertyMap.Find(ColorVisualProperty.MixColor)?.Get(Color);
+
+ float blurRadius = 0;
+ propertyMap.Find(ColorVisualProperty.BlurRadius)?.Get(out blurRadius);
+ BlurRadius = blurRadius;
}
/// <summary>
return map;
}
-
- /// <inheritdoc/>
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override bool SetPropertyMap(PropertyMap propertyMap)
- {
- if (!base.SetPropertyMap(propertyMap))
- {
- return false;
- }
-
- Color = noColor;
- propertyMap.Find(ColorVisualProperty.MixColor)?.Get(Color);
-
- float blurRadius = 0;
- propertyMap.Find(ColorVisualProperty.BlurRadius)?.Get(out blurRadius);
- BlurRadius = blurRadius;
-
- return true;
- }
}
}
*/
using System.ComponentModel;
+using System.Diagnostics;
namespace Tizen.NUI
{
-
/// <summary>
/// The property map class that has transform property for one of its items.
/// This class can be used to convert visual properties to map.
Extents = extents == null ? null : new Vector2(extents);
}
- /// <summary></summary>
+ /// <summary>
+ /// Create a Shadow from a property map.
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- internal protected ShadowBase(PropertyMap propertyMap)
+ protected ShadowBase(PropertyMap propertyMap)
{
+ Debug.Assert(propertyMap != null);
+
Offset = noOffset;
Extents = noExtents;
- if (propertyMap == null)
+ var transformProperty = propertyMap.Find(Visual.Property.Transform);
+
+ if (transformProperty == null)
{
+ // No transform map
return;
}
- SetPropertyMap(propertyMap);
+ var transformMap = new PropertyMap();
+
+ if (transformProperty.Get(transformMap))
+ {
+ SetTransformMap(transformMap);
+ }
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Vector2 Extents { get; set; }
- /// <summary></summary>
+ /// <summary>
+ /// Equality operator.
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static bool operator ==(ShadowBase shadow1, ShadowBase shadow2)
{
return object.ReferenceEquals(shadow1, null) ? object.ReferenceEquals(shadow2, null) : shadow1.Equals(shadow2);
}
- /// <summary></summary>
+ /// <summary>
+ /// Inequality operator.
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static bool operator !=(ShadowBase shadow1, ShadowBase shadow2)
{
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object other)
{
- if ((other == null) || ! this.GetType().Equals(other.GetType()))
+ if ((other == null) || ! GetType().Equals(other.GetType()))
{
return false;
}
-
+
var otherShadow = (ShadowBase)other;
if (!((Offset == null) ? otherShadow.Offset == null : Offset.Equals(otherShadow.Offset)))
return false;
}
- return ((Extents == null) ? otherShadow.Extents == null : Extents.Equals(otherShadow.Extents));
+ return (Extents == null) ? otherShadow.Extents == null : Extents.Equals(otherShadow.Extents);
}
/// <inheritdoc/>
}
/// <summary>
+ /// Extract a property map.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual PropertyMap GetPropertyMap()
return map;
}
- /// <summary>
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected virtual bool SetPropertyMap(PropertyMap propertyMap)
- {
- if (propertyMap == null)
- {
- return false;
- }
-
- var transformProperty = propertyMap.Find(Visual.Property.Transform);
-
- if (transformProperty == null)
- {
- // No transform map
- return true;
- }
-
- var transformMap = new PropertyMap();
-
- if (transformProperty.Get(transformMap))
- {
- SetTransformMap(transformMap);
- }
-
- return true;
- }
-
private PropertyValue GetTransformMap()
{
var transformMap = new PropertyMap();
return new PropertyValue(transformMap);
}
- /// <summary>
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
private void SetTransformMap(PropertyMap transformMap)
{
if (transformMap == null)