* limitations under the License.
*
*/
+using System;
using System.ComponentModel;
namespace Tizen.NUI.BaseComponents.VectorGraphics
/// </summary>
/// <param name="matrix">The float type array of 3x3 matrix.</param>
/// <returns>True when it's successful. False otherwise.</returns>
+ /// <exception cref="ArgumentNullException"> Thrown when matrix is null. </exception>
+ /// <exception cref="ArgumentException"> Thrown when matrix array length is not 9. </exception>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Transform(float[] matrix)
{
+ if (matrix == null)
+ {
+ throw new ArgumentNullException(nameof(matrix));
+ }
+ if (matrix.Length != 9)
+ {
+ throw new ArgumentException("matrix array length is not 9.", nameof(matrix));
+ }
bool ret = Interop.Drawable.Transform(BaseHandle.getCPtr(this), matrix);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
+using System;
+using System.Collections.Generic;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.BaseComponents.VectorGraphics;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
namespace Tizen.NUI.Samples
{
StrokeDash = new List<float>(){15.0f, 30.0f}.AsReadOnly(),
};
shape2.AddCircle(0.0f, 0.0f, 150.0f, 100.0f);
- shape2.Transform(new float[] {0.6f, 0.0f, 350.0f, 0.0f, 0.6f, 100.0f, 0.0f, 0.0f, 1.0f});
+ shape2.Transform(new float[] {0.6f, 0.0f, 350.0f, 0.0f, 0.6f, 100.0f, 0.0f, 0.0f, 1.0f});
canvasView.AddDrawable(shape2);
{
log.Debug(tag, "Shape4 StrokeDash : " + shape2.StrokeDash[i] + "\n");
}
+
+ // Exception test.
+ try
+ {
+ shape2.Transform(new float[] {0.6f, 0.0f});
+ }
+ catch (ArgumentException e)
+ {
+ log.Debug(tag, "Transform : " + e.Message + "\n");
+ }
+ try
+ {
+ shape2.Transform(null);
+ }
+ catch (ArgumentException e)
+ {
+ log.Debug(tag, "Transform : " + e.Message + "\n");
+ }
+ try
+ {
+ shape2.StrokeDash = null;
+ }
+ catch (ArgumentException e)
+ {
+ log.Debug(tag, "StrokeDash setter : " + e.Message + "\n");
+ }
root.Add(canvasView);