Name: csapi-tizenfx
Summary: Assemblies of Tizen .NET
-Version: 4.0.0.332
+Version: 4.0.0.337
Release: 1
Group: Development/Libraries
License: Apache-2.0
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
./build.sh --full
./build.sh --dummy
-./build.sh --pack 4.0.0-preview1-00332
+./build.sh --pack 4.0.0-preview1-00337
%install
mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26730.8
+VisualStudioVersion = 15.0.26730.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp.Wearable", "ElmSharp.Wearable.csproj", "{01AE2E3A-C08E-431C-97B3-A18D536FCD52}"
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp.Wearable.Test", "..\..\test\ElmSharp.Wearable.Test\ElmSharp.Wearable.Test.csproj", "{DC7126DF-8ED8-448A-B7D8-15C7441B6929}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.UI", "..\Tizen.Applications.UI\Tizen.Applications.UI.csproj", "{21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{E26744AF-0991-410E-8AD8-81AD65749036}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E26744AF-0991-410E-8AD8-81AD65749036}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E26744AF-0991-410E-8AD8-81AD65749036}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E26744AF-0991-410E-8AD8-81AD65749036}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E26744AF-0991-410E-8AD8-81AD65749036}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// The Circle DateTime Selector is a widget to display and handle datetime value by rotary event
/// Inherits <see cref="DateTimeSelector"/>
/// </summary>
- public class CircleDateTimeSelector : DateTimeSelector
+ public class CircleDateTimeSelector : DateTimeSelector, IRotaryActionWidget
{
- IntPtr circleHandle;
+ IntPtr _circleHandle;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the Circle DateTime class
/// </summary>
/// <param name="parent">The parent of new Circle DateTime instance</param>
- public CircleDateTimeSelector(EvasObject parent) : base(parent) { }
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleDateTimeSelector(EvasObject parent, CircleSurface surface) : base()
+ {
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
+ }
+
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => _circleHandle;
/// <summary>
- /// Sets or gets the disabled state of the Circle DateTime Selector
+ /// Gets the handle for Circle Surface used in this widget
/// </summary>
- public bool Disabled
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(circleHandle);
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(circleHandle, "default", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(circleHandle, "default", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
}
}
{
var handle = base.CreateHandle(parent);
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
-
- circleHandle = Interop.Eext.eext_circle_object_datetime_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(circleHandle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_datetime_add(RealHandle == IntPtr.Zero ? Handle : RealHandle , CircleSurface.Handle);
return handle;
}
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// The Circle GenList Selector is a widget to display and handle genlist items by rotary event
/// Inherits <see cref="GenList"/>
/// </summary>
- public class CircleGenList : GenList
+ public class CircleGenList : GenList, IRotaryActionWidget
{
- IntPtr circleHandle;
+ IntPtr _circleHandle;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the Circle GenList class
/// </summary>
/// <param name="parent">The parent of new Circle GenList instance</param>
- public CircleGenList(EvasObject parent) : base(parent) { }
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleGenList(EvasObject parent, CircleSurface surface) : base()
+ {
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
+ }
+
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => _circleHandle;
/// <summary>
- /// Sets or gets the disabled state of the Circle GenList Selector
+ /// Gets the handle for Circle Surface used in this widget
/// </summary>
- public bool Disabled
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(circleHandle);
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(circleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(circleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "vertical,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "vertical,scroll,bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "vertical,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "vertical,scroll,bg", value);
}
}
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(circleHandle, "default", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(circleHandle, "default", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
}
}
get
{
int policy;
- Interop.Eext.eext_circle_object_genlist_scroller_policy_get(circleHandle, IntPtr.Zero, out policy);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_get(CircleHandle, IntPtr.Zero, out policy);
return (ScrollBarVisiblePolicy)policy;
}
set
{
int h;
- Interop.Eext.eext_circle_object_genlist_scroller_policy_get(circleHandle, out h, IntPtr.Zero);
- Interop.Eext.eext_circle_object_genlist_scroller_policy_set(circleHandle, (int)h, (int)value);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_get(CircleHandle, out h, IntPtr.Zero);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_set(CircleHandle, (int)h, (int)value);
}
}
protected override IntPtr CreateHandle(EvasObject parent)
{
var handle = base.CreateHandle(parent);
-
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
-
- circleHandle = Interop.Eext.eext_circle_object_genlist_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while(!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(circleHandle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_genlist_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle);
return handle;
}
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// <summary>
/// The Circle ProgressBar is a widget for visually representing the progress status of a given job/task with the circular design.
/// </summary>
- public class CircleProgressBar : EvasObject
+ public class CircleProgressBar : Widget, ICircleWidget
{
+ CircleSurface _surface;
+
/// <summary>
/// Creates and initializes a new instance of the Circle Progressbar class.
/// </summary>
/// <param name="parent">The parent of new Circle Progressbar instance</param>
- public CircleProgressBar(EvasObject parent) : base(parent)
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleProgressBar(EvasObject parent, CircleSurface surface) : base()
{
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
}
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => Handle;
+
+ /// <summary>
+ /// Gets the handle for Circle Surface used in this widget
+ /// </summary>
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ public override bool IsEnabled
+ {
+ get
+ {
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
+ }
+ set
+ {
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
+ }
+ }
/// <summary>
/// Sets or gets the value of ProgressBar.
{
get
{
- return Interop.Eext.eext_circle_object_value_get(Handle);
+ return Interop.Eext.eext_circle_object_value_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_value_set(Handle, value);
+ Interop.Eext.eext_circle_object_value_set(CircleHandle, value);
}
}
{
double max = 0;
double min = 0;
- Interop.Eext.eext_circle_object_value_min_max_get(Handle, out min, out max);
+ Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
return max;
}
set
{
double min = Minimum;
- Interop.Eext.eext_circle_object_value_min_max_set(Handle, min, value);
+ Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, min, value);
}
}
{
double max = 0;
double min = 0;
- Interop.Eext.eext_circle_object_value_min_max_get(Handle, out min, out max);
+ Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
return min;
}
set
{
double max = Maximum;
- Interop.Eext.eext_circle_object_value_min_max_set(Handle, value, max);
+ Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, value, max);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_angle_get(Handle);
+ return Interop.Eext.eext_circle_object_angle_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_angle_set(Handle, value);
+ Interop.Eext.eext_circle_object_angle_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_angle_get(Handle, "bg");
+ return Interop.Eext.eext_circle_object_item_angle_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_angle_set(Handle, "bg", value);
+ Interop.Eext.eext_circle_object_item_angle_set(CircleHandle, "bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_angle_offset_get(Handle);
+ return Interop.Eext.eext_circle_object_angle_offset_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_angle_offset_set(Handle, value);
+ Interop.Eext.eext_circle_object_angle_offset_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_angle_offset_get(Handle, "bg");
+ return Interop.Eext.eext_circle_object_item_angle_offset_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_angle_offset_set(Handle, "bg", value);
+ Interop.Eext.eext_circle_object_item_angle_offset_set(CircleHandle, "bg", value);
}
}
{
double max = 0;
double min = 0;
- Interop.Eext.eext_circle_object_angle_min_max_get(Handle, out min, out max);
+ Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
return max;
}
set
{
double min = BarAngleMinimum;
- Interop.Eext.eext_circle_object_angle_min_max_set(Handle, min, value);
+ Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, min, value);
}
}
{
double max = 0;
double min = 0;
- Interop.Eext.eext_circle_object_angle_min_max_get(Handle, out min, out max);
+ Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
return min;
}
set
{
double max = BarAngleMaximum;
- Interop.Eext.eext_circle_object_angle_min_max_set(Handle, value, max);
- }
- }
-
- /// <summary>
- /// Sets or gets disable status of Circle ProgressBar.
- /// </summary>
- public bool Disabled
- {
- get
- {
- return Interop.Eext.eext_circle_object_disabled_get(Handle);
- }
- set
- {
- Interop.Eext.eext_circle_object_disabled_set(Handle, value);
+ Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, value, max);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_color_get(Handle, out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_color_get(CircleHandle, out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_color_set(Handle, value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_color_set(CircleHandle, value.R, value.G, value.B, value.A);
}
}
/// <summary>
/// Sets or gets color of Background ProgressBar.
/// </summary>
- public Color BackgroundColor
+ public override Color BackgroundColor
{
get
{
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(Handle, "bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "bg", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(Handle, "bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "bg", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_line_width_get(Handle); ;
+ return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_line_width_set(Handle, value);
+ Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(Handle, "bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(Handle, "bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_radius_get(Handle); ;
+ return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_radius_set(Handle, value);
+ Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(Handle, "bg"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(Handle, "bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "bg", value);
}
}
/// <returns>Handle IntPtr</returns>
protected override IntPtr CreateHandle(EvasObject parent)
{
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent.Handle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent.Handle);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
-
- var handle = Interop.Eext.eext_circle_object_progressbar_add(parent.Handle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(handle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(handle, true);
- return handle;
+ return Interop.Eext.eext_circle_object_progressbar_add(parent, CircleSurface.Handle);
}
}
}
\ No newline at end of file
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// <summary>
/// Circle scroller provides scrollbar with circular movement and is scrolled by rotary event.
/// </summary>
- public class CircleScroller : Scroller
+ public class CircleScroller : Scroller, IRotaryActionWidget
{
- private IntPtr _circleHandle;
+ IntPtr _circleHandle;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the CircleScroller class.
/// </summary>
/// <param name="parent">The <see cref="EvasObject"/> to which the new CircleScroller will be attached as a child.</param>
- public CircleScroller(EvasObject parent) : base(parent)
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleScroller(EvasObject parent, CircleSurface surface) : base()
{
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
}
/// <summary>
- /// Sets or gets disabled state of the circle scroller object.
+ /// Gets the handle for Circle Widget.
/// </summary>
- public bool Disabled
+ public virtual IntPtr CircleHandle => _circleHandle;
+
+ /// <summary>
+ /// Gets the handle for Circle Surface used in this widget
+ /// </summary>
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(_circleHandle); ;
+ return !Interop.Eext.eext_circle_object_disabled_get(Handle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(Handle, !value);
}
}
get
{
int policy;
- Interop.Eext.eext_circle_object_scroller_policy_get(_circleHandle, out policy, IntPtr.Zero);
+ Interop.Eext.eext_circle_object_scroller_policy_get(CircleHandle, out policy, IntPtr.Zero);
return (ScrollBarVisiblePolicy)policy;
}
set
{
ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy;
- Interop.Eext.eext_circle_object_scroller_policy_set(_circleHandle, (int)value, (int)v);
+ Interop.Eext.eext_circle_object_scroller_policy_set(CircleHandle, (int)value, (int)v);
}
}
get
{
int policy;
- Interop.Eext.eext_circle_object_scroller_policy_get(_circleHandle, IntPtr.Zero, out policy);
+ Interop.Eext.eext_circle_object_scroller_policy_get(CircleHandle, IntPtr.Zero, out policy);
return (ScrollBarVisiblePolicy)policy;
}
set
{
ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy;
- Interop.Eext.eext_circle_object_scroller_policy_set(_circleHandle, (int)h, (int)value);
+ Interop.Eext.eext_circle_object_scroller_policy_set(CircleHandle, (int)h, (int)value);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_color_get(_circleHandle, out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_color_get(CircleHandle, out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_color_set(_circleHandle, value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_color_set(CircleHandle, value.R, value.G, value.B, value.A);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "horizontal,scroll,bar", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "horizontal,scroll,bar", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "horizontal,scroll,bar", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "horizontal,scroll,bar", value.R, value.G, value.B, value.A);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "horizontal,scroll,bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "horizontal,scroll,bg", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "horizontal,scroll,bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "horizontal,scroll,bg", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_line_width_get(_circleHandle); ;
+ return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_line_width_set(_circleHandle, value);
+ Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "horizontal,scroll,bar");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "horizontal,scroll,bar");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "horizontal,scroll,bar", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "horizontal,scroll,bar", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "vertical,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "vertical,scroll,bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "horizontal,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "horizontal,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "horizontal,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "horizontal,scroll,bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_radius_get(_circleHandle); ;
+ return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_radius_set(_circleHandle, value);
+ Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "horizontal,scroll,bar"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "horizontal,scroll,bar");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "horizontal,scroll,bar", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "horizontal,scroll,bar", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "vertical,scroll,bg"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "vertical,scroll,bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "horizontal,scroll,bg"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "horizontal,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "horizontal,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "horizontal,scroll,bg", value);
}
}
protected override IntPtr CreateHandle(EvasObject parent)
{
IntPtr handle = base.CreateHandle(parent);
- IntPtr surface = IntPtr.Zero;
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
-
- _circleHandle = Interop.Eext.eext_circle_object_scroller_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(_circleHandle, w, h);
- }
- Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_scroller_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle);
return handle;
}
}
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// <summary>
/// Circle slider is circular designed widget to select a value in a range by rotary event.
/// </summary>
- public class CircleSlider : EvasObject
+ public class CircleSlider : Widget, IRotaryActionWidget
{
- /// <summary>
- /// Changed will be triggered when the circle slider value changes.
- /// </summary>
- public event EventHandler Changed;
-
SmartEvent _changedEvent;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the CircleSlider class.
/// </summary>
/// <param name="parent">The EvasObject to which the new CircleSlider will be attached as a child.</param>
- public CircleSlider(EvasObject parent) : base(parent)
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleSlider(EvasObject parent, CircleSurface surface) : base()
{
- _changedEvent = new SmartEvent(this, "value,changed");
-
- _changedEvent.On += (s, e) => Changed?.Invoke(this, EventArgs.Empty);
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
}
/// <summary>
+ /// Changed will be triggered when the circle slider value changes.
+ /// </summary>
+ public event EventHandler ValueChanged;
+
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => RealHandle;
+
+ /// <summary>
+ /// Gets the handle for Circle Surface used in this widget
+ /// </summary>
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
/// Sets or gets the step by which the circle slider bar moves.
/// </summary>
/// <remarks>
{
get
{
- return Interop.Eext.eext_circle_object_slider_step_get(RealHandle);
+ return Interop.Eext.eext_circle_object_slider_step_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_slider_step_set(RealHandle, (double)value);
+ Interop.Eext.eext_circle_object_slider_step_set(CircleHandle, (double)value);
}
}
/// <summary>
- /// Sets or gets disabled state of the circle slider object.
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
/// </summary>
- public bool Disabled
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(RealHandle); ;
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_color_get(RealHandle, out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_color_get(CircleHandle, out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_color_set(RealHandle, value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_color_set(CircleHandle, value.R, value.G, value.B, value.A);
}
}
/// <summary>
/// Sets or gets color of the circle slider background.
/// </summary>
- public Color BackgroundColor
+ public override Color BackgroundColor
{
get
{
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(RealHandle, "bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "bg", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(RealHandle, "bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "bg", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_line_width_get(RealHandle); ;
+ return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_line_width_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(RealHandle, "bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(RealHandle, "bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_angle_get(RealHandle); ;
+ return Interop.Eext.eext_circle_object_angle_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_angle_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_angle_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_angle_get(RealHandle, "bg");
+ return Interop.Eext.eext_circle_object_item_angle_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_angle_set(RealHandle, "bg", value);
+ Interop.Eext.eext_circle_object_item_angle_set(CircleHandle, "bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_angle_offset_get(RealHandle); ;
+ return Interop.Eext.eext_circle_object_angle_offset_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_angle_offset_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_angle_offset_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_angle_offset_get(RealHandle, "bg");
+ return Interop.Eext.eext_circle_object_item_angle_offset_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_angle_offset_set(RealHandle, "bg", value);
+ Interop.Eext.eext_circle_object_item_angle_offset_set(CircleHandle, "bg", value);
}
}
{
double min;
double max;
- Interop.Eext.eext_circle_object_angle_min_max_get(RealHandle, out min, out max);
+ Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
return min;
}
set
{
double max = BarAngleMaximum;
- Interop.Eext.eext_circle_object_angle_min_max_set(RealHandle, (double)value, max);
+ Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, (double)value, max);
}
}
{
double min;
double max;
- Interop.Eext.eext_circle_object_angle_min_max_get(RealHandle, out min, out max);
+ Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
return max;
}
set
{
double min = BarAngleMinimum;
- Interop.Eext.eext_circle_object_angle_min_max_set(RealHandle, min, (double)value);
+ Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, min, (double)value);
}
}
{
double min;
double max;
- Interop.Eext.eext_circle_object_value_min_max_get(RealHandle, out min, out max);
+ Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
return min;
}
set
{
double max = Maximum;
- Interop.Eext.eext_circle_object_value_min_max_set(RealHandle, (double)value, max);
+ Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, (double)value, max);
}
}
{
double min;
double max;
- Interop.Eext.eext_circle_object_value_min_max_get(RealHandle, out min, out max);
+ Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
return max;
}
set
{
double min = Minimum;
- Interop.Eext.eext_circle_object_value_min_max_set(RealHandle, min, (double)value);
+ Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, min, (double)value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_value_get(RealHandle);
+ return Interop.Eext.eext_circle_object_value_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_value_set(RealHandle, (double)value);
+ Interop.Eext.eext_circle_object_value_set(CircleHandle, (double)value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_radius_get(RealHandle); ;
+ return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_radius_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(RealHandle, "bg"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(RealHandle, "bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "bg", value);
}
}
/// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _changedEvent = new SmartEvent(this, "value,changed");
+ _changedEvent.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+ }
+
+ /// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">Parent EvasObject</param>
/// <returns>Handle IntPtr</returns>
protected override IntPtr CreateHandle(EvasObject parent)
{
- IntPtr surface = IntPtr.Zero;
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
-
- IntPtr handle = Interop.Eext.eext_circle_object_slider_add(parent, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(handle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(handle, true);
- return handle;
+ return Interop.Eext.eext_circle_object_slider_add(parent, CircleSurface.Handle);
}
}
}
\ No newline at end of file
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// The Circle Spinner is a widget to display and handle spinner value by rotary event
/// Inherits <see cref="Spinner"/>.
/// </summary>
- public class CircleSpinner : Spinner
+ public class CircleSpinner : Spinner, IRotaryActionWidget
{
- private IntPtr _circleHandle;
- private double _angleRatio = 1.0;
+ IntPtr _circleHandle;
+ double _angleRatio = 1.0;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the Circle Spinner class.
/// </summary>
/// <param name="parent">The parent of new Circle Spinner instance</param>
- public CircleSpinner(EvasObject parent) : base(parent)
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleSpinner(EvasObject parent, CircleSurface surface) : base()
{
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
}
/// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => RealHandle;
+
+ /// <summary>
+ /// Gets the handle for Circle Surface used in this widget
+ /// </summary>
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
/// Sets or gets the circle spinner angle per each spinner value.
/// </summary>
public double AngleRatio
set
{
_angleRatio = value;
- Interop.Eext.eext_circle_object_spinner_angle_set(_circleHandle, _angleRatio);
+ Interop.Eext.eext_circle_object_spinner_angle_set(CircleHandle, _angleRatio);
}
}
/// <summary>
- /// Sets or gets disabled state of the circle spinner object.
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
/// </summary>
- public bool Disabled
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(_circleHandle); ;
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
}
}
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "default", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "default", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
}
}
protected override IntPtr CreateHandle(EvasObject parent)
{
IntPtr handle = base.CreateHandle(parent);
-
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent.Handle);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent.Handle);
- }
-
- _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(_circleHandle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle);
return handle;
}
}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+ /// <summary>
+ /// The CircleSurface presents a surface for drawing circular feature of circle widgets
+ /// </summary>
+ public class CircleSurface
+ {
+ IntPtr _handle;
+
+ /// <summary>
+ /// Creates and initializes a new instance of the CircleSurface class with surface on the Conformant widget.
+ /// </summary>
+ /// <param name="conformant">Conformant widget to create a surface.</param>
+ public CircleSurface(Conformant conformant)
+ {
+ _handle = Interop.Eext.eext_circle_surface_conformant_add(conformant);
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of the CircleSurface class with surface on the Layout widget.
+ /// </summary>
+ /// <param name="layout">Layout widget to create a surface.</param>
+ public CircleSurface(Layout layout)
+ {
+ _handle = Interop.Eext.eext_circle_surface_layout_add(layout);
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of the CircleSurface class with surface on the Naviframe widget.
+ /// </summary>
+ /// <param name="naviframe">Naviframe widget to create a surface.</param>
+ public CircleSurface(Naviframe naviframe)
+ {
+ _handle = Interop.Eext.eext_circle_surface_naviframe_add(naviframe);
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of the CircleSurface class with no surface
+ /// </summary>
+ public CircleSurface()
+ {
+ _handle = IntPtr.Zero;
+ }
+
+ public IntPtr Handle => _handle;
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+ /// <summary>
+ /// The ICircleWidget is the interface for a widget to display and handle with circle surface
+ /// </summary>
+ public interface ICircleWidget
+ {
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ IntPtr CircleHandle { get; }
+
+ /// <summary>
+ /// Gets the CircleSurface used in this widget
+ /// </summary>
+ CircleSurface CircleSurface { get; }
+ }
+
+ /// <summary>
+ /// The IRotaryActionWidget is the interface for a widget has action by rotary event
+ /// </summary>
+ public interface IRotaryActionWidget : ICircleWidget
+ {
+ }
+}
/// <summary>
/// RotaryEventManager serve extension functions for Rotary event to EvasObject on device like Galaxy Gear.
/// </summary>
- public static class EvasObjectExtensions
+ public static class RotaryEventExtensions
{
static Dictionary<EvasObject, RotaryEventHandler> s_rotaryObjectEventHandlers = new Dictionary<EvasObject, RotaryEventHandler>();
static Dictionary<EvasObject, Interop.Eext.Eext_Rotary_Event_Cb> s_rotaryObjectEventMap = new Dictionary<EvasObject, Interop.Eext.Eext_Rotary_Event_Cb>();
}
/// <summary>
+ /// Activate this circle widget can take Rotary event.
+ /// </summary>
+ /// <param name="widget">Target circle widget</param>
+ public static void Activate(this IRotaryActionWidget widget)
+ {
+ Interop.Eext.eext_rotary_object_event_activated_set(widget.CircleHandle, true);
+ }
+
+ /// <summary>
+ /// Deactivate this circle widget is blocked from Rotary event.
+ /// </summary>
+ /// <param name="widget">Target circle widget</param>
+ public static void Deactivate(this IRotaryActionWidget widget)
+ {
+ Interop.Eext.eext_rotary_object_event_activated_set(widget.CircleHandle, false);
+ }
+
+ /// <summary>
/// Activate this object can take Rotary event.
/// </summary>
/// <param name="obj">Target object</param>
}
/// <summary>
+ /// Creates and initializes a new instance of Container class.
+ /// </summary>
+ protected Container() : base()
+ {
+ }
+
+ /// <summary>
/// Sets the background color of a given Container.
/// </summary>
public override Color BackgroundColor
///as a child.It's <see cref="EvasObject"/> type.</param>
public DateTimeSelector(EvasObject parent) : base(parent)
{
- _changed = new SmartEvent(this, this.RealHandle, "changed");
- _changed.On += (s, e) =>
- {
- DateTime newDateTime = DateTime;
- DateTimeChanged?.Invoke(this, new DateChangedEventArgs(_cacheDateTime, newDateTime));
- DateTime = newDateTime;
- };
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of DateTimeSelector class.
+ /// </summary>
+ protected DateTimeSelector() : base()
+ {
}
/// <summary>
}
/// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _changed = new SmartEvent(this, this.RealHandle, "changed");
+ _changed.On += (s, e) =>
+ {
+ DateTime newDateTime = DateTime;
+ DateTimeChanged?.Invoke(this, new DateChangedEventArgs(_cacheDateTime, newDateTime));
+ DateTime = newDateTime;
+ };
+ }
+
+ /// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">Parent EvasObject</param>
/// <param name="parent">The parent is a given container which will be attached by GenList as a child. It's <see cref="EvasObject"/> type.</param>
public GenList(EvasObject parent) : base(parent)
{
- ListMode = GenListMode.Compress;
- InitializeSmartEvent();
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of GenList class.
+ /// </summary>
+ protected GenList() : base()
+ {
}
/// <summary>
}
/// <summary>
+ /// Gets count of items in a this genlist widget
+ /// </summary>
+ public int Count
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_items_count(RealHandle);
+ }
+ }
+
+ /// <summary>
/// ItemSelected is raised when a new genlist item is selected.
/// </summary>
public event EventHandler<GenListItemEventArgs> ItemSelected;
}
/// <summary>
+ /// The callback of Unrealize Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ ListMode = GenListMode.Compress;
+ InitializeSmartEvent();
+ }
+
+ /// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">Parent EvasObject</param>
}
}
+ /// <summary>
+ /// Sets or gets the style of the Item.
+ /// </summary>
+ public string Style
+ {
+ get
+ {
+ return Interop.Elementary.elm_object_item_style_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_object_item_style_set(Handle, value);
+ }
+ }
+
internal IntPtr Handle
{
get
/// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param>
public Layout(EvasObject parent) : base(parent)
{
- _languageChanged = new SmartEvent(this, this.RealHandle, "language,changed");
- _languageChanged.On += (s, e) =>
- {
- LanguageChanged?.Invoke(this, EventArgs.Empty);
- };
+ }
- _themeChanged = new SmartEvent(this, this.RealHandle, "theme,changed");
- _themeChanged.On += (s, e) =>
- {
- ThemeChanged?.Invoke(this, EventArgs.Empty);
- };
+ /// <summary>
+ /// Creates and initializes a new instance of Layout class.
+ /// </summary>
+ protected Layout() : base()
+ {
}
/// <summary>
}
/// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _languageChanged = new SmartEvent(this, this.RealHandle, "language,changed");
+ _languageChanged.On += (s, e) =>
+ {
+ LanguageChanged?.Invoke(this, EventArgs.Empty);
+ };
+
+ _themeChanged = new SmartEvent(this, this.RealHandle, "theme,changed");
+ _themeChanged.On += (s, e) =>
+ {
+ ThemeChanged?.Invoke(this, EventArgs.Empty);
+ };
+ }
+
+ /// <summary>
/// Sets the content at a part of a given container widget.
/// </summary>
/// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param>
/// <param name="parent">The <see cref="EvasObject"/> to which the new Scroller will be attached as a child.</param>
public Scroller(EvasObject parent) : base(parent)
{
- _scroll = new SmartEvent(this, this.RealHandle, "scroll");
- _dragStart = new SmartEvent(this, this.RealHandle, "scroll,drag,start");
- _dragStop = new SmartEvent(this, this.RealHandle, "scroll,drag,stop");
- _scrollpage = new SmartEvent(this, this.RealHandle, "scroll,page,changed");
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of the Scroller class.
+ /// </summary>
+ public Scroller() : base()
+ {
}
/// <summary>
}
}
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _scroll = new SmartEvent(this, this.RealHandle, "scroll");
+ _dragStart = new SmartEvent(this, this.RealHandle, "scroll,drag,start");
+ _dragStop = new SmartEvent(this, this.RealHandle, "scroll,drag,stop");
+ _scrollpage = new SmartEvent(this, this.RealHandle, "scroll,page,changed");
+ }
+
/// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">The parent of new Spinner instance</param>
public Spinner(EvasObject parent) : base(parent)
{
- _changed = new SmartEvent(this, this.RealHandle, "changed");
- _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+ }
- _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed");
- _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
+ /// <summary>
+ /// Creates and initializes a new instance of Layout class.
+ /// </summary>
+ protected Spinner() : base()
+ {
}
/// <summary>
}
/// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _changed = new SmartEvent(this, this.RealHandle, "changed");
+ _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+
+ _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed");
+ _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
+ }
+
+ /// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">Parent EvasObject</param>
/// <param name="parent">The parent of new Widget instance</param>
protected Widget(EvasObject parent) : base(parent)
{
- _focused = new SmartEvent(this, "focused");
- _focused.On += (s, e) => Focused?.Invoke(this, EventArgs.Empty);
-
- _unfocused = new SmartEvent(this, "unfocused");
- _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty);
}
/// <summary>
/// <summary>
/// Sets or gets the state of the widget, which might be enabled or disabled.
/// </summary>
- public bool IsEnabled
+ public virtual bool IsEnabled
{
get
{
return a;
}
+ /// <summary>
+ /// Send a signal to the edje object of the widget.
+ /// </summary>
+ /// <param name="emission">The signal's name.</param>
+ /// <param name="source">The signal's source.</param>
+ public void SignalEmit(string emission, string source)
+ {
+ Interop.Elementary.elm_object_signal_emit(Handle, emission, source);
+ }
+
+ /// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _focused = new SmartEvent(this, "focused");
+ _focused.On += (s, e) => Focused?.Invoke(this, EventArgs.Empty);
+
+ _unfocused = new SmartEvent(this, "unfocused");
+ _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty);
+ }
+
internal IntPtr GetPartContent(string part)
{
return Interop.Elementary.elm_object_part_content_get(RealHandle, part);
[DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_object_item_signal_callback_del(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func);
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_style_set(IntPtr obj, string style);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_object_item_style_get(IntPtr obj);
+
+ internal static string elm_object_item_style_get(IntPtr obj)
+ {
+ var text = _elm_object_item_style_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate bool Elm_Object_Item_Signal_Cb(IntPtr data, IntPtr item, string emission, string source);
/// The bundle constructor.
/// </summary>
/// <exception cref="System.InvalidOperationException">Thrown when out of memory.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// </code>
+ /// </example>
public Bundle()
{
_handle = Interop.Bundle.Create();
/// <summary>
/// The number of items in a bundle object.
/// </summary>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// bundle.AddItem("string", "a_string");
/// Console.WriteLine("There are {0} items in the bundle", bundle.Count);
/// </code>
+ /// </example>
public int Count
{
get
/// <summary>
/// The keys in a bundle object.
/// </summary>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// bundle.AddItem("string1", "a_string1");
/// Console.WriteLine(key);
/// }
/// </code>
+ /// </example>
public IEnumerable<string> Keys
{
get
/// </summary>
/// <param name="key">The key to check for.</param>
/// <returns>true if the bundle contains the key, false otherwise.</returns>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// bundle.AddItem("string", "a_string");
/// Console.WriteLine(aValue);
/// }
/// </code>
+ /// </example>
public bool Contains(string key)
{
return _keys.Contains(key);
/// <exception cref="System.ArgumentException">Thrown when the key already exists or when there is an invalid parameter.</exception>
/// <exception cref="System.ArgumentNullException">Thrown when a value is null.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// byte[] byteArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
/// bundle.AddItem("byte_array", byteArray);
/// </code>
+ /// </example>
public void AddItem(string key, byte[] value)
{
if (value == null)
/// <exception cref="System.ArgumentException">Thrown when the key already exists or when there is an invalid parameter.</exception>
/// <exception cref="System.ArgumentNullException">Thrown when a value is null.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// byte[] byteArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
/// bundle.AddItem("byte_array", byteArray, 2, 3);
/// </code>
+ /// </example>
public void AddItem(string key, byte[] value, int offset, int count)
{
if (!_keys.Contains(key))
/// <param name="value">The value of the item.</param>
/// <exception cref="System.ArgumentException">Thrown when the key already exists or when there is an invalid parameter.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// bundle.AddItem("string", "a_string");
/// </code>
+ /// </example>
public void AddItem(string key, string value)
{
if (!_keys.Contains(key))
/// <param name="value">The value of the item.</param>
/// <exception cref="System.ArgumentException">Thrown when the key already exists or when there is an invalid parameter.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// string[] stringArray = { "a", "b", "c" };
/// bundle.AddItem("string_array", stringArray);
/// </code>
+ /// </example>
public void AddItem(string key, IEnumerable<string> value)
{
if (!_keys.Contains(key))
/// <returns>The value of the bundle item.</returns>
/// <exception cref="System.ArgumentException">Thrown when the key does not exist or when there is an invalid parameter.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// bundle.AddItem("string", "a_string");
/// }
/// }
/// </code>
+ /// </example>
public object GetItem(string key)
{
if (_keys.Contains(key))
/// <exception cref="System.ArgumentException">Thrown when the key does not exist or when there is an invalid parameter.</exception>
/// <exception cref="System.InvalidCastException">Thrown when the value of the bundle item cannot be converted to the specified generic type.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// string[] stringArray = { "a", "b", "c" };
/// }
/// }
/// </code>
+ /// </example>
public T GetItem<T>(string key)
{
return (T)GetItem(key);
/// <param name="value">The value of the bundle item. If the key does not exist or the type of this parameter is incorrect, it is the default value for the value parameter type.</param>
/// <returns>true if an item with the key exists and if the value is the same type as the output value parameter, false otherwise.</returns>
/// <exception cref="System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// byte[] byteArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
/// Console.WriteLine("First item in the byte array: {0}", aByteArray[0]);
/// }
/// </code>
+ /// </example>
public bool TryGetItem(string key, out byte[] value)
{
if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.Byte)
/// <param name="value">The value of the bundle item. If the key does not exist or the type of this parameter is incorrect, it is the default value for the value parameter type.</param>
/// <returns>true if an item with the key exists and if the value is the same type as the output value parameter, false otherwise.</returns>
/// <exception cref="System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// bundle.AddItem("string", "a_string");
/// Console.WriteLine(aString);
/// }
/// </code>
+ /// </example>
public bool TryGetItem(string key, out string value)
{
if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.String)
/// <param name="value">The value of the bundle item. If the key does not exist or the type of this parameter is incorrect, it is the default value for the value parameter type.</param>
/// <returns>true if an item with the key exists and if the value is the same type as the output value parameter, false otherwise.</returns>
/// <exception cref="System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// string[] stringArray = { "a", "b", "c" };
/// }
/// }
/// </code>
+ /// </example>
public bool TryGetItem(string key, out IEnumerable<string> value)
{
if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.StringArray)
/// <returns>true if the item is of the specified type, false otherwise.</returns>
/// <exception cref="System.ArgumentException">Thrown when the key does not exist or when there is an invalid parameter.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// string[] stringArray = { "a", "b", "c" };
/// }
/// }
/// </code>
+ /// </example>
public bool Is<T>(string key)
{
if (_keys.Contains(key))
/// <returns>true if the item is successfully found and removed, false otherwise (even if the item is not found).</returns>
/// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// bundle.AddItem("string", "a_string");
/// }
/// }
/// </code>
+ /// </example>
public bool RemoveItem(string key)
{
if (_keys.Contains(key))
/// <param name="bundleRaw">The encoded bundle data. bundleRaw should be the returned value of Tizen.Applications.Bundle.Encode, otherwise this method will not succeed.</param>
/// <returns>Decoded Bundle object.</returns>
/// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// string bundleRaw = bundle.Encode();
/// Bundle data = bundle.Decode(bundleRaw);
/// </code>
+ /// </example>
public static Bundle Decode(string bundleRaw)
{
SafeBundleHandle handle;
/// </summary>
/// <returns>Encoded bundle data in string.</returns>
/// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the bundle instance has been disposed.</exception>
+ /// <example>
/// <code>
/// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
/// string bundleRaw = bundle.Encode();
/// </code>
+ /// </example>
public string Encode()
{
string bundleRaw;
/// <param name="portName">The name of the local message port.</param>
/// <param name="trusted">If true, it is the trusted message port of application, otherwise false.</param>
/// <exception cref="System.ArgumentException">Thrown when portName is null or empty.</exception>
+ /// <example>
/// <code>
/// MessagePort messagePort = new MessagePort("SenderPort", true);
/// </code>
+ /// </example>
public MessagePort(string portName, bool trusted)
{
if (String.IsNullOrEmpty(portName))
/// <summary>
/// Called when a message is received.
/// </summary>
+ /// <example>
/// <code>
/// MessagePort messagePort = new MessagePort("SenderPort", true);
/// messagePort.MessageReceived += MessageReceivedCallback;
/// }
/// }
/// </code>
+ /// </example>
public event EventHandler<MessageReceivedEventArgs> MessageReceived;
/// <summary>
/// <exception cref="System.InvalidOperationException">Thrown when portName is already used, when there is an I/O error.</exception>
/// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <example>
/// <code>
/// MessagePort messagePort = new MessagePort("SenderPort", true);
/// messagePort.MessageReceived += MessageReceivedCallback;
/// messagePort.Listen();
/// </code>
+ /// </example>
public void Listen()
{
lock (s_lock)
/// <exception cref="System.InvalidOperationException">Thrown when messageport is already stopped, when there is an I/O error, when the port is not found.</exception>
/// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <example>
/// <code>
/// MessagePort messagePort = new MessagePort("SenderPort", true);
/// messagePort.MessageReceived += MessageReceivedCallback;
/// }
/// messagePort.StopListening();
/// </code>
+ /// </example>
public void StopListening()
{
if (!_listening)
/// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory.</exception>
/// <exception cref="System.ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(4KB).</exception>
+ /// <example>
/// <code>
/// MessagePort messagePort = new MessagePort("SenderPort", true);
/// messagePort.MessageReceived += MessageReceivedCallback;
/// messagePort.Send(message, "ReceiverAppID", "ReceiverPort");
/// }
/// </code>
+ /// </example>
public void Send(Bundle message, string remoteAppId, string remotePortName)
{
Send(message, remoteAppId, remotePortName, false);
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory.</exception>
/// <exception cref="System.ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(4KB).</exception>
/// <exception cref="System.UnauthorizedAccessException">Thrown when the remote application is not signed with the same certificate.</exception>
+ /// <example>
/// <code>
/// MessagePort messagePort = new MessagePort("SenderPort", true);
/// messagePort.MessageReceived += MessageReceivedCallback;
/// messagePort.Send(message, "ReceiverAppID", "ReceiverPort", true);
/// }
/// </code>
+ /// </example>
public void Send(Bundle message, string remoteAppId, string remotePortName, bool trusted)
{
if (!_listening)
/// <param name="portName">The name of the remote message port</param>
/// <param name="trusted">If true is the trusted message port of application, otherwise false</param>
/// <exception cref="System.ArgumentException">Thrown when appId is null or empty, when portName is null or empty</exception>
+ /// <example>
/// <code>
/// RemotePort remotePort = new RemotePort("org.tizen.example.messageport", "SenderPort", false);
/// </code>
+ /// </example>
public RemotePort(String appId, string portName, bool trusted)
{
if (String.IsNullOrEmpty(appId) || String.IsNullOrEmpty(portName))
/// <since_tizen> 4 </since_tizen>
/// <exception cref="System.InvalidOperationException">Thrown when there is an I/O error</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <example>
/// <code>
/// Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true);
/// bool isRunning = remotePort.isRunning();
/// </code>
+ /// </example>
/// <returns> Return true if Remote Port is running </returns>
public bool IsRunning()
{
/// <since_tizen> 4 </since_tizen>
/// <exception cref="System.InvalidOperationException">Thrown when there is an I/O error</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <example>
/// <code>
/// Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true);
/// remotePort.RemotePortStateChanged += RemotePortStateChangedCallback;
/// }
/// }
/// </code>
+ /// </example>
public event EventHandler<RemotePortStateChangedEventArgs> RemotePortStateChanged
{
add
namespace Tizen.Multimedia.MediaCodec
{
/// <summary>
- /// Provides the means to encode and decode the video and the audio data.
+ /// Provides a means to encode and decode the video and the audio data.
/// </summary>
public class MediaCodec : IDisposable
{
/// </summary>
/// <exception cref="InvalidOperationException">
/// Not connected to a source.<br/>
- /// <br/>
+ /// -or-<br/>
/// An internal error occurs.
/// </exception>
/// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
/// </summary>
/// <exception cref="InvalidOperationException">
/// Not connected to a source.<br/>
- /// <br/>
+ /// -or-<br/>
/// An internal error occurs.
/// </exception>
/// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
/// </summary>
/// <exception cref="InvalidOperationException">
/// Not connected to a source.<br/>
- /// <br/>
+ /// -or-<br/>
/// An internal error occurs.
/// </exception>
/// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
/// </summary>
/// <exception cref="InvalidOperationException">
/// Not connected to a source.<br/>
- /// <br/>
+ /// -or-<br/>
/// An internal error occurs.
/// </exception>
/// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
/// </summary>
/// <exception cref="InvalidOperationException">
/// Not connected to a source.<br/>
- /// <br/>
+ /// -or-<br/>
/// An internal error occurs.
/// </exception>
/// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
/// </summary>
/// <exception cref="InvalidOperationException">
/// Not connected to a source.<br/>
- /// <br/>
+ /// -or-<br/>
/// An internal error occurs.
/// </exception>
/// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
/// </summary>
/// <exception cref="InvalidOperationException">
/// Not connected to a source.<br/>
- /// <br/>
+ /// -or-<br/>
/// An internal error occurs.
/// </exception>
/// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
/// Initializes a new instance of the <see cref="GifFrame"/> class with a buffer and a delay.
/// </summary>
/// <param name="buffer">The raw image buffer to be encoded.</param>
- /// <param name="delay">The delay for this image, in 0.001 sec units.</param>
+ /// <param name="delay">The delay for this image in milliseconds.</param>
/// <exception cref="ArgumentNullException"><paramref name="buffer"/> is null.</exception>
/// <exception cref="ArgumentException">The length of <paramref name="buffer"/> is zero.</exception>
public GifFrame(byte[] buffer, uint delay)
/// <summary>
/// Gets or sets the delay for this image.
/// </summary>
- /// <value>Time delay in 0.001 sec units.</value>
+ /// <value>Time delay in milliseconds.</value>
public uint Delay { get; set; }
}
}
/// <exception cref="ArgumentException">
/// <paramref name="inputFilePath"/> is an empty string.<br/>
/// -or-<br/>
- /// <paramref name="inputFilePath"/> is not a image file.<br/>
- /// -or-<br/>
- /// The format of <paramref name="inputFilePath"/> is not <see cref="InputFormat"/>.
+ /// <paramref name="inputFilePath"/> is not a image file.
/// </exception>
/// <exception cref="FileNotFoundException"><paramref name="inputFilePath"/> does not exists.</exception>
/// <exception cref="UnauthorizedAccessException">The caller does not have required permission to access the path.</exception>
/// <returns>A task that represents the asynchronous decoding operation.</returns>
/// <remarks>Only Graphics Interchange Format(GIF) codec returns more than one frame.</remarks>
/// <exception cref="ArgumentNullException"><paramref name="inputBuffer"/> is null.</exception>
- /// <exception cref="ArgumentException">
- /// <paramref name="inputBuffer"/> is an empty array.<br/>
- /// -or-<br/>
- /// The format of <paramref name="inputBuffer"/> is not <see cref="InputFormat"/>.
- /// </exception>
+ /// <exception cref="ArgumentException"><paramref name="inputBuffer"/> is an empty array.</exception>
/// <exception cref="FileFormatException">The format of <paramref name="inputBuffer"/> is not <see cref="InputFormat"/>.</exception>
/// <exception cref="ObjectDisposedException">The <see cref="ImageDecoder"/> has already been disposed of.</exception>
public Task<IEnumerable<BitmapFrame>> DecodeAsync(byte[] inputBuffer)
/// <exception cref="ArgumentOutOfRangeException">
/// index is less than 0.<br/>
/// -or-<br/>
- /// index is equal to or greater than Count.
+ /// index is equal to or greater than <see cref="Count"/>.
/// </exception>
public ImageTransform this[int index]
{
private Flips _flip;
/// <summary>
- /// Initializes a new instance of the <see cref="RotateTransform"/> class.
+ /// Initializes a new instance of the <see cref="FlipTransform"/> class.
/// </summary>
/// <param name="flip">The value how to flip an image.</param>
/// <exception cref="ArgumentException"><paramref name="flip"/> is invalid.</exception>
}
/// <summary>
- /// Gets or sets the value how to rotate an image.
+ /// Gets or sets the value how to flip an image.
/// </summary>
/// <exception cref="ArgumentException"><paramref name="value"/> is invalid.</exception>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="value"/> is <see cref="Flips.None"/>.</exception>
/// -or-<br/>
/// <paramref name="type"/> is <see cref="BarcodeType.QR"/>.<br/>
/// -or-<br/>
- /// <paramref name="type"/> is invalid.
+ /// <paramref name="type"/> is invalid.<br/>
/// -or-<br/>
/// <paramref name="message"/> contains illegal characters.
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="message"/> is too long.<br/>
/// -or-<br/>
- /// <paramref name="type"/> is <see cref="BarcodeType.QR"/>.
+ /// <paramref name="type"/> is <see cref="BarcodeType.QR"/>.<br/>
/// -or-<br/>
- /// <paramref name="type"/> is invalid.
+ /// <paramref name="type"/> is invalid.<br/>
/// -or-<br/>
/// <paramref name="message"/> contains illegal characters.
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="message"/> is too long.<br/>
/// -or-<br/>
- /// <paramref name="type"/> is <see cref="BarcodeType.QR"/>.
+ /// <paramref name="type"/> is <see cref="BarcodeType.QR"/>.<br/>
/// -or-<br/>
- /// <paramref name="type"/> is invalid.
+ /// <paramref name="type"/> is invalid.<br/>
/// -or-<br/>
/// <paramref name="message"/> contains illegal characters.
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="message"/> is too long.<br/>
/// -or-<br/>
- /// <paramref name="type"/> is <see cref="BarcodeType.QR"/>.
+ /// <paramref name="type"/> is <see cref="BarcodeType.QR"/>.<br/>
/// -or-<br/>
- /// <paramref name="type"/> is invalid.
+ /// <paramref name="type"/> is invalid.<br/>
/// -or-<br/>
/// <paramref name="message"/> contains illegal characters.
/// </exception>
/// </exception>
/// <exception cref="ArgumentNullException"><paramref name="path"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="imageFormat"/> is invalid.</exception>
+ /// <example>
/// <code>
- /// BarcodeImageConfiguration imageConfig = new BarcodeImageConfiguration(new Size(500, 400), "/opt/usr/test-barcode-generate-new", BarcodeImageFormat.JPG);
+ /// var imageConfig = new BarcodeImageConfiguration(new Size(500, 400), "/opt/usr/test-barcode-generate-new", BarcodeImageFormat.JPG);
/// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public BarcodeImageConfiguration(Size size, string path, BarcodeImageFormat imageFormat)
{
/// </exception>
/// <exception cref="ArgumentNullException"><paramref name="path"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="imageFormat"/> is invalid.</exception>
+ /// <example>
/// <code>
- /// BarcodeImageConfiguration imageConfig = new BarcodeImageConfiguration(500, 400, "/opt/usr/test-barcode-generate-new", BarcodeImageFormat.JPG);
+ /// var imageConfig = new BarcodeImageConfiguration(500, 400, "/opt/usr/test-barcode-generate-new", BarcodeImageFormat.JPG);
/// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public BarcodeImageConfiguration(int width, int height, string path, BarcodeImageFormat imageFormat)
: this(new Size(width, height), path, imageFormat)
internal EngineConfiguration(string engineType1, string engineType2)
{
-
if (IsSupportedEngineType(engineType1, engineType2) == false)
{
throw new NotSupportedException($"{engineType1} or {engineType2} : Not Supported");
EngineConfig.SetInt(Handle, key, value).Validate("Failed to set attribute");
}
-
internal void Set(string key, bool value)
{
EngineConfig.SetBool(Handle, key, value).Validate("Failed to set attribute");
/// <summary>
/// Represents a configuration of <see cref="FaceDetector"/> instances.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class FaceDetectionConfiguration : EngineConfiguration
{
/// -or-<br/>
/// The format of <paramref name="source"/> is not supported.
/// </exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<Rectangle[]> DetectAsync(MediaVisionSource source)
{
/// <returns>A task that represents the asynchronous detect operation.</returns>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<Rectangle[]> DetectAsync(MediaVisionSource source,
FaceDetectionConfiguration config)
/// <summary>
/// Represents a configuration of <see cref="FaceRecognizer"/> instances.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class FaceRecognitionConfiguration : EngineConfiguration
{
/// <summary>
/// Represents the face recognition model interface.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class FaceRecognitionModel : IDisposable
{
/// <summary>
/// Gets labels that had been learned by the model.
/// </summary>
+ /// <exception cref="ObjectDisposedException">The <see cref="FaceRecognitionModel"/> has already been disposed of.</exception>
/// <since_tizen> 3</since_tizen>
public int[] Labels
{
IntPtr unmangedArray = IntPtr.Zero;
try
{
- uint numOfLabels = 0;
-
- InteropModel.QueryLabels(Handle, out unmangedArray, out numOfLabels).
+ InteropModel.QueryLabels(Handle, out unmangedArray, out var numOfLabels).
Validate("Failed to retrieve face labels.");
int[] labels = new int[numOfLabels];
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
/// <exception cref="ObjectDisposedException"><paramref name="source"/> has already been disposed of.</exception>
/// <exception cref="InvalidOperationException"><paramref name="recognitionModel"/> is untrained model.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<FaceRecognitionResult> RecognizeAsync(MediaVisionSource source,
FaceRecognitionModel recognitionModel)
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
/// <exception cref="ObjectDisposedException"><paramref name="source"/> has already been disposed of.</exception>
/// <exception cref="InvalidOperationException"><paramref name="recognitionModel"/> is untrained model.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<FaceRecognitionResult> RecognizeAsync(MediaVisionSource source,
FaceRecognitionModel recognitionModel, Rectangle bound)
/// <paramref name="config"/> has already been disposed of.
/// </exception>
/// <exception cref="InvalidOperationException"><paramref name="recognitionModel"/> is untrained model.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<FaceRecognitionResult> RecognizeAsync(MediaVisionSource source,
FaceRecognitionModel recognitionModel, FaceRecognitionConfiguration config)
return await InvokeRecognizeAsync(source, recognitionModel, null, config);
}
-
/// <summary>
/// Performs face recognition on the source with <see cref="FaceRecognitionModel"/>, <see cref="FaceRecognitionConfiguration"/>
/// and a bounding box.
/// <paramref name="config"/> has already been disposed of.
/// </exception>
/// <exception cref="InvalidOperationException"><paramref name="recognitionModel"/> is untrained model.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<FaceRecognitionResult> RecognizeAsync(MediaVisionSource source,
FaceRecognitionModel recognitionModel, Rectangle bound, FaceRecognitionConfiguration config)
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="ObjectDisposedException"><paramref name="source"/> has already been disposed of.</exception>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<EyeCondition> RecognizeEyeConditionAsync(MediaVisionSource source,
Rectangle bound)
/// <paramref name="config"/> has already been disposed of.
/// </exception>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<EyeCondition> RecognizeEyeConditionAsync(MediaVisionSource source,
Rectangle bound, FaceRecognitionConfiguration config)
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="ObjectDisposedException"><paramref name="source"/> has already been disposed of.</exception>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<FacialExpression> RecognizeFacialExpressionAsync(MediaVisionSource source,
Rectangle bound)
/// <paramref name="config"/> has already been disposed of.
/// </exception>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<FacialExpression> RecognizeFacialExpressionAsync(MediaVisionSource source,
Rectangle bound, FaceRecognitionConfiguration config)
/// </exception>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
/// <exception cref="InvalidOperationException"><paramref name="trackingModel"/> is not prepared.</exception>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<FaceTrackingResult> TrackAsync(MediaVisionSource source,
FaceTrackingModel trackingModel, bool doLearn)
/// <summary>
/// Represents the face tracking model.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class FaceTrackingModel : IDisposable
{
/// <param name="path">Path to the file to save the model.</param>
/// <exception cref="ArgumentNullException"><paramref name="path"/> is null.</exception>
/// <exception cref="UnauthorizedAccessException">No permission to write to the specified path.</exception>
- /// <exception cref="ObjectDisposedException">The <see cref="FaceRecognitionModel"/> has already been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="FaceTrackingModel"/> has already been disposed of.</exception>
/// <exception cref="DirectoryNotFoundException">The directory for <paramref name="path"/> does not exist.</exception>
/// <since_tizen> 3 </since_tizen>
public void Save(string path)
}
/// <summary>
- /// Gets the value indicating the recognition is successful.
+ /// Gets the value indicating the tracking is successful.
/// </summary>
/// <since_tizen> 3</since_tizen>
public bool Success { get; }
/// <summary>
/// Represents a configuration of fill operations of <see cref="ImageObject"/> instances.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class ImageFillConfiguration : EngineConfiguration
{
/// <summary>
/// Represents an image object.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class ImageObject : IDisposable
{
/// <summary>
/// Sets the label for the <see cref="ImageObject"/>.
/// </summary>
+ /// <param name="label">The label which will be assigned to the image object.</param>
/// <seealso cref="GetLabel"/>
/// <since_tizen> 3 </since_tizen>
public void SetLabel(int label)
/// <summary>
/// Fills the image object.<br/>
- /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location.
+ /// Extracts data from source image which will be needed for recognition of depicted object.
/// </summary>
/// <param name="source">The source image where image object is depicted.</param>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <summary>
/// Fills the image object.<br/>
- /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location.
+ /// Extracts data from source image which will be needed for recognition of depicted object.
/// </summary>
/// <param name="source">The source image where image object is depicted.</param>
/// <param name="config">The configuration used for extract recognition data from source. This value can be null.</param>
/// <summary>
/// Fills the image object.<br/>
- /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location.
+ /// Extracts data from source image which will be needed for recognition of depicted object
+ /// in location.
/// </summary>
/// <param name="source">The source image where image object is depicted.</param>
/// <param name="rect">Rectangular bound of the image object on the source image.</param>
/// <summary>
/// Fills the image object.<br/>
- /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location.
+ /// Extracts data from source image which will be needed for recognition of depicted object
+ /// in location.
/// </summary>
/// <param name="source">The source image where image object is depicted.</param>
/// <param name="config">The configuration used for extract recognition data from source. This value can be null.</param>
/// <param name="path">Path to the file to save the model.</param>
/// <exception cref="ArgumentNullException"><paramref name="path"/> is null.</exception>
/// <exception cref="UnauthorizedAccessException">No permission to write to the specified path.</exception>
- /// <exception cref="ObjectDisposedException">The <see cref="FaceRecognitionModel"/> has already been disposed of.</exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="ImageObject"/> has already been disposed of.</exception>
/// <exception cref="DirectoryNotFoundException">The directory for <paramref name="path"/> does not exist.</exception>
/// <since_tizen> 3 </since_tizen>
public void Save(string path)
/// <summary>
/// Represents a configuration of <see cref="ImageRecognizer"/>.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class ImageRecognitionConfiguration : EngineConfiguration
{
private const string KeyTolerantPartMatchingError = "MV_IMAGE_RECOGNITION_TOLERANT_MATCH_PART_ERR";
/// <summary>
- /// A read-only field that represents the default value of <see cref="KeySceneScaleFactor"/>.
+ /// A read-only field that represents the default value of <see cref="SceneScaleFactor"/>.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static readonly double DefaultSceneScaleFactor = 1.2;
/// <summary>
/// The region of recognized image object on the source image.
/// </summary>
+ /// <value>The region of recognized image object if successful, otherwise null.</value>
/// <since_tizen> 3 </since_tizen>
public Quadrangle Region { get; }
/// <exception cref="ArgumentException"><paramref name="imageObjects"/> has no elements.(The length is zero.)</exception>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
/// <exception cref="ObjectDisposedException"><paramref name="source"/> has already been disposed of.</exception>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<IEnumerable<ImageRecognitionResult>> RecognizeAsync(
MediaVisionSource source, ImageObject[] imageObjects)
/// -or-<br/>
/// <paramref name="config"/> has already been disposed of.
/// </exception>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<IEnumerable<ImageRecognitionResult>> RecognizeAsync(MediaVisionSource source,
ImageObject[] imageObjects, ImageRecognitionConfiguration config)
/// </exception>
/// <exception cref="ArgumentException"><paramref name="trackingModel"/> has no target.</exception>
/// <seealso cref="ImageTrackingModel.SetTarget(ImageObject)"/>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<Quadrangle> TrackAsync(MediaVisionSource source,
ImageTrackingModel trackingModel)
/// </exception>
/// <exception cref="ArgumentException"><paramref name="trackingModel"/> has no target.</exception>
/// <seealso cref="ImageTrackingModel.SetTarget(ImageObject)"/>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public static async Task<Quadrangle> TrackAsync(MediaVisionSource source,
ImageTrackingModel trackingModel, ImageTrackingConfiguration config)
/// <summary>
/// Represents a configuration of <see cref="ImageTracker"/>.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class ImageTrackingConfiguration : ImageRecognitionConfiguration
{
/// <summary>
/// Represents the image tracking model interface.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class ImageTrackingModel : IDisposable
{
/// <summary>
/// Represents the media vision source to keep information on the image or video frame data as raw buffer.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.barcode_detection</feature>
+ /// <feature>http://tizen.org/feature/vision.barcode_generation</feature>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class MediaVisionSource : IBufferOwner, IDisposable
{
/// Initializes a new instance of the <see cref="MediaVisionSource"/> class based on the <see cref="MediaPacket"/>.
/// </summary>
/// <param name="mediaPacket">The <see cref="MediaPacket"/> from which the source will be filled.</param>
- /// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <exception cref="NotSupportedException">None of the related features are not supported.</exception>
/// <exception cref="ArgumentNullException"><paramref name="mediaPacket"/> is null.</exception>
/// <exception cref="ObjectDisposedException"><paramref name="mediaPacket"/> has already been disposed of.</exception>
/// <since_tizen> 3 </since_tizen>
/// <param name="height">The height of image.</param>
/// <param name="colorSpace">The image <see cref="ColorSpace"/>.</param>
/// <exception cref="NotSupportedException">
- /// The feature is not supported.<br/>
+ /// None of the related features are not supported.<br/>
/// -or-<br/>
/// <paramref name="colorSpace"/> is not supported.
/// </exception>
/// <summary>
/// Represents a configuration of <see cref="MovementDetector"/>.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class MovementDetectionConfiguration : SurveillanceEngineConfiguration
{
/// <since_tizen> 3 </since_tizen>
public static readonly int DefaultThreshold = 10;
-
/// <summary>
/// Initializes a new instance of the <see cref="MovementDetectionConfiguration"/> class.
/// </summary>
- /// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <exception cref="NotSupportedException">The required features are not supported.</exception>
/// <since_tizen> 3 </since_tizen>
public MovementDetectionConfiguration()
{
/// <summary>
/// Provides the ability to detect movement on image sources.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <seealso cref="MovementDetectionConfiguration"/>
/// <since_tizen> 3 </since_tizen>
public class MovementDetector : SurveillanceEngine
/// <summary>
/// Initializes a new instance of the <see cref="MovementDetector"/> class.
/// </summary>
- /// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <exception cref="NotSupportedException">The required features are not supported.</exception>
/// <since_tizen> 3 </since_tizen>
public MovementDetector() : base(MovementDetectedEventType)
{
/// <summary>
/// Represents a configuration of <see cref="PersonAppearanceDetector"/> instances.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class PersonAppearanceDetectionConfiguration : SurveillanceEngineConfiguration
{
/// <summary>
/// Initializes a new instance of the <see cref="PersonAppearanceDetectionConfiguration"/> class.
/// </summary>
- /// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <exception cref="NotSupportedException">The required features are not supported.</exception>
/// <since_tizen> 3 </since_tizen>
public PersonAppearanceDetectionConfiguration()
{
/// <summary>
/// Provides the ability to detect person appearance changes on image sources.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <seealso cref="PersonAppearanceDetectionConfiguration"/>
/// <since_tizen> 3 </since_tizen>
public class PersonAppearanceDetector : SurveillanceEngine
/// <summary>
/// Initializes a new instance of the <see cref="PersonAppearanceDetector"/> class.
/// </summary>
- /// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <exception cref="NotSupportedException">The required features are not supported.</exception>
/// <since_tizen> 3 </since_tizen>
public PersonAppearanceDetector() : base(PersonAppearanceEventType)
{
/// <summary>
/// Represents a configuration of <see cref="PersonRecognizer"/> instances.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class PersonRecognitionConfiguration : SurveillanceEngineConfiguration
{
/// </summary>
/// <param name="modelPath">Path to the face recognition model.</param>
/// <exception cref="ArgumentNullException"><paramref name="modelPath"/> is null.</exception>
- /// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <exception cref="NotSupportedException">The required features are not supported.</exception>
/// <since_tizen> 3 </since_tizen>
public PersonRecognitionConfiguration(string modelPath)
{
/// <summary>
/// Provides the ability to recognize person on image sources.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <seealso cref="PersonRecognitionConfiguration"/>
/// <since_tizen> 3 </since_tizen>
public class PersonRecognizer : SurveillanceEngine
/// <summary>
/// Initializes a new instance of the <see cref="PersonRecognizer"/> class.
/// </summary>
- /// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <exception cref="NotSupportedException">The required features are not supported.</exception>
/// <since_tizen> 3 </since_tizen>
public PersonRecognizer() : base(PersonRecognizedEventType)
{
/// <param name="qrMode">Encoding mode for the message.</param>
/// <param name="ecc">Error correction level.</param>
/// <param name="version">QR code version. From 1 to 40 inclusive.</param>
- /// <code>
- /// var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
- /// </code>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="version"/> is less than 1.<br/>
/// -or-<br/>
/// -or-<br/>
/// <paramref name="ecc"/> is invalid.
/// </exception>
+ /// <example>
+ /// <code>
+ /// var qrConfig = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public QrConfiguration(QrMode qrMode, ErrorCorrectionLevel ecc, int version)
{
/// <since_tizen> 3 </since_tizen>
Numeric,
/// <summary>
- /// Alphanumeric characters, '$', '%', '*', '+', '-', '.', '/' and ':'.
+ /// Alphanumeric characters, '$', '%', '*', '+', '-', '.', '/', and ':'.
/// </summary>
/// <since_tizen> 3</since_tizen>
AlphaNumeric,
{
if (points.Length != 4)
{
- throw new ArgumentException($"{points} must have 4 elements.");
+ throw new ArgumentException($"{nameof(points)} must have 4 elements.");
}
Points = points;
/// <summary>
/// SurveillanceEngineConfiguration is a base class for surveillance configurations.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <since_tizen> 3 </since_tizen>
public class SurveillanceEngineConfiguration : EngineConfiguration
{
/// SurveillanceEngine is a base class for surveillance event triggers.
/// Media Vision Surveillance provides the functionality which can be utilized for creation of video surveillance systems.
/// </summary>
+ /// <feature>http://tizen.org/feature/vision.face_recognition</feature>
+ /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
/// <seealso cref="MovementDetector"/>
/// <seealso cref="PersonAppearanceDetector"/>
/// <seealso cref="PersonRecognizer"/>
UnsubscribeEventTrigger(Handle, source.StreamId).Validate("Failed to unsubscribe event trigger");
}
-
/// <summary>
/// Releases all the resources used by the <see cref="SurveillanceEngine"/> object.
/// </summary>
public class SurveillanceSource
{
private static int _nextStreamId = int.MinValue;
+ private static readonly object _idLock = new object();
private static int GetNextStreamId()
{
- if (_nextStreamId == int.MaxValue)
+ lock (_idLock)
{
- return _nextStreamId = int.MinValue;
+ if (_nextStreamId == int.MaxValue)
+ {
+ _nextStreamId = int.MinValue;
+ }
+ return _nextStreamId++;
}
- return _nextStreamId++;
}
/// <summary>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
- /// </code>
+ /// </code></example>
public Attributes()
{
int ret = Interop.IoTConnectivity.Common.Attributes.Create(out _resourceAttributesHandle);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of keys.</value>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// attributes.Add("brightness", 50);
/// var count = attributes.Count;
/// Console.WriteLine("There are {0} keys in the attribute object", count);
- /// </code>
+ /// </code></example>
public int Count
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether an attribute is readonly.</value>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.IsReadOnly)
/// Console.WriteLine("Read only attribute");
- /// </code>
+ /// </code></example>
public bool IsReadOnly
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the attribute keys.</value>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// var keys = attributes.Keys;
/// Console.WriteLine("Attribute contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
- /// </code>
+ /// </code></example>
public ICollection<string> Keys
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the attribute values.</value>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// var values = attributes.Values;
/// Console.WriteLine("Attribute contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
- /// </code>
+ /// </code></example>
public ICollection<object> Values
{
get
/// <value>The attribute with the specified key.</value>
/// <param name="key">The key of the attribute to get or set.</param>
/// <returns>The element with the specified key.</returns>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes["state"] = "ON";
/// Console.WriteLine("Attribute value for key 'state' : {0}", attributes["state"]);
- /// </code>
+ /// </code></example>
public object this[string key]
{
get
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair to add.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add(new KeyValuePair<string, object> ("state", "ON"));
- /// ]]></code>
+ /// ]]></code></example>
public void Add(KeyValuePair<string, object> item)
{
Add(item.Key, item.Value);
/// <param name="key">The key representing the attribute.</param>
/// <param name="value">The value representing the attribute.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add("brightness", 50);
- /// </code>
+ /// </code></example>
public void Add(string key, object value)
{
int ret = 0;
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add("brightness", 50);
/// attributes.Clear();
- /// </code>
+ /// </code></example>
public void Clear()
{
foreach (string key in _attributes.Keys)
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The status key value pair.</param>
/// <returns>true if exists. Otherwise, false.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Contains(new KeyValuePair<string, object> ("dim", 10))
/// Console.WriteLine("Attribute conatins pair ('dim', 10)");
- /// ]]></code>
+ /// ]]></code></example>
public bool Contains(KeyValuePair<string, object> item)
{
return _attributes.Contains(item);
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The status key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.ContainsKey("dim"))
/// Console.WriteLine("Attribute conatins key : dim");
- /// </code>
+ /// </code></example>
public bool ContainsKey(string key)
{
return _attributes.ContainsKey(key);
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">The zero-based index in an array at which copying begins.</param>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// int index = 0;
/// attributes.CopyTo(dest, index);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
- /// ]]></code>
+ /// ]]></code></example>
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
{
_attributes.CopyTo(array, arrayIndex);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns> An enumerator that can be used to iterate through the collection.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
return _attributes.GetEnumerator();
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Remove(new KeyValuePair<string, object>("dim", 10)))
/// Console.WriteLine("Remove was successful");
- /// ]]></code>
+ /// ]]></code></example>
public bool Remove(KeyValuePair<string, object> item)
{
return Remove(item.Key);
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Remove("state"))
/// Console.WriteLine("Remove was successful");
- /// </code>
+ /// </code></example>
public bool Remove(string key)
{
int ret = Interop.IoTConnectivity.Common.Attributes.Remove(_resourceAttributesHandle, key);
/// <param name="key">The key whose value to get.</param>
/// <param name="value"> The value associated with the specified key.</param>
/// <returns> true if the attributes collection contains an element with the specified key, otherwise, false.</returns>
- /// <code>
+ /// <example><code>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" }
/// };
/// var isPresent = attributes.TryGetValue("state", out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
- /// </code>
+ /// </code></example>
public bool TryGetValue(string key, out object value)
{
return _attributes.TryGetValue(key, out value);
/// <pre>
/// Initialize() should be called to initialize.
/// </pre>
- /// <code>
+ /// <example><code>
/// IoTConnectivityClientManager.Initialize();
/// IoTConnectivityClientManager.TimeOut = 120;
- /// </code>
+ /// </code></example>
public static int TimeOut
{
get
/// <pre>
/// Initialize() should be called to initialize.
/// </pre>
- /// <code>
+ /// <example><code>
/// IoTConnectivityClientManager.Initialize();
/// IoTConnectivityClientManager.PollingInterval = 100;
- /// </code>
+ /// </code></example>
public static int PollingInterval
{
get
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
- /// <code>
+ /// <example><code>
/// string filePath = "../../res/iotcon-test-svr-db-client.dat";
/// IoTConnectivityClientManager.Initialize(filePath);
- /// </code>
+ /// </code></example>
public static void Initialize(string filePath)
{
int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath);
/// Initialize() should be called to initialize.
/// </pre>
/// <seealso cref="Initialize(string)"/>
- /// <code>
+ /// <example><code>
/// IoTConnectivityClientManager.Deinitialize();
- /// </code>
+ /// </code></example>
public static void Deinitialize()
{
s_presenceListenerId = 1;
/// Initialize() should be called to initialize.
/// </pre>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
- /// <code>
+ /// <example><code>
/// IoTConnectivityClientManager.InvokePolling();
- /// </code>
+ /// </code></example>
public static void InvokePolling()
{
int ret = Interop.IoTConnectivity.Client.IoTCon.InvokePolling();
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => {
/// Console.Log("PresenceReceived, presence id :" + e.PresenceId);
/// }
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartReceivingPresence(IoTConnectivityClientManager.MulticastAddress, "oic.iot.door");
- /// ]]></code>
+ /// ]]></code></example>
public static int StartReceivingPresence(string hostAddress, string resourceType)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => {
/// Console.Log("PresenceReceived, presence id :" + e.PresenceId);
/// }
/// IoTConnectivityClientManager.PresenceReceived -= handler;
/// IoTConnectivityClientManager.FindingErrorOccurred -= errorHandler;
/// IoTConnectivityClientManager.StopReceivingPresence(id);
- /// ]]></code>
+ /// ]]></code></example>
public static void StopReceivingPresence(int presenceId)
{
if (!s_presenceHandlesMap.ContainsKey((IntPtr)presenceId))
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
- /// <para>Sends request to find a resource of <paramref name="hostAddress" /> server with <paramref name="resourceType" />.
+ /// <para>Sends request to find a resource of <paramref name="hostAddress" /> server with <paramref name="query" />.
/// If succeeded, <see cref="ResourceFound"/> event handler will be triggered with information of the resource.</para>
- /// <para><paramref name="hostAddress" /> could be <see cref="MulticastAddress"/> for the IPv4 multicast.
- /// The length of <paramref name="resourceType" /> should be less than or equal to 61. The <paramref name="resourceType" /> must start
- /// with a lowercase alphabetic character, followed by a sequence
- /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space.</para>
+ /// <para><paramref name="hostAddress" /> could be <see cref="MulticastAddress"/> for the IPv4 multicast.</para>
/// </remarks>
/// <privilege>http://tizen.org/privilege/internet</privilege>
/// <privlevel>public</privlevel>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// EventHandler<ResourceFoundEventArgs> handler = (sender, e) => {
/// Console.Log("Found resource at host address :" + e.Resource.HostAddress + ", uri :" + e.Resource.UriPath);
/// }
/// query.Type = "oic.iot.door";
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingResource(null, query);
- /// ]]></code>
+ /// ]]></code></example>
public static int StartFindingResource(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// EventHandler<DeviceInformationFoundEventArgs> handler = (sender, e) => {
/// Console.Log("Device information found, id : " + e.RequestId + ", name : " + e.Name);
/// }
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingDeviceInformation(IoTConnectivityClientManager.MulticastAddress);
- /// ]]></code>
+ /// ]]></code></example>
public static int StartFindingDeviceInformation(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// EventHandler<PlatformInformationFoundEventArgs> handler = (sender, e) => {
/// Console.Log("PlatformInformationFound :" + e.RequestId);
/// }
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingPlatformInformation(IoTConnectivityClientManager.MulticastAddress);
- /// ]]></code>
+ /// ]]></code></example>
public static int StartFindingPlatformInformation(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access</exception>
- /// <code>
+ /// <example><code>
/// string filePath = "../../res/iotcon-test-svr-db-server.dat";
/// IoTConnectivityServerManager.Initialize(filePath);
- /// </code>
+ /// </code></example>
public static void Initialize(string filePath)
{
int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath);
/// Initialize() should be called to initialize.
/// </pre>
/// <seealso cref="Initialize(string)"/>
- /// <code>
+ /// <example><code>
/// IoTConnectivityServerManager.Deinitialize();
- /// </code>
+ /// </code></example>
public static void Deinitialize()
{
_resources.Clear();
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "org.tizen.light" });
/// Attributes attributes = new Attributes { { "state", "ON" }};
/// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public static void RegisterResource(Resource resource)
{
Log.Info(IoTConnectivityErrorFactory.LogTag, "...");
/// <seealso cref="LiteResource"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "org.tizen.light" });
/// Attributes attributes = new Attributes { { "state", "ON" }};
/// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public static void UnregisterResource(Resource resource)
{
if (resource != null)
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
- /// <code>
+ /// <example><code>
/// try {
/// IoTConnectivityServerManager.StartSendingPresence(120);
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
- /// </code>
+ /// </code></example>
public static void StartSendingPresence(uint time)
{
int ret = Interop.IoTConnectivity.Server.IoTCon.StartPresence(time);
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
- /// <code>
+ /// <example><code>
/// IoTConnectivityServerManager.StopSendingPresence();
- /// </code>
+ /// </code></example>
public static void StopSendingPresence()
{
int ret = Interop.IoTConnectivity.Server.IoTCon.StopPresence();
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
- /// <code>
+ /// <example><code>
/// IoTConnectivityServerManager.SetDeviceName("my-tizen");
- /// </code>
+ /// </code></example>
public static void SetDeviceName(string deviceName)
{
int ret = Interop.IoTConnectivity.Server.IoTCon.SetDeviceName(deviceName);
/// <seealso cref="ResourceTypes"/>
/// <seealso cref="ResourcePolicy"/>
/// <seealso cref="Attributes"/>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// List<string> list = new List<string>() { "org.tizen.light" };
/// Attributes attributes = new Attributes() {
/// { "state", "ON" }
/// };
/// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable, attributes);
- /// ]]></code>
+ /// ]]></code></example>
public LiteResource(string uri, ResourceTypes types, ResourcePolicy policy, Attributes attribs = null)
: base(uri, types, new ResourceInterfaces(new string[] { ResourceInterfaces.DefaultInterface }), policy)
{
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The attributes of the lite resource.</value>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// List<string> list = new List<string>() { "org.tizen.light" };
/// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable);
/// Attributes attributes = new Attributes() {
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public Attributes Attributes { get; set; }
/// <summary>
/// </remarks>
/// <param name="attribs">The new attributes of the lite resource.</param>
/// <returns>true to accept post request, false to reject it.</returns>
- /// <code>
+ /// <example><code>
/// public class MyLightResource : LiteResource
/// {
/// protected override bool OnPost(Attributes attributes)
/// return false;
/// }
/// }
- /// </code>
+ /// </code></example>
protected virtual bool OnPost(Attributes attribs)
{
return true;
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
- /// <code>
+ /// <example><code>
/// Representation repr = new Representation();
- /// </code>
+ /// </code></example>
public Representation()
{
int ret = Interop.IoTConnectivity.Common.Representation.Create(out _representationHandle);
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code>
+ /// <example><code>
/// Representation repr = new Representation();
/// repr.UriPath = "/a/light";
/// Console.WriteLine("URI is {0}", repr.UriPath); //Getter
- /// </code>
+ /// </code></example>
public string UriPath
{
get
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// Representation repr = new Representation();
/// ResourceTypes types = new ResourceTypes (new List<string>(){ "org.tizen.light" });
/// repr.Type = types;
/// {
/// Console.WriteLine("Type is {0}", item);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public ResourceTypes Type
{
get
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// Representation repr = new Representation();
/// ResourceInterfaces ifaces = new ResourceInterfaces (new List<string>(){ ResourceInterfaces.DefaultInterface });
/// repr.Interface = ifaces;
/// {
/// Console.WriteLine("Interface is {0}", iface);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public ResourceInterfaces Interface
{
get
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code>
+ /// <example><code>
/// Representation repr = new Representation();
/// Attributes attributes = new Attributes() {
/// { "state", "ON" },
/// string strval = newAttributes["state"] as string;
/// int intval = (int)newAttributes["dim"];
/// Console.WriteLine("attributes are {0} and {1}", strval, intval);
- /// </code>
+ /// </code></example>
public Attributes Attributes
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>List of Child resource representation.</value>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// Representation repr = new Representation();
/// Representation child1 = new Representation();
/// ResourceTypes types1 = new ResourceTypes(new List<string>() { "org.tizen.light" });
/// {
/// Console.WriteLine("Exception caught : " + ex.Message);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public ICollection<Representation> Children
{
get
/// <seealso cref="ResourcePolicy"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// // Create a class which inherits from Resource
/// public class DoorResource : Resource
/// {
/// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface });
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new" });
/// Resource resource = new DoorResource("/door/uri1", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
- /// ]]></code>
+ /// ]]></code></example>
protected Resource(string uri, ResourceTypes types, ResourceInterfaces interfaces, ResourcePolicy policy)
{
UriPath = uri;
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface });
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new.notify" });
/// Resource resource = new DoorResource("/door/uri/new/notify", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
/// _attribute, 1 }
/// };
/// resource.Notify(repr, QualityOfService.High);
- /// ]]></code>
+ /// ]]></code></example>
public void Notify(Representation representation, QualityOfService qos)
{
int ret = (int)IoTConnectivityError.None;
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code>
+ /// <example><code>
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
- /// </code>
+ /// </code></example>
public ResourceInterfaces()
{
int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle);
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
- /// ]]></code>
+ /// ]]></code></example>
public ResourceInterfaces(IEnumerable<string> ifaces)
{
int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Count of interfaces in the list.</value>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// Console.WriteLine("There are {0} interfaces", resourceInterfaces.Count);
- /// ]]></code>
+ /// ]]></code></example>
public int Count
{
get
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
- /// <code>
+ /// <example><code>
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
/// resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
- /// </code>
+ /// </code></example>
public void Add(string item)
{
if (IsValid(item))
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.BatchInterface });
/// resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
- /// ]]></code>
+ /// ]]></code></example>
public void Remove(string item)
{
bool isRemoved = _resourceInterfaces.Remove(item);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// foreach(string item in resourceInterfaces)
/// {
/// Console.WriteLine("Interface : {0}", item);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public IEnumerator<string> GetEnumerator()
{
return _resourceInterfaces.GetEnumerator();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// foreach(string item in resourceInterfaces)
/// {
/// Console.WriteLine("Interface : {0}", item);
/// }
- /// ]]></code>
+ /// ]]></code></example>
IEnumerator IEnumerable.GetEnumerator()
{
return _resourceInterfaces.GetEnumerator();
/// <seealso cref="Remove(ushort)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
- /// </code>
+ /// </code></example>
public ResourceOptions()
{
int ret = Interop.IoTConnectivity.Common.Options.Create(out _resourceOptionsHandle);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the Option keys.</value>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var keys = options.Keys;
/// Console.WriteLine("Resource options contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
- /// </code>
+ /// </code></example>
public ICollection<ushort> Keys
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the Option values.</value>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var values = options.Values;
/// Console.WriteLine("Resource options contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
- /// </code>
+ /// </code></example>
public ICollection<string> Values
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of options.</value>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var count = options.Count;
/// Console.WriteLine("There are {0} keys in the options object", count);
- /// </code>
+ /// </code></example>
public int Count
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether the collection is readonly.</value>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// if (options.IsReadOnly)
/// Console.WriteLine("Read only options");
- /// </code>
+ /// </code></example>
public bool IsReadOnly
{
get
/// <value>The option data.</value>
/// <param name="key">The option ID to get or set.</param>
/// <returns>The option with the specified ID.</returns>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options[2055] = "sample-data";
/// Console.WriteLine("Option has : {0}", options[2055]);
- /// </code>
+ /// </code></example>
public string this[ushort key]
{
get
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// if (options.ContainsKey(2050))
/// Console.WriteLine("options conatins key : 2050");
- /// </code>
+ /// </code></example>
public bool ContainsKey(ushort key)
{
return _options.ContainsKey(key);
/// <seealso cref="Remove(ushort)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
- /// </code>
+ /// </code></example>
public void Add(ushort key, string value)
{
int ret = (int)IoTConnectivityError.InvalidParameter;
/// <seealso cref="Add(ushort, string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// var result = options.Remove(2050);
- /// </code>
+ /// </code></example>
public bool Remove(ushort key)
{
int ret = Interop.IoTConnectivity.Common.Options.Remove(_resourceOptionsHandle, key);
/// <param name="key">The option ID.</param>
/// <param name="value">Value corresponding to option ID.</param>
/// <returns>True if the key exists, false otherwise.</returns>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// string value;
/// var isPresent = options.TryGetValue(2050, out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
- /// </code>
+ /// </code></example>
public bool TryGetValue(ushort key, out string value)
{
return _options.TryGetValue(key, out value);
/// <param name="item">The key value pair.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Remove(KeyValuePair{ushort, string})"/>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
- /// ]]></code>
+ /// ]]></code></example>
public void Add(KeyValuePair<ushort, string> item)
{
Add(item.Key, item.Value);
/// <since_tizen> 3 </since_tizen>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
- /// <code>
+ /// <example><code>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// options.Add(2055, "sample");
/// options.Clear();
- /// </code>
+ /// </code></example>
public void Clear()
{
foreach (ushort key in Keys)
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair.</param>
/// <returns>True if exists. Otherwise, false.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// var isPresent = options.Contains(new KeyValuePair<ushort, string>(2050, "12345"));
/// if (isPresent)
/// Console.WriteLine("Key value pair is present");
- /// ]]></code>
+ /// ]]></code></example>
public bool Contains(KeyValuePair<ushort, string> item)
{
return _options.Contains(item);
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">Index parameter.</param>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// KeyValuePair<ushort, string>[] dest = new KeyValuePair<ushort, string>[options.Count];
/// options.CopyTo(dest, 0);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
- /// ]]></code>
+ /// ]]></code></example>
public void CopyTo(KeyValuePair<ushort, string>[] array, int arrayIndex)
{
_options.CopyTo(array, arrayIndex);
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Add(KeyValuePair{ushort, string})"/>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// var result = options.Remove(new KeyValuePair<ushort, string>(2050, "12345"));
- /// ]]></code>
+ /// ]]></code></example>
public bool Remove(KeyValuePair<ushort, string> item)
{
return Remove(item.Key);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to option pairs.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "sample1"));
/// options.Add(new KeyValuePair<ushort, string>(2055, "sample2"));
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public IEnumerator<KeyValuePair<ushort, string>> GetEnumerator()
{
return _options.GetEnumerator();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to option pairs.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "sample1"));
/// options.Add(new KeyValuePair<ushort, string>(2055, "sample2"));
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
- /// ]]></code>
+ /// ]]></code></example>
IEnumerator IEnumerable.GetEnumerator()
{
return _options.GetEnumerator();
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
- /// </code>
+ /// </code></example>
public ResourceQuery()
{
int ret = Interop.IoTConnectivity.Common.Query.Create(out _resourceQueryHandle);
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Type = "org.tizen.light";
/// Console.WriteLine("Type of query : {0}", query.Type);
- /// </code>
+ /// </code></example>
public string Type
{
get
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Interface = ResourceInterfaces.LinkInterface;
- /// </code>
+ /// </code></example>
public string Interface
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the query keys.</value>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var keys = query.Keys;
/// Console.WriteLine("Resource query contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
- /// </code>
+ /// </code></example>
public ICollection<string> Keys
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the query values.</value>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var values = query.Values;
/// Console.WriteLine("Resource query contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
- /// </code>
+ /// </code></example>
public ICollection<string> Values
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of query elements.</value>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var count = query.Count;
/// Console.WriteLine("There are {0} keys in the query object", count);
- /// </code>
+ /// </code></example>
public int Count
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether the collection is readonly.</value>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// if (query.IsReadOnly)
/// Console.WriteLine("Read only query");
- /// </code>
+ /// </code></example>
public bool IsReadOnly
{
get
/// <value>The query data.</value>
/// <param name="key">The query key to get or set.</param>
/// <returns>The query with the specified key.</returns>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query["key1"] = "sample-data";
/// Console.WriteLine("query has : {0}", query["key1"]);
- /// </code>
+ /// </code></example>
public string this[string key]
{
get
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// if (query.ContainsKey("key1"))
/// Console.WriteLine("query conatins key : key1");
- /// </code>
+ /// </code></example>
public bool ContainsKey(string key)
{
return _query.ContainsKey(key);
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
- /// </code>
+ /// </code></example>
public void Add(string key, string value)
{
if (CanAddQuery(key, value))
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// var result = query.Remove("key1");
- /// </code>
+ /// </code></example>
public bool Remove(string key)
{
int ret = Interop.IoTConnectivity.Common.Query.Remove(_resourceQueryHandle, key);
/// <param name="key">The query key.</param>
/// <param name="value">Value corresponding to query key.</param>
/// <returns>True if the key exists, false otherwise.</returns>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// string value;
/// var isPresent = query.TryGetValue("key1", out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
- /// </code>
+ /// </code></example>
public bool TryGetValue(string key, out string value)
{
return _query.TryGetValue(key, out value);
/// <param name="item">The key value pair.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Remove(KeyValuePair{string, string})"/>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
- /// ]]></code>
+ /// ]]></code></example>
public void Add(KeyValuePair<string, string> item)
{
Add(item.Key, item.Value);
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code>
+ /// <example><code>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// query.Add("key2", "value2");
/// query.Clear();
- /// </code>
+ /// </code></example>
public void Clear()
{
foreach (string key in _query.Keys)
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair.</param>
/// <returns>True if exists. Otherwise, false.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// var isPresent = query.Contains(new KeyValuePair<string, string>("key1", "value1"));
/// if (isPresent)
/// Console.WriteLine("Key value pair is present");
- /// ]]></code>
+ /// ]]></code></example>
public bool Contains(KeyValuePair<string, string> item)
{
return _query.Contains(item);
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">Index parameter.</param>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// KeyValuePair<string, string>[] dest = new KeyValuePair<string, string>[query.Count];
/// query.CopyTo(dest, 0);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
- /// ]]></code>
+ /// ]]></code></example>
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
{
_query.CopyTo(array, arrayIndex);
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Add(KeyValuePair{string, string})"/>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// var result = query.Remove(new KeyValuePair<string, string>("key1", "value1"));
- /// ]]></code>
+ /// ]]></code></example>
public bool Remove(KeyValuePair<string, string> item)
{
return Remove(item.Key);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to query pairs.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// query.Add(new KeyValuePair<string, string>("key2", "value2"));
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return _query.GetEnumerator();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator to the query pairs.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// query.Add(new KeyValuePair<string, string>("key2", "value2"));
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
- /// ]]></code>
+ /// ]]></code></example>
IEnumerator IEnumerable.GetEnumerator()
{
return _query.GetEnumerator();
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
- /// <code>
+ /// <example><code>
/// ResourceTypes types = new ResourceTypes();
- /// </code>
+ /// </code></example>
public ResourceTypes()
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle);
/// <param name="types">List of resource types.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
- /// ]]></code>
+ /// ]]></code></example>
public ResourceTypes(IEnumerable<string> types)
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Count of types in the list.</value>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// Console.WriteLine("There are {0} items", types.Count);
- /// ]]></code>
+ /// ]]></code></example>
public int Count
{
get
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code>
+ /// <example><code>
/// ResourceTypes resourceTypes = new ResourceTypes();
/// resourceTypes.Add("org.tizen.light");
- /// </code>
+ /// </code></example>
public void Add(string item)
{
if (IsValid(item))
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// resourceTypes.Remove("oic.if.room");
- /// ]]></code>
+ /// ]]></code></example>
public void Remove(string item)
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Remove(_resourceTypeHandle, item);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// foreach(string item in resourceTypes)
/// {
/// Console.WriteLine("Type : {0}", item);
/// }
- /// ]]></code>
+ /// ]]></code></example>
public IEnumerator<string> GetEnumerator()
{
return _resourceTypes.GetEnumerator();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
- /// <code><![CDATA[
+ /// <example><code><![CDATA[
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// foreach(string item in resourceTypes)
/// {
/// Console.WriteLine("Type : {0}", item);
/// }
- /// ]]></code>
+ /// ]]></code></example>
IEnumerator IEnumerable.GetEnumerator()
{
return _resourceTypes.GetEnumerator();
/// Constructor of Response.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <code>
+ /// <example><code>
/// Response response = new Response();
- /// </code>
+ /// </code></example>
public Response() { }
/// <summary>
/// http://tizen.org/privilege/haptic
/// For controlling the sound, privilege is not needed.
/// </privilege>
+ /// <example>
/// <code>
/// Feedback feedback = new Feedback();
/// bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap");
/// </code>
+ /// </example>
public class Feedback
{
private const string LogTag = "Tizen.System.Feedback";
internal class UsbConfigHandle : SafeUsbHandle
{
[DllImport(Libraries.Usb, EntryPoint = "usb_host_config_destroy")]
- internal static extern ErrorCode ConfigDestroy(UsbConfigHandle /* usb_host_config_h */ config);
+ internal static extern ErrorCode ConfigDestroy(IntPtr /* usb_host_config_h */ config);
public UsbConfigHandle(IntPtr handle) : base(handle) { }
public override void Destroy()
{
- ConfigDestroy(this).ThrowIfFailed("Failed to destroy native HostConfig handle");
+ ConfigDestroy(handle).ThrowIfFailed("Failed to destroy native HostConfig handle");
}
}
}
\ No newline at end of file
[DllImport(Libraries.Usb, EntryPoint = "usb_host_set_hotplug_cb")]
internal static extern ErrorCode SetHotplugCb(this UsbContextHandle /* usb_host_context_h */ ctx, HostHotplugCallback cb, HotplugEventType /* usb_host_hotplug_event_e */ hostEvent, IntPtr /* void */ userData, out HostHotplugHandle /* usb_host_hotplug_h */ handle);
- [DllImport(Libraries.Usb, EntryPoint = "usb_host_unset_hotplug_cb")]
- internal static extern ErrorCode UnsetHotplugCb(this HostHotplugHandle /* usb_host_hotplug_h */ handle);
-
[DllImport(Libraries.Usb, EntryPoint = "usb_host_get_device_list")]
internal static extern ErrorCode GetDeviceList(this UsbContextHandle /* usb_host_context_h */ ctx, out IntPtr /* usb_host_device_h */ devs, out int length);
internal static extern ErrorCode Create(out IntPtr /* usb_host_context_h */ ctx);
[DllImport(Libraries.Usb, EntryPoint = "usb_host_destroy")]
- internal static extern ErrorCode Destroy(UsbContextHandle /* usb_host_context_h */ ctx);
+ internal static extern ErrorCode Destroy(IntPtr /* usb_host_context_h */ ctx);
[DllImport(Libraries.Usb, EntryPoint = "usb_host_free_device_list")]
internal static extern ErrorCode FreeDeviceList(IntPtr deviceList, bool unrefDevices);
FreeDeviceList(nativeDevListPtr, true).ThrowIfFailed("Failed to free native device list");
nativeDevListPtr = IntPtr.Zero;
}
- Destroy(this).ThrowIfFailed("Failed to destroy native context handle");
+ Destroy(handle).ThrowIfFailed("Failed to destroy native context handle");
}
internal List<HostDeviceHandle> GetDeviceList()
}
}
- internal class HostHotplugHandle
+ internal class HostHotplugHandle : SafeUsbHandle
{
- private IntPtr _handle;
- public HostHotplugHandle(IntPtr handle) { _handle = handle; }
+ [DllImport(Libraries.Usb, EntryPoint = "usb_host_unset_hotplug_cb")]
+ internal static extern ErrorCode UnsetHotplugCb(IntPtr /* usb_host_hotplug_h */ handle);
+
+ public HostHotplugHandle(IntPtr handle) : base(handle) { }
+ public override void Destroy()
+ {
+ UnsetHotplugCb(handle).ThrowIfFailed($"Failed to unset hot plug callback");
+ }
}
}
internal static extern ErrorCode Open(this HostDeviceHandle /* usb_host_device_h */ dev);
[DllImport(Libraries.Usb, EntryPoint = "usb_host_device_close")]
- internal static extern ErrorCode Close(this HostDeviceHandle /* usb_host_device_h */ dev);
+ internal static extern ErrorCode CloseHandle(this HostDeviceHandle /* usb_host_device_h */ dev);
[DllImport(Libraries.Usb, EntryPoint = "usb_host_device_get_bus_number")]
internal static extern ErrorCode GetBusNumber(this HostDeviceHandle /* usb_host_device_h */ dev, out int busNumber);
[DllImport(Libraries.Usb, EntryPoint = "usb_host_transfer")]
internal static extern ErrorCode Transfer(this UsbEndpointHandle /* usb_host_endpoint_h */ ep, byte[] data, int length, out int transferred, uint timeout);
- internal class UsbEndpointHandle
+ internal class UsbEndpointHandle : SafeUsbHandle
{
- private IntPtr _handle;
- public UsbEndpointHandle(IntPtr handle){ _handle = handle; }
+ public UsbEndpointHandle(IntPtr handle) : base(handle) { }
+ public override void Destroy() { }
}
}
\ No newline at end of file
default: return new InvalidOperationException(errMessage);
}
}
-}
\ No newline at end of file
+}
internal static extern ErrorCode GetStr(this UsbInterfaceHandle /* usb_host_interface_h */ usbInterface, ref int length, byte[] data);
- internal class UsbInterfaceHandle
+ internal class UsbInterfaceHandle : SafeUsbHandle
{
- private IntPtr _handle;
- public UsbInterfaceHandle(IntPtr handle) { _handle = handle; }
+ public UsbInterfaceHandle(IntPtr handle) : base(handle) { }
+ public override void Destroy() { }
}
}
\ No newline at end of file
{
internal readonly Interop.HostDeviceHandle _handle;
private readonly UsbManager _parent;
- private Dictionary<int, UsbConfiguration> _configurations;
+ private Dictionary<int, UsbConfiguration> _configurations = new Dictionary<int, UsbConfiguration>();
internal UsbDevice(UsbManager parent, Interop.HostDeviceHandle handle)
{
_parent = parent;
_handle = handle;
+
+ int count = Interop.NativeGet<int>(_handle.GetNumConfigurations);
+ for (int i = 0; i < count; ++i)
+ {
+ Interop.UsbConfigHandle configHandle;
+ _handle.GetConfig(i, out configHandle);
+ _configurations.Add(i, new UsbConfiguration(this, configHandle));
+ }
}
/// <summary>
get
{
ThrowIfDisposed();
- if (_configurations == null)
- {
- _configurations = new Dictionary<int, UsbConfiguration>();
- int count = Interop.NativeGet<int>(_handle.GetNumConfigurations);
- for (int i = 0; i < count; ++i)
- {
- Interop.UsbConfigHandle configHandle;
- _handle.GetConfig(i, out configHandle);
- _configurations.Add(i, new UsbConfiguration(this, configHandle));
- }
- }
return _configurations;
}
}
ThrowIfDisposed();
if (IsOpened == false) throw new InvalidOperationException("Device must be opened for operation first");
- _handle.Close();
+ _handle.CloseHandle().ThrowIfFailed("Failed to close device for use");
}
internal void ThrowIfDisposed()
* limitations under the License.
*/
-using System.Collections.Generic;
using System;
+using System.Collections.Generic;
namespace Tizen.System.Usb
{
/// </summary>
public class UsbManager : IDisposable
{
- private readonly Interop.UsbContextHandle _context;
- private readonly Interop.HostHotplugHandle _hotpluggedHandle;
+ private readonly Interop.UsbContextHandle _context = null;
+ private readonly Interop.HostHotplugHandle _hotpluggedHandle = null;
private List<UsbDevice> _devices = new List<UsbDevice>();
/// <summary>
{
if (!disposedValue)
{
- _hotpluggedHandle.UnsetHotplugCb();
- _context.Dispose();
+ if (_hotpluggedHandle != null) _hotpluggedHandle.Dispose();
+ if (_context != null) _context.Dispose();
disposedValue = true;
}
}
/// CapacityChanged is triggered when the battery charge percentage is changed.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <example>
/// <code>
/// public static async Task BatteryEventHandler()
/// {
/// }
/// Battery.PercentChanged += handler;
/// await Task.Delay(20000);
- /// }
+ /// }
/// </code>
+ /// </example>
public static event EventHandler<BatteryPercentChangedEventArgs> PercentChanged
{
add
/// LevelChanged is triggered when the battery level is changed.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <example>
/// <code>
/// public static async Task BatteryEventHandler()
/// {
/// }
/// Battery.LevelChanged += handler;
/// await Task.Delay(20000);
- /// }
+ /// }
/// </code>
+ /// </example>
public static event EventHandler<BatteryLevelChangedEventArgs> LevelChanged
{
add
/// This event is triggered when the charger is connected/disconnected.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <example>
/// <code>
/// public static async Task BatteryEventHandler()
/// {
/// }
/// Battery.ChargingStateChanged += handler;
/// await Task.Delay(20000);
- /// }
+ /// }
/// </code>
+ /// </example>
public static event EventHandler<BatteryChargingStateChangedEventArgs> ChargingStateChanged
{
add
/// <privilege>
/// http://tizen.org/privilege/display
/// </privilege>
+ /// <example>
/// <code>
/// Console.WriteLine("Display current state is: {0}", Tizen.System.Display.State);
/// Console.WriteLine("Total number of Displays are: {0}", Tizen.System.Display.NumberOfDisplays);
/// </code>
+ /// </example>
public class Display
{
private readonly int _displayId;
/// The maximum brightness value that can be set for the specific display.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <example>
/// <code>
/// Display display = Display.Displays[0];
/// Console.WriteLine("Display MaxBrightness is: {0}", display.MaxBrightness);
/// </code>
+ /// </example>
public int MaxBrightness
{
get
/// <since_tizen> 3 </since_tizen>
/// <exception cref="ArgumentException">When an invalid parameter value is set.</exception>
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
+ /// <example>
/// <code>
/// Display display = Display.Displays[0];
/// Console.WriteLine("Display current Brightness is: {0}", display.Brightness);
/// </code>
+ /// </example>
public int Brightness
{
get
/// StateChanged is raised when the state of the display is changed.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <example>
/// <code>
/// public static async Task DisplayEventHandler()
/// {
/// }
/// Battery.StateChanged += handler;
/// await Task.Delay(20000);
- /// }
+ /// }
/// </code>
+ /// </example>
public static event EventHandler<DisplayStateChangedEventArgs> StateChanged
{
add
/// <privilege>
/// http://tizen.org/privilege/haptic
/// </privilege>
+ /// <example>
/// <code>
/// Console.WriteLine("Total number of Vibrators are: {0}", Tizen.System.Vibrator.NumberOfVibrators);
/// </code>
+ /// </example>
public class Vibrator : IDisposable
{
private readonly int _vibratorId;
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
/// <exception cref="InvalidOperationException">In case of any system error.</exception>
/// <exception cref="NotSupportedException">In case the device does not support this behavior.</exception>
+ /// <example>
/// <code>
/// Vibrator vibrator = Vibrator.Vibrators[0];
/// try
/// {
/// }
/// </code>
+ /// </example>
public void Vibrate(int duration, int feedback)
{
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
/// <exception cref="InvalidOperationException">In case of any system error.</exception>
/// <exception cref="NotSupportedException">In case the device does not support this behavior.</exception>
+ /// <example>
/// <code>
/// Vibrator vibrator = Vibrator.Vibrators[0];
/// try
/// {
/// }
/// </code>
+ /// </example>
public void Stop()
{
if (_hapticHandle != IntPtr.Zero)
/// <privilege>
/// http://tizen.org/privilege/use_ir
/// </privilege>
+ /// <example>
/// <code>
/// Console.WriteLine("IR availability for this device is: {0}", IR.IsAvailable);
/// </code>
+ /// </example>
public static class IR
{
/// <summary>
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
/// <exception cref="InvalidOperationException">In case of any system error.</exception>
/// <exception cref="NotSupportedException">In case the device does not support this behavior.</exception>
+ /// <example>
/// <code>
/// try
/// {
/// {
/// }
/// </code>
+ /// </example>
public static void Transmit(int carrierFreequency, IList<int> pattern)
{
int[] patternArray = pattern.ToArray();
/// <privilege>
/// http://tizen.org/privilege/led
/// </privilege>
+ /// <example>
/// <code>
/// Console.WriteLine("Led MaxBrightness is: {0}", Tizen.System.Led.MaxBrightness);
/// Console.WriteLine("Led current Brightness is: {0}", Tizen.System.Led.Brightness);
/// </code>
+ /// </example>
public static class Led
{
/// <summary>
/// <exception cref="ArgumentException"> When an invalid parameter value is set.</exception>
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
/// <exception cref="NotSupportedException">In case the device does not support this behavior.</exception>
+ /// <example>
/// <code>
/// Console.WriteLine("Led current Brightness is: {0}", Tizen.System.Led.Brightness);
/// Tizen.System.Led.Brightness = 50;
/// Console.WriteLine("Led current Brightness is: {0}", Tizen.System.Led.Brightness);
/// </code>
+ /// </example>
public static int Brightness
{
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
/// <exception cref="InvalidOperationException">In case of any system error.</exception>
/// <exception cref="NotSupportedException">In case the device does not support this behavior.</exception>
+ /// <example>
/// <code>
/// try
/// {
/// {
/// }
/// </code>
+ /// </example>
public static void Play(int on, int off, Color color)
{
//looks like only blink option is supported. So hard coded to default blink option.
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
/// <exception cref="InvalidOperationException">In case of any system error.</exception>
/// <exception cref="NotSupportedException">In case the device does not support this behavior.</exception>
+ /// <example>
/// <code>
/// try
/// {
/// {
/// }
/// </code>
+ /// </example>
public static void Stop()
{
/// <exception cref="ArgumentException">When an invalid parameter value is set.</exception>
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
/// <exception cref="InvalidOperationException">In case of any system error.</exception>
+ /// <example>
/// <code>
/// Tizen.System.Power.RequestCpuLock(2000);
/// </code>
+ /// </example>
public static void RequestCpuLock(int timeout)
{
/// <since_tizen> 3 </since_tizen>
/// <exception cref="UnauthorizedAccessException">If the privilege is not set.</exception>
/// <exception cref="InvalidOperationException">In case of any system error.</exception>
+ /// <example>
/// <code>
/// Tizen.System.Power.ReleaseCpuLock();
/// </code>
+ /// </example>
public static void ReleaseCpuLock()
{
DeviceError res = (DeviceError)Interop.Device.DevicePowerReleaseLock(0);
internal static partial class Interop
{
- internal static partial class Libraries
- {
- public const string Base = "libcapi-base-common.so.0";
- }
-
internal static partial class CommonError
{
[DllImport(Libraries.Base, EntryPoint = "get_last_result")]
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class DotnetUtil
+ {
+ [DllImport(Libraries.Vconf, EntryPoint = "vconf_get_int")]
+ internal static extern int GetVconfInt(string key, out int value);
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+internal static partial class Interop
+{
+ internal static partial class Libraries
+ {
+ public const string Base = "libcapi-base-common.so.0";
+ public const string Vconf = "libvconf.so.0";
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.Common
+{
+ /// <summary>
+ /// The DotnetUtil class provides the .NET API version.
+ /// </summary>
+ public static class DotnetUtil
+ {
+ /// <summary>
+ /// Gets the version of Tizen .NET API.
+ /// </summary>
+ /// <returns>The Tizen .NET API version</returns>
+ public static int TizenAPIVersion
+ {
+ get
+ {
+ int version = 0;
+ DotnetUtilError ret = (DotnetUtilError)Interop.DotnetUtil.GetVconfInt("db/dotnet/tizen_api_version", out version);
+ if (ret != DotnetUtilError.None)
+ {
+ Log.Warn(DotnetUtilErrorFactory.LogTag, "unable to get Tizen .NET API version.");
+ }
+ return version;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Common
+{
+ internal enum DotnetUtilError
+ {
+ None = ErrorCode.None,
+ }
+
+ internal static class DotnetUtilErrorFactory
+ {
+ internal const string LogTag = "Tizen.Common.DotnetUtil";
+
+ internal static void ThrowException(DotnetUtilError err)
+ {
+ DotnetUtilError error = err;
+ if (error != DotnetUtilError.None)
+ {
+ throw new ArgumentException("Vconf error");
+ }
+ }
+ }
+}
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Tizen.Log\Tizen.Log.csproj" />
+ </ItemGroup>
+
</Project>