From 19916e77cc0cc23d08b5789f43a2c25404207687 Mon Sep 17 00:00:00 2001 From: DotnetBuild Date: Wed, 25 Oct 2017 00:00:12 +0900 Subject: [PATCH] Release 4.0.0-preview1-00337 --- packaging/csapi-tizenfx.spec | 4 +- src/ElmSharp.Wearable/ElmSharp.Wearable.sln | 26 +++- .../ElmSharp.Wearable/CircleDatetimeSelector.cs | 74 +++++------ .../ElmSharp.Wearable/CircleGenList.cs | 93 ++++++------- .../ElmSharp.Wearable/CircleProgressBar.cs | 143 +++++++++----------- .../ElmSharp.Wearable/CircleScroller.cs | 114 ++++++++-------- .../ElmSharp.Wearable/CircleSlider.cs | 147 ++++++++++----------- .../ElmSharp.Wearable/CircleSpinner.cs | 77 +++++------ .../ElmSharp.Wearable/CircleSurface.cs | 51 +++++++ .../ElmSharp.Wearable/ICircleWidget.cs | 29 ++++ .../ElmSharp.Wearable/RotaryEventManager.cs | 20 ++- src/ElmSharp/ElmSharp/Container.cs | 7 + src/ElmSharp/ElmSharp/DateTimeSelector.cs | 29 +++- src/ElmSharp/ElmSharp/GenList.cs | 30 ++++- src/ElmSharp/ElmSharp/ItemObject.cs | 15 +++ src/ElmSharp/ElmSharp/Layout.cs | 35 +++-- src/ElmSharp/ElmSharp/Scroller.cs | 20 ++- src/ElmSharp/ElmSharp/Spinner.cs | 23 +++- src/ElmSharp/ElmSharp/Widget.cs | 30 ++++- src/ElmSharp/Interop/Interop.Elementary.Item.cs | 12 ++ .../Tizen.Applications/Bundle.cs | 34 +++++ .../Tizen.Applications.Messages/MessagePort.cs | 12 ++ .../Tizen.Applications.Messages/RemotePort.cs | 6 + .../MediaCodec/MediaCodec.cs | 2 +- .../ScreenMirroring/ScreenMirroringAudioInfo.cs | 8 +- .../ScreenMirroring/ScreenMirroringVideoInfo.cs | 6 +- src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs | 4 +- .../ImageUtil/ImageDecoder.cs | 10 +- .../ImageUtil/ImageTransform.cs | 6 +- .../MediaVision/BarcodeGenerator.cs | 14 +- .../MediaVision/BarcodeImageConfiguration.cs | 8 +- .../MediaVision/EngineConfiguration.cs | 2 - .../MediaVision/FaceDetectionConfiguration.cs | 1 + .../MediaVision/FaceDetector.cs | 2 + .../MediaVision/FaceRecognitionConfiguration.cs | 1 + .../MediaVision/FaceRecognitionModel.cs | 6 +- .../MediaVision/FaceRecognizer.cs | 9 +- .../MediaVision/FaceTracker.cs | 1 + .../MediaVision/FaceTrackingModel.cs | 3 +- .../MediaVision/FaceTrackingResult.cs | 2 +- .../MediaVision/ImageFillConfiguration.cs | 1 + .../MediaVision/ImageObject.cs | 14 +- .../MediaVision/ImageRecognitionConfiguration.cs | 3 +- .../MediaVision/ImageRecognitionResult.cs | 1 + .../MediaVision/ImageRecognizer.cs | 2 + .../MediaVision/ImageTracker.cs | 2 + .../MediaVision/ImageTrackingConfiguration.cs | 1 + .../MediaVision/ImageTrackingModel.cs | 1 + .../MediaVision/MediaVisionSource.cs | 8 +- .../MediaVision/MovementDetectionConfiguration.cs | 5 +- .../MediaVision/MovementDetector.cs | 4 +- .../PersonAppearanceDetectionConfiguration.cs | 4 +- .../MediaVision/PersonAppearanceDetector.cs | 4 +- .../MediaVision/PersonRecognitionConfiguration.cs | 4 +- .../MediaVision/PersonRecognizer.cs | 4 +- .../MediaVision/QrConfiguration.cs | 8 +- src/Tizen.Multimedia.Vision/MediaVision/QrMode.cs | 2 +- .../MediaVision/Quadrangle.cs | 2 +- .../MediaVision/SurveillanceConfiguration.cs | 2 + .../MediaVision/SurveillanceEngine.cs | 3 +- .../MediaVision/SurveillanceSource.cs | 10 +- .../Tizen.Network.IoTConnectivity/Attributes.cs | 64 ++++----- .../IoTConnectivityClientManager.cs | 47 +++---- .../IoTConnectivityServerManager.cs | 28 ++-- .../Tizen.Network.IoTConnectivity/LiteResource.cs | 12 +- .../Representation.cs | 24 ++-- .../Tizen.Network.IoTConnectivity/Resource.cs | 8 +- .../ResourceInterfaces.cs | 28 ++-- .../ResourceOptions.cs | 68 +++++----- .../Tizen.Network.IoTConnectivity/ResourceQuery.cs | 76 +++++------ .../Tizen.Network.IoTConnectivity/ResourceTypes.cs | 28 ++-- .../Tizen.Network.IoTConnectivity/Response.cs | 4 +- src/Tizen.System.Feedback/Feedback/Feedback.cs | 2 + .../Interop/Interop.Configuration.cs | 4 +- src/Tizen.System.Usb/Interop/Interop.Context.cs | 19 +-- src/Tizen.System.Usb/Interop/Interop.Device.cs | 2 +- src/Tizen.System.Usb/Interop/Interop.Endpoint.cs | 6 +- src/Tizen.System.Usb/Interop/Interop.ErrorCode.cs | 2 +- src/Tizen.System.Usb/Interop/Interop.Interface.cs | 6 +- src/Tizen.System.Usb/Usb/UsbDevice.cs | 23 ++-- src/Tizen.System.Usb/Usb/UsbInterface.cs | 2 +- src/Tizen.System.Usb/Usb/UsbManager.cs | 8 +- src/Tizen.System/Device/Battery.cs | 12 +- src/Tizen.System/Device/Display.cs | 10 +- src/Tizen.System/Device/Haptic.cs | 6 + src/Tizen.System/Device/IR.cs | 4 + src/Tizen.System/Device/Led.cs | 8 ++ src/Tizen.System/Device/Power.cs | 4 + src/Tizen/Interop/Interop.CommonError.cs | 5 - src/Tizen/Interop/Interop.DotnetUtil.cs | 27 ++++ src/Tizen/Interop/Interop.Libraries.cs | 24 ++++ src/Tizen/Tizen.Common/DotnetUtil.cs | 44 ++++++ src/Tizen/Tizen.Common/DotnetUtilErrorFactory.cs | 40 ++++++ src/Tizen/Tizen.csproj | 4 + 94 files changed, 1156 insertions(+), 694 deletions(-) create mode 100644 src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSurface.cs create mode 100644 src/ElmSharp.Wearable/ElmSharp.Wearable/ICircleWidget.cs mode change 100644 => 100755 src/Tizen.System.Feedback/Feedback/Feedback.cs mode change 100644 => 100755 src/Tizen.System/Device/Battery.cs mode change 100644 => 100755 src/Tizen.System/Device/Display.cs mode change 100644 => 100755 src/Tizen.System/Device/Haptic.cs mode change 100644 => 100755 src/Tizen.System/Device/IR.cs mode change 100644 => 100755 src/Tizen.System/Device/Led.cs mode change 100644 => 100755 src/Tizen.System/Device/Power.cs create mode 100644 src/Tizen/Interop/Interop.DotnetUtil.cs create mode 100644 src/Tizen/Interop/Interop.Libraries.cs create mode 100644 src/Tizen/Tizen.Common/DotnetUtil.cs create mode 100644 src/Tizen/Tizen.Common/DotnetUtilErrorFactory.cs diff --git a/packaging/csapi-tizenfx.spec b/packaging/csapi-tizenfx.spec index a785368..a57285a 100644 --- a/packaging/csapi-tizenfx.spec +++ b/packaging/csapi-tizenfx.spec @@ -9,7 +9,7 @@ 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 @@ -144,7 +144,7 @@ rm -fr %{_tizenfx_bin_path} 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} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable.sln b/src/ElmSharp.Wearable/ElmSharp.Wearable.sln index dbf2ebd..95835a9 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable.sln +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable.sln @@ -1,7 +1,7 @@  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 @@ -11,6 +11,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp.Test", "..\..\test 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 @@ -33,6 +41,22 @@ Global {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 diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs index 6623984..851b135 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs @@ -15,6 +15,7 @@ */ using System; +using System.Diagnostics; namespace ElmSharp.Wearable { @@ -22,28 +23,45 @@ namespace ElmSharp.Wearable /// The Circle DateTime Selector is a widget to display and handle datetime value by rotary event /// Inherits /// - public class CircleDateTimeSelector : DateTimeSelector + public class CircleDateTimeSelector : DateTimeSelector, IRotaryActionWidget { - IntPtr circleHandle; + IntPtr _circleHandle; + CircleSurface _surface; /// /// Creates and initializes a new instance of the Circle DateTime class /// /// The parent of new Circle DateTime instance - public CircleDateTimeSelector(EvasObject parent) : base(parent) { } + /// The surface for drawing circle features for this widget. + public CircleDateTimeSelector(EvasObject parent, CircleSurface surface) : base() + { + Debug.Assert(parent == null || surface == null || parent.IsRealized); + _surface = surface; + Realize(parent); + } + + /// + /// Gets the handle for Circle Widget. + /// + public virtual IntPtr CircleHandle => _circleHandle; /// - /// Sets or gets the disabled state of the Circle DateTime Selector + /// Gets the handle for Circle Surface used in this widget /// - public bool Disabled + public virtual CircleSurface CircleSurface => _surface; + + /// + /// Sets or gets the state of the widget, which might be enabled or 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); } } @@ -55,12 +73,12 @@ namespace ElmSharp.Wearable 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); } } @@ -71,11 +89,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -86,11 +104,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -103,35 +121,7 @@ namespace ElmSharp.Wearable { 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; } diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs index d5c31e3..1de98bd 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs @@ -15,6 +15,7 @@ */ using System; +using System.Diagnostics; namespace ElmSharp.Wearable { @@ -22,28 +23,45 @@ namespace ElmSharp.Wearable /// The Circle GenList Selector is a widget to display and handle genlist items by rotary event /// Inherits /// - public class CircleGenList : GenList + public class CircleGenList : GenList, IRotaryActionWidget { - IntPtr circleHandle; + IntPtr _circleHandle; + CircleSurface _surface; /// /// Creates and initializes a new instance of the Circle GenList class /// /// The parent of new Circle GenList instance - public CircleGenList(EvasObject parent) : base(parent) { } + /// The surface for drawing circle features for this widget. + public CircleGenList(EvasObject parent, CircleSurface surface) : base() + { + Debug.Assert(parent == null || surface == null || parent.IsRealized); + _surface = surface; + Realize(parent); + } + + /// + /// Gets the handle for Circle Widget. + /// + public virtual IntPtr CircleHandle => _circleHandle; /// - /// Sets or gets the disabled state of the Circle GenList Selector + /// Gets the handle for Circle Surface used in this widget /// - public bool Disabled + public virtual CircleSurface CircleSurface => _surface; + + /// + /// Sets or gets the state of the widget, which might be enabled or 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); } } @@ -55,12 +73,12 @@ namespace ElmSharp.Wearable 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); } } @@ -71,11 +89,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -86,11 +104,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -102,12 +120,12 @@ namespace ElmSharp.Wearable 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); } } @@ -118,11 +136,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -133,11 +151,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -153,14 +171,14 @@ namespace ElmSharp.Wearable 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); } } @@ -172,36 +190,7 @@ namespace ElmSharp.Wearable 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; } diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs index bd6a98b..f4d7cbf 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs @@ -15,6 +15,7 @@ */ using System; +using System.Diagnostics; namespace ElmSharp.Wearable { @@ -22,16 +23,46 @@ namespace ElmSharp.Wearable /// /// The Circle ProgressBar is a widget for visually representing the progress status of a given job/task with the circular design. /// - public class CircleProgressBar : EvasObject + public class CircleProgressBar : Widget, ICircleWidget { + CircleSurface _surface; + /// /// Creates and initializes a new instance of the Circle Progressbar class. /// /// The parent of new Circle Progressbar instance - public CircleProgressBar(EvasObject parent) : base(parent) + /// The surface for drawing circle features for this widget. + public CircleProgressBar(EvasObject parent, CircleSurface surface) : base() { + Debug.Assert(parent == null || surface == null || parent.IsRealized); + _surface = surface; + Realize(parent); } + /// + /// Gets the handle for Circle Widget. + /// + public virtual IntPtr CircleHandle => Handle; + + /// + /// Gets the handle for Circle Surface used in this widget + /// + public virtual CircleSurface CircleSurface => _surface; + + /// + /// Sets or gets the state of the widget, which might be enabled or disabled. + /// + public override bool IsEnabled + { + get + { + return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle); + } + set + { + Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value); + } + } /// /// Sets or gets the value of ProgressBar. @@ -40,11 +71,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -57,13 +88,13 @@ namespace ElmSharp.Wearable { 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); } } @@ -76,13 +107,13 @@ namespace ElmSharp.Wearable { 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); } } @@ -93,11 +124,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -108,11 +139,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -123,11 +154,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -138,11 +169,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -155,13 +186,13 @@ namespace ElmSharp.Wearable { 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); } } @@ -174,28 +205,13 @@ namespace ElmSharp.Wearable { 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); - } - } - - /// - /// Sets or gets disable status of Circle ProgressBar. - /// - 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); } } @@ -210,19 +226,19 @@ namespace ElmSharp.Wearable 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); } } /// /// Sets or gets color of Background ProgressBar. /// - public Color BackgroundColor + public override Color BackgroundColor { get { @@ -230,12 +246,12 @@ namespace ElmSharp.Wearable 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); } } @@ -246,11 +262,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -261,11 +277,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -276,11 +292,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -291,11 +307,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -306,36 +322,7 @@ namespace ElmSharp.Wearable /// Handle IntPtr 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 diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs index cd3a3c3..e60f31e 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs @@ -15,36 +15,52 @@ */ using System; +using System.Diagnostics; namespace ElmSharp.Wearable { /// /// Circle scroller provides scrollbar with circular movement and is scrolled by rotary event. /// - public class CircleScroller : Scroller + public class CircleScroller : Scroller, IRotaryActionWidget { - private IntPtr _circleHandle; + IntPtr _circleHandle; + CircleSurface _surface; /// /// Creates and initializes a new instance of the CircleScroller class. /// /// The to which the new CircleScroller will be attached as a child. - public CircleScroller(EvasObject parent) : base(parent) + /// The surface for drawing circle features for this widget. + public CircleScroller(EvasObject parent, CircleSurface surface) : base() { + Debug.Assert(parent == null || surface == null || parent.IsRealized); + _surface = surface; + Realize(parent); } /// - /// Sets or gets disabled state of the circle scroller object. + /// Gets the handle for Circle Widget. /// - public bool Disabled + public virtual IntPtr CircleHandle => _circleHandle; + + /// + /// Gets the handle for Circle Surface used in this widget + /// + public virtual CircleSurface CircleSurface => _surface; + + /// + /// Sets or gets the state of the widget, which might be enabled or disabled. + /// + 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); } } @@ -60,13 +76,13 @@ namespace ElmSharp.Wearable 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); } } @@ -82,13 +98,13 @@ namespace ElmSharp.Wearable 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); } } @@ -103,12 +119,12 @@ namespace ElmSharp.Wearable 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); } } @@ -123,12 +139,12 @@ namespace ElmSharp.Wearable 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); } } @@ -143,12 +159,12 @@ namespace ElmSharp.Wearable 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); } } @@ -163,12 +179,12 @@ namespace ElmSharp.Wearable 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); } } @@ -179,11 +195,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -194,11 +210,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -209,11 +225,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -224,11 +240,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -239,11 +255,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -254,11 +270,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -269,11 +285,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -284,11 +300,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -300,33 +316,7 @@ namespace ElmSharp.Wearable 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; } } diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs index 48f86a1..06bd53b 100755 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs @@ -15,33 +15,46 @@ */ using System; +using System.Diagnostics; namespace ElmSharp.Wearable { /// /// Circle slider is circular designed widget to select a value in a range by rotary event. /// - public class CircleSlider : EvasObject + public class CircleSlider : Widget, IRotaryActionWidget { - /// - /// Changed will be triggered when the circle slider value changes. - /// - public event EventHandler Changed; - SmartEvent _changedEvent; + CircleSurface _surface; /// /// Creates and initializes a new instance of the CircleSlider class. /// /// The EvasObject to which the new CircleSlider will be attached as a child. - public CircleSlider(EvasObject parent) : base(parent) + /// The surface for drawing circle features for this widget. + 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); } /// + /// Changed will be triggered when the circle slider value changes. + /// + public event EventHandler ValueChanged; + + /// + /// Gets the handle for Circle Widget. + /// + public virtual IntPtr CircleHandle => RealHandle; + + /// + /// Gets the handle for Circle Surface used in this widget + /// + public virtual CircleSurface CircleSurface => _surface; + + /// /// Sets or gets the step by which the circle slider bar moves. /// /// @@ -52,26 +65,26 @@ namespace ElmSharp.Wearable { 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); } } /// - /// Sets or gets disabled state of the circle slider object. + /// Sets or gets the state of the widget, which might be enabled or disabled. /// - 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); } } @@ -86,19 +99,19 @@ namespace ElmSharp.Wearable 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); } } /// /// Sets or gets color of the circle slider background. /// - public Color BackgroundColor + public override Color BackgroundColor { get { @@ -106,12 +119,12 @@ namespace ElmSharp.Wearable 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); } } @@ -122,11 +135,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -137,11 +150,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -152,11 +165,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -167,11 +180,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -183,11 +196,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -199,11 +212,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -216,13 +229,13 @@ namespace ElmSharp.Wearable { 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); } } @@ -235,13 +248,13 @@ namespace ElmSharp.Wearable { 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); } } @@ -259,13 +272,13 @@ namespace ElmSharp.Wearable { 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); } } @@ -284,13 +297,13 @@ namespace ElmSharp.Wearable { 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); } } @@ -304,11 +317,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -319,11 +332,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -334,50 +347,32 @@ namespace ElmSharp.Wearable { 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); } } /// + /// The callback of Realized Event + /// + protected override void OnRealized() + { + base.OnRealized(); + _changedEvent = new SmartEvent(this, "value,changed"); + _changedEvent.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty); + } + + /// /// Creates a widget handle. /// /// Parent EvasObject /// Handle IntPtr 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 diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs index fbc84d7..e66fa54 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs @@ -15,6 +15,7 @@ */ using System; +using System.Diagnostics; namespace ElmSharp.Wearable { @@ -23,20 +24,35 @@ namespace ElmSharp.Wearable /// The Circle Spinner is a widget to display and handle spinner value by rotary event /// Inherits . /// - 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; /// /// Creates and initializes a new instance of the Circle Spinner class. /// /// The parent of new Circle Spinner instance - public CircleSpinner(EvasObject parent) : base(parent) + /// The surface for drawing circle features for this widget. + public CircleSpinner(EvasObject parent, CircleSurface surface) : base() { + Debug.Assert(parent == null || surface == null || parent.IsRealized); + _surface = surface; + Realize(parent); } /// + /// Gets the handle for Circle Widget. + /// + public virtual IntPtr CircleHandle => RealHandle; + + /// + /// Gets the handle for Circle Surface used in this widget + /// + public virtual CircleSurface CircleSurface => _surface; + + /// /// Sets or gets the circle spinner angle per each spinner value. /// public double AngleRatio @@ -48,22 +64,22 @@ namespace ElmSharp.Wearable set { _angleRatio = value; - Interop.Eext.eext_circle_object_spinner_angle_set(_circleHandle, _angleRatio); + Interop.Eext.eext_circle_object_spinner_angle_set(CircleHandle, _angleRatio); } } /// - /// Sets or gets disabled state of the circle spinner object. + /// Sets or gets the state of the widget, which might be enabled or disabled. /// - 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); } } @@ -74,11 +90,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -90,12 +106,12 @@ namespace ElmSharp.Wearable 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); } } @@ -106,11 +122,11 @@ namespace ElmSharp.Wearable { 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); } } @@ -122,36 +138,7 @@ namespace ElmSharp.Wearable 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; } } diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSurface.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSurface.cs new file mode 100644 index 0000000..91da5a1 --- /dev/null +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSurface.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ElmSharp.Wearable +{ + /// + /// The CircleSurface presents a surface for drawing circular feature of circle widgets + /// + public class CircleSurface + { + IntPtr _handle; + + /// + /// Creates and initializes a new instance of the CircleSurface class with surface on the Conformant widget. + /// + /// Conformant widget to create a surface. + public CircleSurface(Conformant conformant) + { + _handle = Interop.Eext.eext_circle_surface_conformant_add(conformant); + } + + /// + /// Creates and initializes a new instance of the CircleSurface class with surface on the Layout widget. + /// + /// Layout widget to create a surface. + public CircleSurface(Layout layout) + { + _handle = Interop.Eext.eext_circle_surface_layout_add(layout); + } + + /// + /// Creates and initializes a new instance of the CircleSurface class with surface on the Naviframe widget. + /// + /// Naviframe widget to create a surface. + public CircleSurface(Naviframe naviframe) + { + _handle = Interop.Eext.eext_circle_surface_naviframe_add(naviframe); + } + + /// + /// Creates and initializes a new instance of the CircleSurface class with no surface + /// + public CircleSurface() + { + _handle = IntPtr.Zero; + } + + public IntPtr Handle => _handle; + } +} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/ICircleWidget.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/ICircleWidget.cs new file mode 100644 index 0000000..17cdf42 --- /dev/null +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/ICircleWidget.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ElmSharp.Wearable +{ + /// + /// The ICircleWidget is the interface for a widget to display and handle with circle surface + /// + public interface ICircleWidget + { + /// + /// Gets the handle for Circle Widget. + /// + IntPtr CircleHandle { get; } + + /// + /// Gets the CircleSurface used in this widget + /// + CircleSurface CircleSurface { get; } + } + + /// + /// The IRotaryActionWidget is the interface for a widget has action by rotary event + /// + public interface IRotaryActionWidget : ICircleWidget + { + } +} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotaryEventManager.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotaryEventManager.cs index 6b34fde..f413ae4 100644 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotaryEventManager.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotaryEventManager.cs @@ -67,7 +67,7 @@ namespace ElmSharp.Wearable /// /// RotaryEventManager serve extension functions for Rotary event to EvasObject on device like Galaxy Gear. /// - public static class EvasObjectExtensions + public static class RotaryEventExtensions { static Dictionary s_rotaryObjectEventHandlers = new Dictionary(); static Dictionary s_rotaryObjectEventMap = new Dictionary(); @@ -110,6 +110,24 @@ namespace ElmSharp.Wearable } /// + /// Activate this circle widget can take Rotary event. + /// + /// Target circle widget + public static void Activate(this IRotaryActionWidget widget) + { + Interop.Eext.eext_rotary_object_event_activated_set(widget.CircleHandle, true); + } + + /// + /// Deactivate this circle widget is blocked from Rotary event. + /// + /// Target circle widget + public static void Deactivate(this IRotaryActionWidget widget) + { + Interop.Eext.eext_rotary_object_event_activated_set(widget.CircleHandle, false); + } + + /// /// Activate this object can take Rotary event. /// /// Target object diff --git a/src/ElmSharp/ElmSharp/Container.cs b/src/ElmSharp/ElmSharp/Container.cs index 135c3d3..b7e0e33 100755 --- a/src/ElmSharp/ElmSharp/Container.cs +++ b/src/ElmSharp/ElmSharp/Container.cs @@ -39,6 +39,13 @@ namespace ElmSharp } /// + /// Creates and initializes a new instance of Container class. + /// + protected Container() : base() + { + } + + /// /// Sets the background color of a given Container. /// public override Color BackgroundColor diff --git a/src/ElmSharp/ElmSharp/DateTimeSelector.cs b/src/ElmSharp/ElmSharp/DateTimeSelector.cs index 98d2cbe..c159804 100755 --- a/src/ElmSharp/ElmSharp/DateTimeSelector.cs +++ b/src/ElmSharp/ElmSharp/DateTimeSelector.cs @@ -67,13 +67,13 @@ namespace ElmSharp ///as a child.It's type. 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; - }; + } + + /// + /// Creates and initializes a new instance of DateTimeSelector class. + /// + protected DateTimeSelector() : base() + { } /// @@ -189,6 +189,21 @@ namespace ElmSharp } /// + /// The callback of Realized Event + /// + 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; + }; + } + + /// /// Creates a widget handle. /// /// Parent EvasObject diff --git a/src/ElmSharp/ElmSharp/GenList.cs b/src/ElmSharp/ElmSharp/GenList.cs index 7afb41c..600c57b 100755 --- a/src/ElmSharp/ElmSharp/GenList.cs +++ b/src/ElmSharp/ElmSharp/GenList.cs @@ -155,8 +155,13 @@ namespace ElmSharp /// The parent is a given container which will be attached by GenList as a child. It's type. public GenList(EvasObject parent) : base(parent) { - ListMode = GenListMode.Compress; - InitializeSmartEvent(); + } + + /// + /// Creates and initializes a new instance of GenList class. + /// + protected GenList() : base() + { } /// @@ -351,6 +356,17 @@ namespace ElmSharp } /// + /// Gets count of items in a this genlist widget + /// + public int Count + { + get + { + return Interop.Elementary.elm_genlist_items_count(RealHandle); + } + } + + /// /// ItemSelected is raised when a new genlist item is selected. /// public event EventHandler ItemSelected; @@ -712,6 +728,16 @@ namespace ElmSharp } /// + /// The callback of Unrealize Event + /// + protected override void OnRealized() + { + base.OnRealized(); + ListMode = GenListMode.Compress; + InitializeSmartEvent(); + } + + /// /// Creates a widget handle. /// /// Parent EvasObject diff --git a/src/ElmSharp/ElmSharp/ItemObject.cs b/src/ElmSharp/ElmSharp/ItemObject.cs index b4616a4..0980c5b 100755 --- a/src/ElmSharp/ElmSharp/ItemObject.cs +++ b/src/ElmSharp/ElmSharp/ItemObject.cs @@ -82,6 +82,21 @@ namespace ElmSharp } } + /// + /// Sets or gets the style of the Item. + /// + 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 diff --git a/src/ElmSharp/ElmSharp/Layout.cs b/src/ElmSharp/ElmSharp/Layout.cs index 4e7b294..d5716e1 100644 --- a/src/ElmSharp/ElmSharp/Layout.cs +++ b/src/ElmSharp/ElmSharp/Layout.cs @@ -35,17 +35,13 @@ namespace ElmSharp /// The parent is a given container which will be attached by Layout as a child. It's type. 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); - }; + /// + /// Creates and initializes a new instance of Layout class. + /// + protected Layout() : base() + { } /// @@ -340,6 +336,25 @@ namespace ElmSharp } /// + /// The callback of Realized Event + /// + 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); + }; + } + + /// /// Sets the content at a part of a given container widget. /// /// The parent is a given container which will be attached by Layout as a child. It's type. diff --git a/src/ElmSharp/ElmSharp/Scroller.cs b/src/ElmSharp/ElmSharp/Scroller.cs index 64079d1..cf7352e 100755 --- a/src/ElmSharp/ElmSharp/Scroller.cs +++ b/src/ElmSharp/ElmSharp/Scroller.cs @@ -97,10 +97,13 @@ namespace ElmSharp /// The to which the new Scroller will be attached as a child. 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"); + } + + /// + /// Creates and initializes a new instance of the Scroller class. + /// + public Scroller() : base() + { } /// @@ -780,6 +783,15 @@ namespace ElmSharp } } + 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"); + } + /// /// Creates a widget handle. /// diff --git a/src/ElmSharp/ElmSharp/Spinner.cs b/src/ElmSharp/ElmSharp/Spinner.cs index 556de96..794aa32 100755 --- a/src/ElmSharp/ElmSharp/Spinner.cs +++ b/src/ElmSharp/ElmSharp/Spinner.cs @@ -36,11 +36,13 @@ namespace ElmSharp /// The parent of new Spinner instance 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); + /// + /// Creates and initializes a new instance of Layout class. + /// + protected Spinner() : base() + { } /// @@ -241,6 +243,19 @@ namespace ElmSharp } /// + /// The callback of Realized Event + /// + 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); + } + + /// /// Creates a widget handle. /// /// Parent EvasObject diff --git a/src/ElmSharp/ElmSharp/Widget.cs b/src/ElmSharp/ElmSharp/Widget.cs index 040d132..a6b19fe 100755 --- a/src/ElmSharp/ElmSharp/Widget.cs +++ b/src/ElmSharp/ElmSharp/Widget.cs @@ -83,11 +83,6 @@ namespace ElmSharp /// The parent of new Widget instance 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); } /// @@ -113,7 +108,7 @@ namespace ElmSharp /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// - public bool IsEnabled + public virtual bool IsEnabled { get { @@ -437,6 +432,29 @@ namespace ElmSharp return a; } + /// + /// Send a signal to the edje object of the widget. + /// + /// The signal's name. + /// The signal's source. + public void SignalEmit(string emission, string source) + { + Interop.Elementary.elm_object_signal_emit(Handle, emission, source); + } + + /// + /// The callback of Realized Event + /// + 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); diff --git a/src/ElmSharp/Interop/Interop.Elementary.Item.cs b/src/ElmSharp/Interop/Interop.Elementary.Item.cs index 0d516ec..c0e4f3f 100644 --- a/src/ElmSharp/Interop/Interop.Elementary.Item.cs +++ b/src/ElmSharp/Interop/Interop.Elementary.Item.cs @@ -99,6 +99,18 @@ internal static partial class Interop [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); diff --git a/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs b/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs index 7685607..8c6a084 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs @@ -40,9 +40,11 @@ namespace Tizen.Applications /// The bundle constructor. /// /// Thrown when out of memory. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// + /// public Bundle() { _handle = Interop.Bundle.Create(); @@ -96,11 +98,13 @@ namespace Tizen.Applications /// /// The number of items in a bundle object. /// + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// bundle.AddItem("string", "a_string"); /// Console.WriteLine("There are {0} items in the bundle", bundle.Count); /// + /// public int Count { get @@ -112,6 +116,7 @@ namespace Tizen.Applications /// /// The keys in a bundle object. /// + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// bundle.AddItem("string1", "a_string1"); @@ -123,6 +128,7 @@ namespace Tizen.Applications /// Console.WriteLine(key); /// } /// + /// public IEnumerable Keys { get @@ -153,6 +159,7 @@ namespace Tizen.Applications /// /// The key to check for. /// true if the bundle contains the key, false otherwise. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// bundle.AddItem("string", "a_string"); @@ -162,6 +169,7 @@ namespace Tizen.Applications /// Console.WriteLine(aValue); /// } /// + /// public bool Contains(string key) { return _keys.Contains(key); @@ -175,11 +183,13 @@ namespace Tizen.Applications /// Thrown when the key already exists or when there is an invalid parameter. /// Thrown when a value is null. /// Thrown when out of memory or when the bundle instance has been disposed. + /// /// /// 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); /// + /// public void AddItem(string key, byte[] value) { if (value == null) @@ -200,11 +210,13 @@ namespace Tizen.Applications /// Thrown when the key already exists or when there is an invalid parameter. /// Thrown when a value is null. /// Thrown when out of memory or when the bundle instance has been disposed. + /// /// /// 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); /// + /// public void AddItem(string key, byte[] value, int offset, int count) { if (!_keys.Contains(key)) @@ -247,10 +259,12 @@ namespace Tizen.Applications /// The value of the item. /// Thrown when the key already exists or when there is an invalid parameter. /// Thrown when out of memory or when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// bundle.AddItem("string", "a_string"); /// + /// public void AddItem(string key, string value) { if (!_keys.Contains(key)) @@ -272,11 +286,13 @@ namespace Tizen.Applications /// The value of the item. /// Thrown when the key already exists or when there is an invalid parameter. /// Thrown when out of memory or when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// string[] stringArray = { "a", "b", "c" }; /// bundle.AddItem("string_array", stringArray); /// + /// public void AddItem(string key, IEnumerable value) { if (!_keys.Contains(key)) @@ -299,6 +315,7 @@ namespace Tizen.Applications /// The value of the bundle item. /// Thrown when the key does not exist or when there is an invalid parameter. /// Thrown when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// bundle.AddItem("string", "a_string"); @@ -312,6 +329,7 @@ namespace Tizen.Applications /// } /// } /// + /// public object GetItem(string key) { if (_keys.Contains(key)) @@ -369,6 +387,7 @@ namespace Tizen.Applications /// Thrown when the key does not exist or when there is an invalid parameter. /// Thrown when the value of the bundle item cannot be converted to the specified generic type. /// Thrown when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// string[] stringArray = { "a", "b", "c" }; @@ -388,6 +407,7 @@ namespace Tizen.Applications /// } /// } /// + /// public T GetItem(string key) { return (T)GetItem(key); @@ -400,6 +420,7 @@ namespace Tizen.Applications /// 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. /// true if an item with the key exists and if the value is the same type as the output value parameter, false otherwise. /// Thrown when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// byte[] byteArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; @@ -410,6 +431,7 @@ namespace Tizen.Applications /// Console.WriteLine("First item in the byte array: {0}", aByteArray[0]); /// } /// + /// public bool TryGetItem(string key, out byte[] value) { if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.Byte) @@ -435,6 +457,7 @@ namespace Tizen.Applications /// 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. /// true if an item with the key exists and if the value is the same type as the output value parameter, false otherwise. /// Thrown when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// bundle.AddItem("string", "a_string"); @@ -444,6 +467,7 @@ namespace Tizen.Applications /// Console.WriteLine(aString); /// } /// + /// public bool TryGetItem(string key, out string value) { if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.String) @@ -469,6 +493,7 @@ namespace Tizen.Applications /// 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. /// true if an item with the key exists and if the value is the same type as the output value parameter, false otherwise. /// Thrown when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// string[] stringArray = { "a", "b", "c" }; @@ -482,6 +507,7 @@ namespace Tizen.Applications /// } /// } /// + /// public bool TryGetItem(string key, out IEnumerable value) { if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.StringArray) @@ -508,6 +534,7 @@ namespace Tizen.Applications /// true if the item is of the specified type, false otherwise. /// Thrown when the key does not exist or when there is an invalid parameter. /// Thrown when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// string[] stringArray = { "a", "b", "c" }; @@ -522,6 +549,7 @@ namespace Tizen.Applications /// } /// } /// + /// public bool Is(string key) { if (_keys.Contains(key)) @@ -555,6 +583,7 @@ namespace Tizen.Applications /// true if the item is successfully found and removed, false otherwise (even if the item is not found). /// Thrown when there is an invalid parameter. /// Thrown when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// bundle.AddItem("string", "a_string"); @@ -566,6 +595,7 @@ namespace Tizen.Applications /// } /// } /// + /// public bool RemoveItem(string key) { if (_keys.Contains(key)) @@ -591,11 +621,13 @@ namespace Tizen.Applications /// The encoded bundle data. bundleRaw should be the returned value of Tizen.Applications.Bundle.Encode, otherwise this method will not succeed. /// Decoded Bundle object. /// Thrown when there is an invalid parameter. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// string bundleRaw = bundle.Encode(); /// Bundle data = bundle.Decode(bundleRaw); /// + /// public static Bundle Decode(string bundleRaw) { SafeBundleHandle handle; @@ -614,10 +646,12 @@ namespace Tizen.Applications /// /// Encoded bundle data in string. /// Thrown when out of memory or when the bundle instance has been disposed. + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// string bundleRaw = bundle.Encode(); /// + /// public string Encode() { string bundleRaw; diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs index b1bd818..5050abe 100755 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs +++ b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs @@ -53,9 +53,11 @@ namespace Tizen.Applications.Messages /// The name of the local message port. /// If true, it is the trusted message port of application, otherwise false. /// Thrown when portName is null or empty. + /// /// /// MessagePort messagePort = new MessagePort("SenderPort", true); /// + /// public MessagePort(string portName, bool trusted) { if (String.IsNullOrEmpty(portName)) @@ -77,6 +79,7 @@ namespace Tizen.Applications.Messages /// /// Called when a message is received. /// + /// /// /// MessagePort messagePort = new MessagePort("SenderPort", true); /// messagePort.MessageReceived += MessageReceivedCallback; @@ -88,6 +91,7 @@ namespace Tizen.Applications.Messages /// } /// } /// + /// public event EventHandler MessageReceived; /// @@ -128,11 +132,13 @@ namespace Tizen.Applications.Messages /// Thrown when portName is already used, when there is an I/O error. /// Thrown when there is an invalid parameter. /// Thrown when out of memory. + /// /// /// MessagePort messagePort = new MessagePort("SenderPort", true); /// messagePort.MessageReceived += MessageReceivedCallback; /// messagePort.Listen(); /// + /// public void Listen() { lock (s_lock) @@ -178,6 +184,7 @@ namespace Tizen.Applications.Messages /// Thrown when messageport is already stopped, when there is an I/O error, when the port is not found. /// Thrown when there is an invalid parameter. /// Thrown when out of memory. + /// /// /// MessagePort messagePort = new MessagePort("SenderPort", true); /// messagePort.MessageReceived += MessageReceivedCallback; @@ -189,6 +196,7 @@ namespace Tizen.Applications.Messages /// } /// messagePort.StopListening(); /// + /// public void StopListening() { if (!_listening) @@ -223,6 +231,7 @@ namespace Tizen.Applications.Messages /// Thrown when there is an invalid parameter. /// Thrown when out of memory. /// Thrown when message has exceeded the maximum limit(4KB). + /// /// /// MessagePort messagePort = new MessagePort("SenderPort", true); /// messagePort.MessageReceived += MessageReceivedCallback; @@ -233,6 +242,7 @@ namespace Tizen.Applications.Messages /// messagePort.Send(message, "ReceiverAppID", "ReceiverPort"); /// } /// + /// public void Send(Bundle message, string remoteAppId, string remotePortName) { Send(message, remoteAppId, remotePortName, false); @@ -250,6 +260,7 @@ namespace Tizen.Applications.Messages /// Thrown when out of memory. /// Thrown when message has exceeded the maximum limit(4KB). /// Thrown when the remote application is not signed with the same certificate. + /// /// /// MessagePort messagePort = new MessagePort("SenderPort", true); /// messagePort.MessageReceived += MessageReceivedCallback; @@ -260,6 +271,7 @@ namespace Tizen.Applications.Messages /// messagePort.Send(message, "ReceiverAppID", "ReceiverPort", true); /// } /// + /// public void Send(Bundle message, string remoteAppId, string remotePortName, bool trusted) { if (!_listening) diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePort.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePort.cs index 561948d..c589638 100755 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePort.cs +++ b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePort.cs @@ -48,9 +48,11 @@ namespace Tizen.Applications.Messages /// The name of the remote message port /// If true is the trusted message port of application, otherwise false /// Thrown when appId is null or empty, when portName is null or empty + /// /// /// RemotePort remotePort = new RemotePort("org.tizen.example.messageport", "SenderPort", false); /// + /// public RemotePort(String appId, string portName, bool trusted) { if (String.IsNullOrEmpty(appId) || String.IsNullOrEmpty(portName)) @@ -137,10 +139,12 @@ namespace Tizen.Applications.Messages /// 4 /// Thrown when there is an I/O error /// Thrown when out of memory. + /// /// /// Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true); /// bool isRunning = remotePort.isRunning(); /// + /// /// Return true if Remote Port is running public bool IsRunning() { @@ -169,6 +173,7 @@ namespace Tizen.Applications.Messages /// 4 /// Thrown when there is an I/O error /// Thrown when out of memory. + /// /// /// Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true); /// remotePort.RemotePortStateChanged += RemotePortStateChangedCallback; @@ -187,6 +192,7 @@ namespace Tizen.Applications.Messages /// } /// } /// + /// public event EventHandler RemotePortStateChanged { add diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs index 2697e15..cc1b40f 100644 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs +++ b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs @@ -21,7 +21,7 @@ using System.Diagnostics; namespace Tizen.Multimedia.MediaCodec { /// - /// 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. /// public class MediaCodec : IDisposable { diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringAudioInfo.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringAudioInfo.cs index c3024ce..407ccf7 100644 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringAudioInfo.cs +++ b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringAudioInfo.cs @@ -38,7 +38,7 @@ namespace Tizen.Multimedia.Remoting /// /// /// Not connected to a source.
- ///
+ /// -or-
/// An internal error occurs. ///
/// The has already been disposed. @@ -60,7 +60,7 @@ namespace Tizen.Multimedia.Remoting ///
/// /// Not connected to a source.
- ///
+ /// -or-
/// An internal error occurs. ///
/// The has already been disposed. @@ -82,7 +82,7 @@ namespace Tizen.Multimedia.Remoting ///
/// /// Not connected to a source.
- ///
+ /// -or-
/// An internal error occurs. ///
/// The has already been disposed. @@ -104,7 +104,7 @@ namespace Tizen.Multimedia.Remoting ///
/// /// Not connected to a source.
- ///
+ /// -or-
/// An internal error occurs. ///
/// The has already been disposed. diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringVideoInfo.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringVideoInfo.cs index 35856f5..8acd950 100644 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringVideoInfo.cs +++ b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringVideoInfo.cs @@ -37,7 +37,7 @@ namespace Tizen.Multimedia.Remoting /// /// /// Not connected to a source.
- ///
+ /// -or-
/// An internal error occurs. ///
/// The has already been disposed. @@ -59,7 +59,7 @@ namespace Tizen.Multimedia.Remoting /// /// /// Not connected to a source.
- ///
+ /// -or-
/// An internal error occurs. ///
/// The has already been disposed. @@ -82,7 +82,7 @@ namespace Tizen.Multimedia.Remoting /// /// /// Not connected to a source.
- ///
+ /// -or-
/// An internal error occurs. ///
/// The has already been disposed. diff --git a/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs b/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs index 6649e29..25f8f28 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs @@ -28,7 +28,7 @@ namespace Tizen.Multimedia.Util /// Initializes a new instance of the class with a buffer and a delay. /// /// The raw image buffer to be encoded. - /// The delay for this image, in 0.001 sec units. + /// The delay for this image in milliseconds. /// is null. /// The length of is zero. public GifFrame(byte[] buffer, uint delay) @@ -55,7 +55,7 @@ namespace Tizen.Multimedia.Util /// /// Gets or sets the delay for this image. /// - /// Time delay in 0.001 sec units. + /// Time delay in milliseconds. public uint Delay { get; set; } } } diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs index 502e31c..aeb2ab0 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs @@ -95,9 +95,7 @@ namespace Tizen.Multimedia.Util /// /// is an empty string.
/// -or-
- /// is not a image file.
- /// -or-
- /// The format of is not . + /// is not a image file. ///
/// does not exists. /// The caller does not have required permission to access the path. @@ -140,11 +138,7 @@ namespace Tizen.Multimedia.Util /// A task that represents the asynchronous decoding operation. /// Only Graphics Interchange Format(GIF) codec returns more than one frame. /// is null. - /// - /// is an empty array.
- /// -or-
- /// The format of is not . - ///
+ /// is an empty array. /// The format of is not . /// The has already been disposed of. public Task> DecodeAsync(byte[] inputBuffer) diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs index d68c82d..3c08449 100644 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs +++ b/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs @@ -107,7 +107,7 @@ namespace Tizen.Multimedia.Util /// /// index is less than 0.
/// -or-
- /// index is equal to or greater than Count. + /// index is equal to or greater than . ///
public ImageTransform this[int index] { @@ -338,7 +338,7 @@ namespace Tizen.Multimedia.Util private Flips _flip; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The value how to flip an image. /// is invalid. @@ -349,7 +349,7 @@ namespace Tizen.Multimedia.Util } /// - /// Gets or sets the value how to rotate an image. + /// Gets or sets the value how to flip an image. /// /// is invalid. /// is . diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerator.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerator.cs index 10fe034..8979b25 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerator.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerator.cs @@ -141,7 +141,7 @@ namespace Tizen.Multimedia.Vision /// -or-
/// is .
/// -or-
- /// is invalid. + /// is invalid.
/// -or-
/// contains illegal characters. /// @@ -163,9 +163,9 @@ namespace Tizen.Multimedia.Vision /// /// is too long.
/// -or-
- /// is . + /// is .
/// -or-
- /// is invalid. + /// is invalid.
/// -or-
/// contains illegal characters. ///
@@ -304,9 +304,9 @@ namespace Tizen.Multimedia.Vision /// /// is too long.
/// -or-
- /// is . + /// is .
/// -or-
- /// is invalid. + /// is invalid.
/// -or-
/// contains illegal characters. ///
@@ -334,9 +334,9 @@ namespace Tizen.Multimedia.Vision /// /// is too long.
/// -or-
- /// is . + /// is .
/// -or-
- /// is invalid. + /// is invalid.
/// -or-
/// contains illegal characters. ///
diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageConfiguration.cs index 7fee12d..0785f83 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageConfiguration.cs @@ -41,9 +41,11 @@ namespace Tizen.Multimedia.Vision /// /// is null. /// is invalid. + /// /// - /// 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); /// + /// /// 3 public BarcodeImageConfiguration(Size size, string path, BarcodeImageFormat imageFormat) { @@ -89,9 +91,11 @@ namespace Tizen.Multimedia.Vision /// /// is null. /// is invalid. + /// /// - /// 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); /// + /// /// 3 public BarcodeImageConfiguration(int width, int height, string path, BarcodeImageFormat imageFormat) : this(new Size(width, height), path, imageFormat) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs index d2e12be..cb8c57f 100644 --- a/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs @@ -60,7 +60,6 @@ namespace Tizen.Multimedia.Vision internal EngineConfiguration(string engineType1, string engineType2) { - if (IsSupportedEngineType(engineType1, engineType2) == false) { throw new NotSupportedException($"{engineType1} or {engineType2} : Not Supported"); @@ -102,7 +101,6 @@ namespace Tizen.Multimedia.Vision 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"); diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs index 2ca0f6b..e8634a4 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs @@ -21,6 +21,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents a configuration of instances. /// + /// http://tizen.org/feature/vision.face_recognition /// 3 public class FaceDetectionConfiguration : EngineConfiguration { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs index b2d74b5..1e0991c 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs @@ -39,6 +39,7 @@ namespace Tizen.Multimedia.Vision /// -or-
/// The format of is not supported. /// + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task DetectAsync(MediaVisionSource source) { @@ -54,6 +55,7 @@ namespace Tizen.Multimedia.Vision /// A task that represents the asynchronous detect operation. /// is null. /// The feature is not supported. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task DetectAsync(MediaVisionSource source, FaceDetectionConfiguration config) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs index 87c2618..69cd91d 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs @@ -21,6 +21,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents a configuration of instances. /// + /// http://tizen.org/feature/vision.face_recognition /// 3 public class FaceRecognitionConfiguration : EngineConfiguration { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs index 9ccac51..20a97d7 100644 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs @@ -24,6 +24,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents the face recognition model interface. /// + /// http://tizen.org/feature/vision.face_recognition /// 3 public class FaceRecognitionModel : IDisposable { @@ -79,6 +80,7 @@ namespace Tizen.Multimedia.Vision /// /// Gets labels that had been learned by the model. /// + /// The has already been disposed of. /// 3 public int[] Labels { @@ -87,9 +89,7 @@ namespace Tizen.Multimedia.Vision 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]; diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs index 5eed1bf..defe2c7 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs @@ -42,6 +42,7 @@ namespace Tizen.Multimedia.Vision /// The feature is not supported. /// has already been disposed of. /// is untrained model. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task RecognizeAsync(MediaVisionSource source, FaceRecognitionModel recognitionModel) @@ -64,6 +65,7 @@ namespace Tizen.Multimedia.Vision /// The feature is not supported. /// has already been disposed of. /// is untrained model. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task RecognizeAsync(MediaVisionSource source, FaceRecognitionModel recognitionModel, Rectangle bound) @@ -90,6 +92,7 @@ namespace Tizen.Multimedia.Vision /// has already been disposed of. /// /// is untrained model. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task RecognizeAsync(MediaVisionSource source, FaceRecognitionModel recognitionModel, FaceRecognitionConfiguration config) @@ -97,7 +100,6 @@ namespace Tizen.Multimedia.Vision return await InvokeRecognizeAsync(source, recognitionModel, null, config); } - /// /// Performs face recognition on the source with , /// and a bounding box. @@ -119,6 +121,7 @@ namespace Tizen.Multimedia.Vision /// has already been disposed of. /// /// is untrained model. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task RecognizeAsync(MediaVisionSource source, FaceRecognitionModel recognitionModel, Rectangle bound, FaceRecognitionConfiguration config) @@ -211,6 +214,7 @@ namespace Tizen.Multimedia.Vision /// is null. /// has already been disposed of. /// The feature is not supported. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task RecognizeEyeConditionAsync(MediaVisionSource source, Rectangle bound) @@ -232,6 +236,7 @@ namespace Tizen.Multimedia.Vision /// has already been disposed of. /// /// The feature is not supported. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task RecognizeEyeConditionAsync(MediaVisionSource source, Rectangle bound, FaceRecognitionConfiguration config) @@ -271,6 +276,7 @@ namespace Tizen.Multimedia.Vision /// is null. /// has already been disposed of. /// The feature is not supported. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task RecognizeFacialExpressionAsync(MediaVisionSource source, Rectangle bound) @@ -292,6 +298,7 @@ namespace Tizen.Multimedia.Vision /// has already been disposed of. /// /// The feature is not supported. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task RecognizeFacialExpressionAsync(MediaVisionSource source, Rectangle bound, FaceRecognitionConfiguration config) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs index 2f7e7c3..22b529f 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs @@ -49,6 +49,7 @@ namespace Tizen.Multimedia.Vision /// /// The feature is not supported. /// is not prepared. + /// http://tizen.org/feature/vision.face_recognition /// 3 public static async Task TrackAsync(MediaVisionSource source, FaceTrackingModel trackingModel, bool doLearn) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs index 55e6c63..09e3148 100644 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents the face tracking model. /// + /// http://tizen.org/feature/vision.face_recognition /// 3 public class FaceTrackingModel : IDisposable { @@ -124,7 +125,7 @@ namespace Tizen.Multimedia.Vision /// Path to the file to save the model. /// is null. /// No permission to write to the specified path. - /// The has already been disposed of. + /// The has already been disposed of. /// The directory for does not exist. /// 3 public void Save(string path) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs index 9c86e94..1d6c260 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs @@ -30,7 +30,7 @@ namespace Tizen.Multimedia.Vision } /// - /// Gets the value indicating the recognition is successful. + /// Gets the value indicating the tracking is successful. /// /// 3 public bool Success { get; } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs index 81ca8dd..c4c888c 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs @@ -21,6 +21,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents a configuration of fill operations of instances. /// + /// http://tizen.org/feature/vision.image_recognition /// 3 public class ImageFillConfiguration : EngineConfiguration { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs index 8e252ea..7187aea 100644 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents an image object. /// + /// http://tizen.org/feature/vision.image_recognition /// 3 public class ImageObject : IDisposable { @@ -126,6 +127,7 @@ namespace Tizen.Multimedia.Vision /// /// Sets the label for the . /// + /// The label which will be assigned to the image object. /// /// 3 public void SetLabel(int label) @@ -135,7 +137,7 @@ namespace Tizen.Multimedia.Vision /// /// Fills the image object.
- /// 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. ///
/// The source image where image object is depicted. /// is null. @@ -152,7 +154,7 @@ namespace Tizen.Multimedia.Vision /// /// Fills the image object.
- /// 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. ///
/// The source image where image object is depicted. /// The configuration used for extract recognition data from source. This value can be null. @@ -172,7 +174,8 @@ namespace Tizen.Multimedia.Vision /// /// Fills the image object.
- /// 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. ///
/// The source image where image object is depicted. /// Rectangular bound of the image object on the source image. @@ -190,7 +193,8 @@ namespace Tizen.Multimedia.Vision /// /// Fills the image object.
- /// 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. ///
/// The source image where image object is depicted. /// The configuration used for extract recognition data from source. This value can be null. @@ -238,7 +242,7 @@ namespace Tizen.Multimedia.Vision /// Path to the file to save the model. /// is null. /// No permission to write to the specified path. - /// The has already been disposed of. + /// The has already been disposed of. /// The directory for does not exist. /// 3 public void Save(string path) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs index 77a24a4..60ec4d4 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs @@ -21,6 +21,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents a configuration of . /// + /// http://tizen.org/feature/vision.image_recognition /// 3 public class ImageRecognitionConfiguration : EngineConfiguration { @@ -32,7 +33,7 @@ namespace Tizen.Multimedia.Vision private const string KeyTolerantPartMatchingError = "MV_IMAGE_RECOGNITION_TOLERANT_MATCH_PART_ERR"; /// - /// A read-only field that represents the default value of . + /// A read-only field that represents the default value of . /// /// 3 public static readonly double DefaultSceneScaleFactor = 1.2; diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs index 5e13c46..537407c 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs @@ -32,6 +32,7 @@ namespace Tizen.Multimedia.Vision /// /// The region of recognized image object on the source image. /// + /// The region of recognized image object if successful, otherwise null. /// 3 public Quadrangle Region { get; } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs index 423d3d6..a7ecd51 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs @@ -43,6 +43,7 @@ namespace Tizen.Multimedia.Vision /// has no elements.(The length is zero.) /// The feature is not supported. /// has already been disposed of. + /// http://tizen.org/feature/vision.image_recognition /// 3 public static async Task> RecognizeAsync( MediaVisionSource source, ImageObject[] imageObjects) @@ -71,6 +72,7 @@ namespace Tizen.Multimedia.Vision /// -or-
/// has already been disposed of. /// + /// http://tizen.org/feature/vision.image_recognition /// 3 public static async Task> RecognizeAsync(MediaVisionSource source, ImageObject[] imageObjects, ImageRecognitionConfiguration config) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs index 0938b50..ef3dae6 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs @@ -46,6 +46,7 @@ namespace Tizen.Multimedia.Vision /// /// has no target. /// + /// http://tizen.org/feature/vision.image_recognition /// 3 public static async Task TrackAsync(MediaVisionSource source, ImageTrackingModel trackingModel) @@ -75,6 +76,7 @@ namespace Tizen.Multimedia.Vision /// /// has no target. /// + /// http://tizen.org/feature/vision.image_recognition /// 3 public static async Task TrackAsync(MediaVisionSource source, ImageTrackingModel trackingModel, ImageTrackingConfiguration config) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs index 52426de..3d0d3d6 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs @@ -21,6 +21,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents a configuration of . /// + /// http://tizen.org/feature/vision.image_recognition /// 3 public class ImageTrackingConfiguration : ImageRecognitionConfiguration { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs index 4ec07c9..f68770a 100644 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// /// Represents the image tracking model interface. /// + /// http://tizen.org/feature/vision.image_recognition /// 3 public class ImageTrackingModel : IDisposable { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionSource.cs b/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionSource.cs index edbccda..9712bb6 100644 --- a/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionSource.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionSource.cs @@ -25,6 +25,10 @@ namespace Tizen.Multimedia.Vision /// /// Represents the media vision source to keep information on the image or video frame data as raw buffer. /// + /// http://tizen.org/feature/vision.barcode_detection + /// http://tizen.org/feature/vision.barcode_generation + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// 3 public class MediaVisionSource : IBufferOwner, IDisposable { @@ -68,7 +72,7 @@ namespace Tizen.Multimedia.Vision /// Initializes a new instance of the class based on the . ///
/// The from which the source will be filled. - /// The feature is not supported. + /// None of the related features are not supported. /// is null. /// has already been disposed of. /// 3 @@ -105,7 +109,7 @@ namespace Tizen.Multimedia.Vision /// The height of image. /// The image . /// - /// The feature is not supported.
+ /// None of the related features are not supported.
/// -or-
/// is not supported. ///
diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs index 0f40436..c3db89e 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs @@ -21,6 +21,8 @@ namespace Tizen.Multimedia.Vision /// /// Represents a configuration of . /// + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// 3 public class MovementDetectionConfiguration : SurveillanceEngineConfiguration { @@ -32,11 +34,10 @@ namespace Tizen.Multimedia.Vision /// 3 public static readonly int DefaultThreshold = 10; - /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The required features are not supported. /// 3 public MovementDetectionConfiguration() { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs index a5d214c..27daf49 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs @@ -22,6 +22,8 @@ namespace Tizen.Multimedia.Vision /// /// Provides the ability to detect movement on image sources. /// + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// /// 3 public class MovementDetector : SurveillanceEngine @@ -34,7 +36,7 @@ namespace Tizen.Multimedia.Vision /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The required features are not supported. /// 3 public MovementDetector() : base(MovementDetectedEventType) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs index 1ab3cc2..f6e75cf 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs @@ -21,6 +21,8 @@ namespace Tizen.Multimedia.Vision /// /// Represents a configuration of instances. /// + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// 3 public class PersonAppearanceDetectionConfiguration : SurveillanceEngineConfiguration { @@ -35,7 +37,7 @@ namespace Tizen.Multimedia.Vision /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The required features are not supported. /// 3 public PersonAppearanceDetectionConfiguration() { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs index 5bac441..c985543 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs @@ -22,6 +22,8 @@ namespace Tizen.Multimedia.Vision /// /// Provides the ability to detect person appearance changes on image sources. /// + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// /// 3 public class PersonAppearanceDetector : SurveillanceEngine @@ -38,7 +40,7 @@ namespace Tizen.Multimedia.Vision /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The required features are not supported. /// 3 public PersonAppearanceDetector() : base(PersonAppearanceEventType) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs index d817324..4a28603 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs @@ -21,6 +21,8 @@ namespace Tizen.Multimedia.Vision /// /// Represents a configuration of instances. /// + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// 3 public class PersonRecognitionConfiguration : SurveillanceEngineConfiguration { @@ -31,7 +33,7 @@ namespace Tizen.Multimedia.Vision /// /// Path to the face recognition model. /// is null. - /// The feature is not supported. + /// The required features are not supported. /// 3 public PersonRecognitionConfiguration(string modelPath) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs index b9f63b2..136aa6d 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs @@ -22,6 +22,8 @@ namespace Tizen.Multimedia.Vision /// /// Provides the ability to recognize person on image sources. /// + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// /// 3 public class PersonRecognizer : SurveillanceEngine @@ -36,7 +38,7 @@ namespace Tizen.Multimedia.Vision /// /// Initializes a new instance of the class. /// - /// The feature is not supported. + /// The required features are not supported. /// 3 public PersonRecognizer() : base(PersonRecognizedEventType) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/QrConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/QrConfiguration.cs index dc30eb7..19b005d 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/QrConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/QrConfiguration.cs @@ -30,9 +30,6 @@ namespace Tizen.Multimedia.Vision /// Encoding mode for the message. /// Error correction level. /// QR code version. From 1 to 40 inclusive. - /// - /// var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30); - /// /// /// is less than 1.
/// -or-
@@ -43,6 +40,11 @@ namespace Tizen.Multimedia.Vision /// -or-
/// is invalid. ///
+ /// + /// + /// var qrConfig = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30); + /// + /// /// 3 public QrConfiguration(QrMode qrMode, ErrorCorrectionLevel ecc, int version) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/QrMode.cs b/src/Tizen.Multimedia.Vision/MediaVision/QrMode.cs index 14f5477..2054cb0 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/QrMode.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/QrMode.cs @@ -28,7 +28,7 @@ namespace Tizen.Multimedia.Vision /// 3 Numeric, /// - /// Alphanumeric characters, '$', '%', '*', '+', '-', '.', '/' and ':'. + /// Alphanumeric characters, '$', '%', '*', '+', '-', '.', '/', and ':'. /// /// 3 AlphaNumeric, diff --git a/src/Tizen.Multimedia.Vision/MediaVision/Quadrangle.cs b/src/Tizen.Multimedia.Vision/MediaVision/Quadrangle.cs index 708621c..c7c3f6a 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/Quadrangle.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/Quadrangle.cs @@ -36,7 +36,7 @@ namespace Tizen.Multimedia.Vision { if (points.Length != 4) { - throw new ArgumentException($"{points} must have 4 elements."); + throw new ArgumentException($"{nameof(points)} must have 4 elements."); } Points = points; diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs index 2758314..52af409 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs @@ -19,6 +19,8 @@ namespace Tizen.Multimedia.Vision /// /// SurveillanceEngineConfiguration is a base class for surveillance configurations. /// + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// 3 public class SurveillanceEngineConfiguration : EngineConfiguration { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs index 6b845b3..7d0f2be 100644 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs @@ -24,6 +24,8 @@ namespace Tizen.Multimedia.Vision /// 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. /// + /// http://tizen.org/feature/vision.face_recognition + /// http://tizen.org/feature/vision.image_recognition /// /// /// @@ -132,7 +134,6 @@ namespace Tizen.Multimedia.Vision UnsubscribeEventTrigger(Handle, source.StreamId).Validate("Failed to unsubscribe event trigger"); } - /// /// Releases all the resources used by the object. /// diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs index 6f5d6a1..8c2eba1 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs @@ -29,14 +29,18 @@ namespace Tizen.Multimedia.Vision 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++; } /// diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs index 67a1248..af74117 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs @@ -41,9 +41,9 @@ namespace Tizen.Network.IoTConnectivity /// http://tizen.org/feature/iot.ocf /// Thrown when the iotcon is not supported. /// Thrown when there is not enough memory. - /// + /// /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes(); - /// + /// public Attributes() { int ret = Interop.IoTConnectivity.Common.Attributes.Create(out _resourceAttributesHandle); @@ -79,12 +79,12 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The number of keys. - /// + /// /// 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); - /// + /// public int Count { get @@ -98,14 +98,14 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// Whether an attribute is readonly. - /// + /// /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { /// { "state", "ON" }, /// { "dim", 10 } /// }; /// if (attributes.IsReadOnly) /// Console.WriteLine("Read only attribute"); - /// + /// public bool IsReadOnly { get @@ -119,14 +119,14 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// All the attribute keys. - /// + /// /// 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)); - /// + /// public ICollection Keys { get @@ -140,14 +140,14 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// All the attribute values. - /// + /// /// 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)); - /// + /// public ICollection Values { get @@ -163,11 +163,11 @@ namespace Tizen.Network.IoTConnectivity /// The attribute with the specified key. /// The key of the attribute to get or set. /// The element with the specified key. - /// + /// /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes(); /// attributes["state"] = "ON"; /// Console.WriteLine("Attribute value for key 'state' : {0}", attributes["state"]); - /// + /// public object this[string key] { get @@ -190,10 +190,10 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The key value pair to add. /// http://tizen.org/feature/iot.ocf - /// ("state", "ON")); - /// ]]> + /// ]]> public void Add(KeyValuePair item) { Add(item.Key, item.Value); @@ -206,10 +206,10 @@ namespace Tizen.Network.IoTConnectivity /// The key representing the attribute. /// The value representing the attribute. /// http://tizen.org/feature/iot.ocf - /// + /// /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes(); /// attributes.Add("brightness", 50); - /// + /// public void Add(string key, object value) { int ret = 0; @@ -299,11 +299,11 @@ namespace Tizen.Network.IoTConnectivity /// http://tizen.org/feature/iot.ocf /// Thrown when the iotcon is not supported /// Thrown when the operation is invalid - /// + /// /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes(); /// attributes.Add("brightness", 50); /// attributes.Clear(); - /// + /// public void Clear() { foreach (string key in _attributes.Keys) @@ -324,14 +324,14 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The status key value pair. /// true if exists. Otherwise, false. - /// ("dim", 10)) /// Console.WriteLine("Attribute conatins pair ('dim', 10)"); - /// ]]> + /// ]]> public bool Contains(KeyValuePair item) { return _attributes.Contains(item); @@ -343,14 +343,14 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The status key to look for. /// true if exists. Otherwise, false. - /// + /// /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { /// { "state", "ON" }, /// { "dim", 10 } /// }; /// if (attributes.ContainsKey("dim")) /// Console.WriteLine("Attribute conatins key : dim"); - /// + /// public bool ContainsKey(string key) { return _attributes.ContainsKey(key); @@ -362,7 +362,7 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The destination array. /// The zero-based index in an array at which copying begins. - /// + /// ]]> public void CopyTo(KeyValuePair[] array, int arrayIndex) { _attributes.CopyTo(array, arrayIndex); @@ -382,7 +382,7 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// An enumerator that can be used to iterate through the collection. - /// + /// ]]> public IEnumerator> GetEnumerator() { return _attributes.GetEnumerator(); @@ -407,14 +407,14 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported /// Thrown when there is an invalid parameter /// Thrown when the operation is invalid - /// ("dim", 10))) /// Console.WriteLine("Remove was successful"); - /// ]]> + /// ]]> public bool Remove(KeyValuePair item) { return Remove(item.Key); @@ -430,14 +430,14 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported /// Thrown when there is an invalid parameter /// Thrown when the operation is invalid - /// + /// /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { /// { "state", "ON" }, /// { "dim", 10 } /// }; /// if (attributes.Remove("state")) /// Console.WriteLine("Remove was successful"); - /// + /// public bool Remove(string key) { int ret = Interop.IoTConnectivity.Common.Attributes.Remove(_resourceAttributesHandle, key); @@ -459,7 +459,7 @@ namespace Tizen.Network.IoTConnectivity /// The key whose value to get. /// The value associated with the specified key. /// true if the attributes collection contains an element with the specified key, otherwise, false. - /// + /// /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { /// { "state", "ON" } /// }; @@ -467,7 +467,7 @@ namespace Tizen.Network.IoTConnectivity /// var isPresent = attributes.TryGetValue("state", out value); /// if (isPresent) /// Console.WriteLine("value : {0}", value); - /// + /// public bool TryGetValue(string key, out object value) { return _attributes.TryGetValue(key, out value); diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs index 1ea02a5..5d8014b 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs @@ -87,10 +87,10 @@ namespace Tizen.Network.IoTConnectivity ///
         /// Initialize() should be called to initialize.
         /// 
- /// + /// /// IoTConnectivityClientManager.Initialize(); /// IoTConnectivityClientManager.TimeOut = 120; - /// + /// public static int TimeOut { get @@ -129,10 +129,10 @@ namespace Tizen.Network.IoTConnectivity ///
         /// Initialize() should be called to initialize.
         /// 
- /// + /// /// IoTConnectivityClientManager.Initialize(); /// IoTConnectivityClientManager.PollingInterval = 100; - /// + /// public static int PollingInterval { get @@ -179,10 +179,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when an application does not have privilege to access. - /// + /// /// string filePath = "../../res/iotcon-test-svr-db-client.dat"; /// IoTConnectivityClientManager.Initialize(filePath); - /// + /// public static void Initialize(string filePath) { int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath); @@ -205,9 +205,9 @@ namespace Tizen.Network.IoTConnectivity /// Initialize() should be called to initialize. /// /// - /// + /// /// IoTConnectivityClientManager.Deinitialize(); - /// + /// public static void Deinitialize() { s_presenceListenerId = 1; @@ -241,9 +241,9 @@ namespace Tizen.Network.IoTConnectivity /// Initialize() should be called to initialize. /// /// Thrown when the iotcon is not supported. - /// + /// /// IoTConnectivityClientManager.InvokePolling(); - /// + /// public static void InvokePolling() { int ret = Interop.IoTConnectivity.Client.IoTCon.InvokePolling(); @@ -287,7 +287,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the operation is invalid. /// Thrown when an application does not have privilege to access. /// Thrown when there is not enough memory. - /// handler = (sender, e) => { /// Console.Log("PresenceReceived, presence id :" + e.PresenceId); /// } @@ -298,7 +298,7 @@ namespace Tizen.Network.IoTConnectivity /// 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"); - /// ]]> + /// ]]> public static int StartReceivingPresence(string hostAddress, string resourceType) { Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip; @@ -384,7 +384,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the operation is invalid. /// Thrown when an application does not have privilege to access. /// Thrown when there is not enough memory. - /// handler = (sender, e) => { /// Console.Log("PresenceReceived, presence id :" + e.PresenceId); /// } @@ -399,7 +399,7 @@ namespace Tizen.Network.IoTConnectivity /// IoTConnectivityClientManager.PresenceReceived -= handler; /// IoTConnectivityClientManager.FindingErrorOccurred -= errorHandler; /// IoTConnectivityClientManager.StopReceivingPresence(id); - /// ]]> + /// ]]> public static void StopReceivingPresence(int presenceId) { if (!s_presenceHandlesMap.ContainsKey((IntPtr)presenceId)) @@ -438,12 +438,9 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// - /// Sends request to find a resource of server with . + /// Sends request to find a resource of server with . /// If succeeded, event handler will be triggered with information of the resource. - /// could be for the IPv4 multicast. - /// The length of should be less than or equal to 61. The must start - /// with a lowercase alphabetic character, followed by a sequence - /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space. + /// could be for the IPv4 multicast. /// /// http://tizen.org/privilege/internet /// public @@ -462,7 +459,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the operation is invalid. /// Thrown when an application does not have privilege to access. /// Thrown when there is not enough memory. - /// handler = (sender, e) => { /// Console.Log("Found resource at host address :" + e.Resource.HostAddress + ", uri :" + e.Resource.UriPath); /// } @@ -475,7 +472,7 @@ namespace Tizen.Network.IoTConnectivity /// 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); - /// ]]> + /// ]]> public static int StartFindingResource(string hostAddress, ResourceQuery query = null) { Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip; @@ -573,7 +570,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the operation is invalid. /// Thrown when an application does not have privilege to access. /// Thrown when there is not enough memory. - /// handler = (sender, e) => { /// Console.Log("Device information found, id : " + e.RequestId + ", name : " + e.Name); /// } @@ -584,7 +581,7 @@ namespace Tizen.Network.IoTConnectivity /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler; /// // Do not forget to remove these event handlers when they are not required any more. /// int id = IoTConnectivityClientManager.StartFindingDeviceInformation(IoTConnectivityClientManager.MulticastAddress); - /// ]]> + /// ]]> public static int StartFindingDeviceInformation(string hostAddress, ResourceQuery query = null) { Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip; @@ -673,7 +670,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the operation is invalid. /// Thrown when an application does not have privilege to access. /// Thrown when there is not enough memory. - /// handler = (sender, e) => { /// Console.Log("PlatformInformationFound :" + e.RequestId); /// } @@ -684,7 +681,7 @@ namespace Tizen.Network.IoTConnectivity /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler; /// // Do not forget to remove these event handlers when they are not required any more. /// int id = IoTConnectivityClientManager.StartFindingPlatformInformation(IoTConnectivityClientManager.MulticastAddress); - /// ]]> + /// ]]> public static int StartFindingPlatformInformation(string hostAddress, ResourceQuery query = null) { Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip; diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs index 6313cbc..0bfed80 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs @@ -49,10 +49,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when an application does not have privilege to access - /// + /// /// string filePath = "../../res/iotcon-test-svr-db-server.dat"; /// IoTConnectivityServerManager.Initialize(filePath); - /// + /// public static void Initialize(string filePath) { int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath); @@ -75,9 +75,9 @@ namespace Tizen.Network.IoTConnectivity /// Initialize() should be called to initialize. /// /// - /// + /// /// IoTConnectivityServerManager.Deinitialize(); - /// + /// public static void Deinitialize() { _resources.Clear(); @@ -105,7 +105,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the operation is invalid. /// Thrown when there is not enough memory. /// Thrown when an application does not have privilege to access. - /// (){ "org.tizen.light" }); /// Attributes attributes = new Attributes { { "state", "ON" }}; /// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes); @@ -114,7 +114,7 @@ namespace Tizen.Network.IoTConnectivity /// } catch(Exception ex) { /// Console.Log("Exception caught : " + ex.Message); /// } - /// ]]> + /// ]]> public static void RegisterResource(Resource resource) { Log.Info(IoTConnectivityErrorFactory.LogTag, "..."); @@ -172,7 +172,7 @@ namespace Tizen.Network.IoTConnectivity /// /// Thrown when the iotcon is not supported. /// Thrown when an application does not have privilege to access. - /// (){ "org.tizen.light" }); /// Attributes attributes = new Attributes { { "state", "ON" }}; /// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes); @@ -182,7 +182,7 @@ namespace Tizen.Network.IoTConnectivity /// } catch(Exception ex) { /// Console.Log("Exception caught : " + ex.Message); /// } - /// ]]> + /// ]]> public static void UnregisterResource(Resource resource) { if (resource != null) @@ -221,13 +221,13 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when the operation is invalid. /// Thrown when an application does not have privilege to access. - /// + /// /// try { /// IoTConnectivityServerManager.StartSendingPresence(120); /// } catch(Exception ex) { /// Console.Log("Exception caught : " + ex.Message); /// } - /// + /// public static void StartSendingPresence(uint time) { int ret = Interop.IoTConnectivity.Server.IoTCon.StartPresence(time); @@ -259,9 +259,9 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when the operation is invalid. /// Thrown when an application does not have privilege to access. - /// + /// /// IoTConnectivityServerManager.StopSendingPresence(); - /// + /// public static void StopSendingPresence() { int ret = Interop.IoTConnectivity.Server.IoTCon.StopPresence(); @@ -288,9 +288,9 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when the operation is invalid. /// Thrown when an application does not have privilege to access. - /// + /// /// IoTConnectivityServerManager.SetDeviceName("my-tizen"); - /// + /// public static void SetDeviceName(string deviceName) { int ret = Interop.IoTConnectivity.Server.IoTCon.SetDeviceName(deviceName); diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs index 34d0418..4627871 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs @@ -49,13 +49,13 @@ namespace Tizen.Network.IoTConnectivity /// /// /// - /// list = new List() { "org.tizen.light" }; /// Attributes attributes = new Attributes() { /// { "state", "ON" } /// }; /// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable, attributes); - /// ]]> + /// ]]> public LiteResource(string uri, ResourceTypes types, ResourcePolicy policy, Attributes attribs = null) : base(uri, types, new ResourceInterfaces(new string[] { ResourceInterfaces.DefaultInterface }), policy) { @@ -67,7 +67,7 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The attributes of the lite resource. - /// list = new List() { "org.tizen.light" }; /// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable); /// Attributes attributes = new Attributes() { @@ -78,7 +78,7 @@ namespace Tizen.Network.IoTConnectivity /// { /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); /// } - /// ]]> + /// ]]> public Attributes Attributes { get; set; } /// @@ -90,7 +90,7 @@ namespace Tizen.Network.IoTConnectivity /// /// The new attributes of the lite resource. /// true to accept post request, false to reject it. - /// + /// /// public class MyLightResource : LiteResource /// { /// protected override bool OnPost(Attributes attributes) @@ -102,7 +102,7 @@ namespace Tizen.Network.IoTConnectivity /// return false; /// } /// } - /// + /// protected virtual bool OnPost(Attributes attribs) { return true; diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs index 0e60112..31bd4d5 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs @@ -42,9 +42,9 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is not enough memory. /// Thrown when there is an invalid parameter. - /// + /// /// Representation repr = new Representation(); - /// + /// public Representation() { int ret = Interop.IoTConnectivity.Common.Representation.Create(out _representationHandle); @@ -93,11 +93,11 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// + /// /// Representation repr = new Representation(); /// repr.UriPath = "/a/light"; /// Console.WriteLine("URI is {0}", repr.UriPath); //Getter - /// + /// public string UriPath { get @@ -133,7 +133,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// (){ "org.tizen.light" }); /// repr.Type = types; @@ -142,7 +142,7 @@ namespace Tizen.Network.IoTConnectivity /// { /// Console.WriteLine("Type is {0}", item); /// } - /// ]]> + /// ]]> public ResourceTypes Type { get @@ -178,7 +178,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// (){ ResourceInterfaces.DefaultInterface }); /// repr.Interface = ifaces; @@ -187,7 +187,7 @@ namespace Tizen.Network.IoTConnectivity /// { /// Console.WriteLine("Interface is {0}", iface); /// } - /// ]]> + /// ]]> public ResourceInterfaces Interface { get @@ -223,7 +223,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// + /// /// Representation repr = new Representation(); /// Attributes attributes = new Attributes() { /// { "state", "ON" }, @@ -234,7 +234,7 @@ namespace Tizen.Network.IoTConnectivity /// string strval = newAttributes["state"] as string; /// int intval = (int)newAttributes["dim"]; /// Console.WriteLine("attributes are {0} and {1}", strval, intval); - /// + /// public Attributes Attributes { get @@ -268,7 +268,7 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// List of Child resource representation. - /// () { "org.tizen.light" }); @@ -284,7 +284,7 @@ namespace Tizen.Network.IoTConnectivity /// { /// Console.WriteLine("Exception caught : " + ex.Message); /// } - /// ]]> + /// ]]> public ICollection Children { get diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs index 3369eff..20e5c76 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs @@ -57,7 +57,7 @@ namespace Tizen.Network.IoTConnectivity /// /// Thrown when the iotcon is not supported. /// Thrown when there is not enough memory. - /// (){ ResourceInterfaces.DefaultInterface }); /// ResourceTypes types = new ResourceTypes(new List(){ "oic.iot.door.new" }); /// Resource resource = new DoorResource("/door/uri1", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable); - /// ]]> + /// ]]> protected Resource(string uri, ResourceTypes types, ResourceInterfaces interfaces, ResourcePolicy policy) { UriPath = uri; @@ -173,7 +173,7 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when an application does not have privilege to access. /// Thrown when the operation is invalid. - /// (){ ResourceInterfaces.DefaultInterface }); /// ResourceTypes types = new ResourceTypes(new List(){ "oic.iot.door.new.notify" }); /// Resource resource = new DoorResource("/door/uri/new/notify", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable); @@ -186,7 +186,7 @@ namespace Tizen.Network.IoTConnectivity /// _attribute, 1 } /// }; /// resource.Notify(repr, QualityOfService.High); - /// ]]> + /// ]]> public void Notify(Representation representation, QualityOfService qos) { int ret = (int)IoTConnectivityError.None; diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs index 2cbaef2..b0dca2a 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs @@ -73,9 +73,9 @@ namespace Tizen.Network.IoTConnectivity /// /// Thrown when the iotcon is not supported. /// Thrown when there is not enough memory. - /// + /// /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(); - /// + /// public ResourceInterfaces() { int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle); @@ -95,10 +95,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is not enough memory. /// Thrown when there is an invalid parameter. - /// () /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); - /// ]]> + /// ]]> public ResourceInterfaces(IEnumerable ifaces) { int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle); @@ -157,11 +157,11 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// Count of interfaces in the list. - /// () /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); /// Console.WriteLine("There are {0} interfaces", resourceInterfaces.Count); - /// ]]> + /// ]]> public int Count { get @@ -183,10 +183,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when the operation is invalid. /// Thrown when there is an invalid parameter. - /// + /// /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(); /// resourceInterfaces.Add(ResourceInterfaces.BatchInterface); - /// + /// public void Add(string item) { if (IsValid(item)) @@ -216,10 +216,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// (){ ResourceInterfaces.BatchInterface }); /// resourceInterfaces.Add(ResourceInterfaces.BatchInterface); - /// ]]> + /// ]]> public void Remove(string item) { bool isRemoved = _resourceInterfaces.Remove(item); @@ -241,14 +241,14 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The enumerator. - /// () /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); /// foreach(string item in resourceInterfaces) /// { /// Console.WriteLine("Interface : {0}", item); /// } - /// ]]> + /// ]]> public IEnumerator GetEnumerator() { return _resourceInterfaces.GetEnumerator(); @@ -259,14 +259,14 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The enumerator. - /// () /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); /// foreach(string item in resourceInterfaces) /// { /// Console.WriteLine("Interface : {0}", item); /// } - /// ]]> + /// ]]> IEnumerator IEnumerable.GetEnumerator() { return _resourceInterfaces.GetEnumerator(); diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs index d5aad1d..23279a7 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs @@ -48,9 +48,9 @@ namespace Tizen.Network.IoTConnectivity /// /// Thrown when the iotcon is not supported. /// Thrown when there is not enough memory. - /// + /// /// ResourceOptions options = new ResourceOptions(); - /// + /// public ResourceOptions() { int ret = Interop.IoTConnectivity.Common.Options.Create(out _resourceOptionsHandle); @@ -98,13 +98,13 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// All the Option keys. - /// + /// /// 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)); - /// + /// public ICollection Keys { get @@ -118,13 +118,13 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// All the Option values. - /// + /// /// 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)); - /// + /// public ICollection Values { get @@ -138,13 +138,13 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The number of options. - /// + /// /// 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); - /// + /// public int Count { get @@ -158,11 +158,11 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// Whether the collection is readonly. - /// + /// /// ResourceOptions options = new ResourceOptions(); /// if (options.IsReadOnly) /// Console.WriteLine("Read only options"); - /// + /// public bool IsReadOnly { get @@ -178,11 +178,11 @@ namespace Tizen.Network.IoTConnectivity /// The option data. /// The option ID to get or set. /// The option with the specified ID. - /// + /// /// ResourceOptions options = new ResourceOptions(); /// options[2055] = "sample-data"; /// Console.WriteLine("Option has : {0}", options[2055]); - /// + /// public string this[ushort key] { get @@ -201,12 +201,12 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The key to look for. /// true if exists. Otherwise, false. - /// + /// /// ResourceOptions options = new ResourceOptions(); /// options.Add(2050, "sample-data"); /// if (options.ContainsKey(2050)) /// Console.WriteLine("options conatins key : 2050"); - /// + /// public bool ContainsKey(ushort key) { return _options.ContainsKey(key); @@ -227,10 +227,10 @@ namespace Tizen.Network.IoTConnectivity /// /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. - /// + /// /// ResourceOptions options = new ResourceOptions(); /// options.Add(2050, "sample-data"); - /// + /// public void Add(ushort key, string value) { int ret = (int)IoTConnectivityError.InvalidParameter; @@ -261,11 +261,11 @@ namespace Tizen.Network.IoTConnectivity /// /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. - /// + /// /// ResourceOptions options = new ResourceOptions(); /// options.Add(2050, "12345"); /// var result = options.Remove(2050); - /// + /// public bool Remove(ushort key) { int ret = Interop.IoTConnectivity.Common.Options.Remove(_resourceOptionsHandle, key); @@ -287,14 +287,14 @@ namespace Tizen.Network.IoTConnectivity /// The option ID. /// Value corresponding to option ID. /// True if the key exists, false otherwise. - /// + /// /// ResourceOptions options = new ResourceOptions(); /// options.Add(2050, "12345"); /// string value; /// var isPresent = options.TryGetValue(2050, out value); /// if (isPresent) /// Console.WriteLine("value : {0}", value); - /// + /// public bool TryGetValue(ushort key, out string value) { return _options.TryGetValue(key, out value); @@ -307,10 +307,10 @@ namespace Tizen.Network.IoTConnectivity /// The key value pair. /// http://tizen.org/feature/iot.ocf /// - /// (2050, "12345")); - /// ]]> + /// ]]> public void Add(KeyValuePair item) { Add(item.Key, item.Value); @@ -322,12 +322,12 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// http://tizen.org/feature/iot.ocf /// Thrown when the iotcon is not supported. - /// + /// /// ResourceOptions options = new ResourceOptions(); /// options.Add(2050, "12345"); /// options.Add(2055, "sample"); /// options.Clear(); - /// + /// public void Clear() { foreach (ushort key in Keys) @@ -348,13 +348,13 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The key value pair. /// True if exists. Otherwise, false. - /// (2050, "12345")); /// var isPresent = options.Contains(new KeyValuePair(2050, "12345")); /// if (isPresent) /// Console.WriteLine("Key value pair is present"); - /// ]]> + /// ]]> public bool Contains(KeyValuePair item) { return _options.Contains(item); @@ -366,13 +366,13 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The destination array. /// Index parameter. - /// (2050, "12345")); /// KeyValuePair[] dest = new KeyValuePair[options.Count]; /// options.CopyTo(dest, 0); /// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value); - /// ]]> + /// ]]> public void CopyTo(KeyValuePair[] array, int arrayIndex) { _options.CopyTo(array, arrayIndex); @@ -387,11 +387,11 @@ namespace Tizen.Network.IoTConnectivity /// http://tizen.org/feature/iot.ocf /// /// Thrown when there is an invalid parameter - /// (2050, "12345")); /// var result = options.Remove(new KeyValuePair(2050, "12345")); - /// ]]> + /// ]]> public bool Remove(KeyValuePair item) { return Remove(item.Key); @@ -402,7 +402,7 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// Enumerator to option pairs. - /// (2050, "sample1")); /// options.Add(new KeyValuePair(2055, "sample2")); @@ -410,7 +410,7 @@ namespace Tizen.Network.IoTConnectivity /// { /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); /// } - /// ]]> + /// ]]> public IEnumerator> GetEnumerator() { return _options.GetEnumerator(); @@ -432,7 +432,7 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// Enumerator to option pairs. - /// (2050, "sample1")); /// options.Add(new KeyValuePair(2055, "sample2")); @@ -440,7 +440,7 @@ namespace Tizen.Network.IoTConnectivity /// { /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); /// } - /// ]]> + /// ]]> IEnumerator IEnumerable.GetEnumerator() { return _options.GetEnumerator(); diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs index 1f1a478..5e3dde2 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs @@ -42,9 +42,9 @@ namespace Tizen.Network.IoTConnectivity /// /// Thrown when the iotcon is not supported. /// Thrown when there is not enough memory. - /// + /// /// ResourceQuery query = new ResourceQuery(); - /// + /// public ResourceQuery() { int ret = Interop.IoTConnectivity.Common.Query.Create(out _resourceQueryHandle); @@ -94,11 +94,11 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// query.Type = "org.tizen.light"; /// Console.WriteLine("Type of query : {0}", query.Type); - /// + /// public string Type { get @@ -137,10 +137,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// query.Interface = ResourceInterfaces.LinkInterface; - /// + /// public string Interface { get @@ -173,13 +173,13 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// All the query keys. - /// + /// /// 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)); - /// + /// public ICollection Keys { get @@ -193,13 +193,13 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// All the query values. - /// + /// /// 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)); - /// + /// public ICollection Values { get @@ -213,13 +213,13 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The number of query elements. - /// + /// /// 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); - /// + /// public int Count { get @@ -233,11 +233,11 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// Whether the collection is readonly. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// if (query.IsReadOnly) /// Console.WriteLine("Read only query"); - /// + /// public bool IsReadOnly { get @@ -253,11 +253,11 @@ namespace Tizen.Network.IoTConnectivity /// The query data. /// The query key to get or set. /// The query with the specified key. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// query["key1"] = "sample-data"; /// Console.WriteLine("query has : {0}", query["key1"]); - /// + /// public string this[string key] { get @@ -277,12 +277,12 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The key to look for. /// true if exists. Otherwise, false. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// query.Add("key1", "value1"); /// if (query.ContainsKey("key1")) /// Console.WriteLine("query conatins key : key1"); - /// + /// public bool ContainsKey(string key) { return _query.ContainsKey(key); @@ -302,10 +302,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// query.Add("key1", "value1"); - /// + /// public void Add(string key, string value) { if (CanAddQuery(key, value)) @@ -336,11 +336,11 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// query.Add("key1", "value1"); /// var result = query.Remove("key1"); - /// + /// public bool Remove(string key) { int ret = Interop.IoTConnectivity.Common.Query.Remove(_resourceQueryHandle, key); @@ -362,14 +362,14 @@ namespace Tizen.Network.IoTConnectivity /// The query key. /// Value corresponding to query key. /// True if the key exists, false otherwise. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// query.Add("key1", "value1"); /// string value; /// var isPresent = query.TryGetValue("key1", out value); /// if (isPresent) /// Console.WriteLine("value : {0}", value); - /// + /// public bool TryGetValue(string key, out string value) { return _query.TryGetValue(key, out value); @@ -382,10 +382,10 @@ namespace Tizen.Network.IoTConnectivity /// The key value pair. /// http://tizen.org/feature/iot.ocf /// - /// ("key1", "value1")); - /// ]]> + /// ]]> public void Add(KeyValuePair item) { Add(item.Key, item.Value); @@ -398,12 +398,12 @@ namespace Tizen.Network.IoTConnectivity /// http://tizen.org/feature/iot.ocf /// Thrown when the iotcon is not supported. /// Thrown when the operation is invalid. - /// + /// /// ResourceQuery query = new ResourceQuery(); /// query.Add("key1", "value1"); /// query.Add("key2", "value2"); /// query.Clear(); - /// + /// public void Clear() { foreach (string key in _query.Keys) @@ -424,13 +424,13 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The key value pair. /// True if exists. Otherwise, false. - /// ("key1", "value1")); /// var isPresent = query.Contains(new KeyValuePair("key1", "value1")); /// if (isPresent) /// Console.WriteLine("Key value pair is present"); - /// ]]> + /// ]]> public bool Contains(KeyValuePair item) { return _query.Contains(item); @@ -442,13 +442,13 @@ namespace Tizen.Network.IoTConnectivity /// 3 /// The destination array. /// Index parameter. - /// ("key1", "value1")); /// KeyValuePair[] dest = new KeyValuePair[query.Count]; /// query.CopyTo(dest, 0); /// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value); - /// ]]> + /// ]]> public void CopyTo(KeyValuePair[] array, int arrayIndex) { _query.CopyTo(array, arrayIndex); @@ -463,11 +463,11 @@ namespace Tizen.Network.IoTConnectivity /// http://tizen.org/feature/iot.ocf /// /// Thrown when there is an invalid parameter. - /// ("key1", "value1")); /// var result = query.Remove(new KeyValuePair("key1", "value1")); - /// ]]> + /// ]]> public bool Remove(KeyValuePair item) { return Remove(item.Key); @@ -478,7 +478,7 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// Enumerator to query pairs. - /// ("key1", "value1")); /// query.Add(new KeyValuePair("key2", "value2")); @@ -486,7 +486,7 @@ namespace Tizen.Network.IoTConnectivity /// { /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); /// } - /// ]]> + /// ]]> public IEnumerator> GetEnumerator() { return _query.GetEnumerator(); @@ -497,7 +497,7 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The enumerator to the query pairs. - /// ("key1", "value1")); /// query.Add(new KeyValuePair("key2", "value2")); @@ -505,7 +505,7 @@ namespace Tizen.Network.IoTConnectivity /// { /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); /// } - /// ]]> + /// ]]> IEnumerator IEnumerable.GetEnumerator() { return _query.GetEnumerator(); diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs index f0f2c7f..1896217 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs @@ -43,9 +43,9 @@ namespace Tizen.Network.IoTConnectivity /// /// Thrown when the iotcon is not supported. /// Thrown when there is not enough memory. - /// + /// /// ResourceTypes types = new ResourceTypes(); - /// + /// public ResourceTypes() { int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle); @@ -63,9 +63,9 @@ namespace Tizen.Network.IoTConnectivity /// List of resource types. /// http://tizen.org/feature/iot.ocf /// Thrown when there is an invalid parameter. - /// () { "org.tizen.light", "oic.if.room" }); - /// ]]> + /// ]]> public ResourceTypes(IEnumerable types) { int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle); @@ -117,10 +117,10 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// Count of types in the list. - /// () { "org.tizen.light", "oic.if.room" }); /// Console.WriteLine("There are {0} items", types.Count); - /// ]]> + /// ]]> public int Count { get @@ -145,10 +145,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// + /// /// ResourceTypes resourceTypes = new ResourceTypes(); /// resourceTypes.Add("org.tizen.light"); - /// + /// public void Add(string item) { if (IsValid(item)) @@ -178,10 +178,10 @@ namespace Tizen.Network.IoTConnectivity /// Thrown when the iotcon is not supported. /// Thrown when there is an invalid parameter. /// Thrown when the operation is invalid. - /// () { "org.tizen.light", "oic.if.room" }); /// resourceTypes.Remove("oic.if.room"); - /// ]]> + /// ]]> public void Remove(string item) { int ret = Interop.IoTConnectivity.Common.ResourceTypes.Remove(_resourceTypeHandle, item); @@ -199,13 +199,13 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The enumerator. - /// () { "org.tizen.light", "oic.if.room" }); /// foreach(string item in resourceTypes) /// { /// Console.WriteLine("Type : {0}", item); /// } - /// ]]> + /// ]]> public IEnumerator GetEnumerator() { return _resourceTypes.GetEnumerator(); @@ -216,13 +216,13 @@ namespace Tizen.Network.IoTConnectivity /// /// 3 /// The enumerator. - /// () { "org.tizen.light", "oic.if.room" }); /// foreach(string item in resourceTypes) /// { /// Console.WriteLine("Type : {0}", item); /// } - /// ]]> + /// ]]> IEnumerator IEnumerable.GetEnumerator() { return _resourceTypes.GetEnumerator(); diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs index ce8306e..eacb675 100755 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs +++ b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs @@ -32,9 +32,9 @@ namespace Tizen.Network.IoTConnectivity /// Constructor of Response. /// /// 3 - /// + /// /// Response response = new Response(); - /// + /// public Response() { } /// diff --git a/src/Tizen.System.Feedback/Feedback/Feedback.cs b/src/Tizen.System.Feedback/Feedback/Feedback.cs old mode 100644 new mode 100755 index 7fa3669..00deff3 --- a/src/Tizen.System.Feedback/Feedback/Feedback.cs +++ b/src/Tizen.System.Feedback/Feedback/Feedback.cs @@ -77,10 +77,12 @@ namespace Tizen.System /// http://tizen.org/privilege/haptic /// For controlling the sound, privilege is not needed. /// + /// /// /// Feedback feedback = new Feedback(); /// bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap"); /// + /// public class Feedback { private const string LogTag = "Tizen.System.Feedback"; diff --git a/src/Tizen.System.Usb/Interop/Interop.Configuration.cs b/src/Tizen.System.Usb/Interop/Interop.Configuration.cs index 9bf5d8f..6f2d34c 100644 --- a/src/Tizen.System.Usb/Interop/Interop.Configuration.cs +++ b/src/Tizen.System.Usb/Interop/Interop.Configuration.cs @@ -43,12 +43,12 @@ internal static partial class Interop 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 diff --git a/src/Tizen.System.Usb/Interop/Interop.Context.cs b/src/Tizen.System.Usb/Interop/Interop.Context.cs index 52a2c7e..4750414 100644 --- a/src/Tizen.System.Usb/Interop/Interop.Context.cs +++ b/src/Tizen.System.Usb/Interop/Interop.Context.cs @@ -34,9 +34,6 @@ internal static partial class Interop [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); @@ -51,7 +48,7 @@ internal static partial class Interop 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); @@ -68,7 +65,7 @@ internal static partial class Interop 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 GetDeviceList() @@ -96,9 +93,15 @@ internal static partial class Interop } } - 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"); + } } } diff --git a/src/Tizen.System.Usb/Interop/Interop.Device.cs b/src/Tizen.System.Usb/Interop/Interop.Device.cs index e5f8c28..613c1e7 100644 --- a/src/Tizen.System.Usb/Interop/Interop.Device.cs +++ b/src/Tizen.System.Usb/Interop/Interop.Device.cs @@ -31,7 +31,7 @@ internal static partial class Interop 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); diff --git a/src/Tizen.System.Usb/Interop/Interop.Endpoint.cs b/src/Tizen.System.Usb/Interop/Interop.Endpoint.cs index 65536e7..3cd2353 100644 --- a/src/Tizen.System.Usb/Interop/Interop.Endpoint.cs +++ b/src/Tizen.System.Usb/Interop/Interop.Endpoint.cs @@ -73,9 +73,9 @@ internal static partial class Interop [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 diff --git a/src/Tizen.System.Usb/Interop/Interop.ErrorCode.cs b/src/Tizen.System.Usb/Interop/Interop.ErrorCode.cs index 973dc9d..38d9ee2 100644 --- a/src/Tizen.System.Usb/Interop/Interop.ErrorCode.cs +++ b/src/Tizen.System.Usb/Interop/Interop.ErrorCode.cs @@ -114,4 +114,4 @@ internal static class ErrorCodeExtensions default: return new InvalidOperationException(errMessage); } } -} \ No newline at end of file +} diff --git a/src/Tizen.System.Usb/Interop/Interop.Interface.cs b/src/Tizen.System.Usb/Interop/Interop.Interface.cs index 5cae2f3..22727dd 100644 --- a/src/Tizen.System.Usb/Interop/Interop.Interface.cs +++ b/src/Tizen.System.Usb/Interop/Interop.Interface.cs @@ -42,9 +42,9 @@ internal static partial class Interop 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 diff --git a/src/Tizen.System.Usb/Usb/UsbDevice.cs b/src/Tizen.System.Usb/Usb/UsbDevice.cs index 8f8fe4a..faf882a 100644 --- a/src/Tizen.System.Usb/Usb/UsbDevice.cs +++ b/src/Tizen.System.Usb/Usb/UsbDevice.cs @@ -27,12 +27,20 @@ namespace Tizen.System.Usb { internal readonly Interop.HostDeviceHandle _handle; private readonly UsbManager _parent; - private Dictionary _configurations; + private Dictionary _configurations = new Dictionary(); internal UsbDevice(UsbManager parent, Interop.HostDeviceHandle handle) { _parent = parent; _handle = handle; + + int count = Interop.NativeGet(_handle.GetNumConfigurations); + for (int i = 0; i < count; ++i) + { + Interop.UsbConfigHandle configHandle; + _handle.GetConfig(i, out configHandle); + _configurations.Add(i, new UsbConfiguration(this, configHandle)); + } } /// @@ -117,17 +125,6 @@ namespace Tizen.System.Usb get { ThrowIfDisposed(); - if (_configurations == null) - { - _configurations = new Dictionary(); - int count = Interop.NativeGet(_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; } } @@ -177,7 +174,7 @@ namespace Tizen.System.Usb 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() diff --git a/src/Tizen.System.Usb/Usb/UsbInterface.cs b/src/Tizen.System.Usb/Usb/UsbInterface.cs index 04a9d48..80e77e2 100755 --- a/src/Tizen.System.Usb/Usb/UsbInterface.cs +++ b/src/Tizen.System.Usb/Usb/UsbInterface.cs @@ -14,8 +14,8 @@ * limitations under the License. */ -using System.Collections.Generic; using System; +using System.Collections.Generic; namespace Tizen.System.Usb { diff --git a/src/Tizen.System.Usb/Usb/UsbManager.cs b/src/Tizen.System.Usb/Usb/UsbManager.cs index aba4987..f539174 100644 --- a/src/Tizen.System.Usb/Usb/UsbManager.cs +++ b/src/Tizen.System.Usb/Usb/UsbManager.cs @@ -25,8 +25,8 @@ namespace Tizen.System.Usb /// 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 _devices = new List(); /// @@ -98,8 +98,8 @@ namespace Tizen.System.Usb { if (!disposedValue) { - _hotpluggedHandle.UnsetHotplugCb(); - _context.Dispose(); + if (_hotpluggedHandle != null) _hotpluggedHandle.Dispose(); + if (_context != null) _context.Dispose(); disposedValue = true; } } diff --git a/src/Tizen.System/Device/Battery.cs b/src/Tizen.System/Device/Battery.cs old mode 100644 new mode 100755 index 48ad66b..a81bc6b --- a/src/Tizen.System/Device/Battery.cs +++ b/src/Tizen.System/Device/Battery.cs @@ -133,6 +133,7 @@ namespace Tizen.System /// CapacityChanged is triggered when the battery charge percentage is changed. /// /// 3 + /// /// /// public static async Task BatteryEventHandler() /// { @@ -143,8 +144,9 @@ namespace Tizen.System /// } /// Battery.PercentChanged += handler; /// await Task.Delay(20000); - /// } + /// } /// + /// public static event EventHandler PercentChanged { add @@ -177,6 +179,7 @@ namespace Tizen.System /// LevelChanged is triggered when the battery level is changed. /// /// 3 + /// /// /// public static async Task BatteryEventHandler() /// { @@ -187,8 +190,9 @@ namespace Tizen.System /// } /// Battery.LevelChanged += handler; /// await Task.Delay(20000); - /// } + /// } /// + /// public static event EventHandler LevelChanged { add @@ -221,6 +225,7 @@ namespace Tizen.System /// This event is triggered when the charger is connected/disconnected. /// /// 3 + /// /// /// public static async Task BatteryEventHandler() /// { @@ -231,8 +236,9 @@ namespace Tizen.System /// } /// Battery.ChargingStateChanged += handler; /// await Task.Delay(20000); - /// } + /// } /// + /// public static event EventHandler ChargingStateChanged { add diff --git a/src/Tizen.System/Device/Display.cs b/src/Tizen.System/Device/Display.cs old mode 100644 new mode 100755 index 3b051c3..4533185 --- a/src/Tizen.System/Device/Display.cs +++ b/src/Tizen.System/Device/Display.cs @@ -54,10 +54,12 @@ namespace Tizen.System /// /// http://tizen.org/privilege/display /// + /// /// /// Console.WriteLine("Display current state is: {0}", Tizen.System.Display.State); /// Console.WriteLine("Total number of Displays are: {0}", Tizen.System.Display.NumberOfDisplays); /// + /// public class Display { private readonly int _displayId; @@ -115,10 +117,12 @@ namespace Tizen.System /// The maximum brightness value that can be set for the specific display. /// /// 3 + /// /// /// Display display = Display.Displays[0]; /// Console.WriteLine("Display MaxBrightness is: {0}", display.MaxBrightness); /// + /// public int MaxBrightness { get @@ -142,10 +146,12 @@ namespace Tizen.System /// 3 /// When an invalid parameter value is set. /// If the privilege is not set. + /// /// /// Display display = Display.Displays[0]; /// Console.WriteLine("Display current Brightness is: {0}", display.Brightness); /// + /// public int Brightness { get @@ -191,6 +197,7 @@ namespace Tizen.System /// StateChanged is raised when the state of the display is changed. /// /// 3 + /// /// /// public static async Task DisplayEventHandler() /// { @@ -201,8 +208,9 @@ namespace Tizen.System /// } /// Battery.StateChanged += handler; /// await Task.Delay(20000); - /// } + /// } /// + /// public static event EventHandler StateChanged { add diff --git a/src/Tizen.System/Device/Haptic.cs b/src/Tizen.System/Device/Haptic.cs old mode 100644 new mode 100755 index 7b1fd87..38374df --- a/src/Tizen.System/Device/Haptic.cs +++ b/src/Tizen.System/Device/Haptic.cs @@ -29,9 +29,11 @@ namespace Tizen.System /// /// http://tizen.org/privilege/haptic /// + /// /// /// Console.WriteLine("Total number of Vibrators are: {0}", Tizen.System.Vibrator.NumberOfVibrators); /// + /// public class Vibrator : IDisposable { private readonly int _vibratorId; @@ -118,6 +120,7 @@ namespace Tizen.System /// If the privilege is not set. /// In case of any system error. /// In case the device does not support this behavior. + /// /// /// Vibrator vibrator = Vibrator.Vibrators[0]; /// try @@ -128,6 +131,7 @@ namespace Tizen.System /// { /// } /// + /// public void Vibrate(int duration, int feedback) { @@ -157,6 +161,7 @@ namespace Tizen.System /// If the privilege is not set. /// In case of any system error. /// In case the device does not support this behavior. + /// /// /// Vibrator vibrator = Vibrator.Vibrators[0]; /// try @@ -167,6 +172,7 @@ namespace Tizen.System /// { /// } /// + /// public void Stop() { if (_hapticHandle != IntPtr.Zero) diff --git a/src/Tizen.System/Device/IR.cs b/src/Tizen.System/Device/IR.cs old mode 100644 new mode 100755 index d8e79d4..efd8664 --- a/src/Tizen.System/Device/IR.cs +++ b/src/Tizen.System/Device/IR.cs @@ -27,9 +27,11 @@ namespace Tizen.System /// /// http://tizen.org/privilege/use_ir /// + /// /// /// Console.WriteLine("IR availability for this device is: {0}", IR.IsAvailable); /// + /// public static class IR { /// @@ -64,6 +66,7 @@ namespace Tizen.System /// If the privilege is not set. /// In case of any system error. /// In case the device does not support this behavior. + /// /// /// try /// { @@ -76,6 +79,7 @@ namespace Tizen.System /// { /// } /// + /// public static void Transmit(int carrierFreequency, IList pattern) { int[] patternArray = pattern.ToArray(); diff --git a/src/Tizen.System/Device/Led.cs b/src/Tizen.System/Device/Led.cs old mode 100644 new mode 100755 index 7d00ca8..bcc0d2f --- a/src/Tizen.System/Device/Led.cs +++ b/src/Tizen.System/Device/Led.cs @@ -34,10 +34,12 @@ namespace Tizen.System /// /// http://tizen.org/privilege/led /// + /// /// /// Console.WriteLine("Led MaxBrightness is: {0}", Tizen.System.Led.MaxBrightness); /// Console.WriteLine("Led current Brightness is: {0}", Tizen.System.Led.Brightness); /// + /// public static class Led { /// @@ -73,11 +75,13 @@ namespace Tizen.System /// When an invalid parameter value is set. /// If the privilege is not set. /// In case the device does not support this behavior. + /// /// /// 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); /// + /// public static int Brightness { @@ -115,6 +119,7 @@ namespace Tizen.System /// If the privilege is not set. /// In case of any system error. /// In case the device does not support this behavior. + /// /// /// try /// { @@ -124,6 +129,7 @@ namespace Tizen.System /// { /// } /// + /// public static void Play(int on, int off, Color color) { //looks like only blink option is supported. So hard coded to default blink option. @@ -141,6 +147,7 @@ namespace Tizen.System /// If the privilege is not set. /// In case of any system error. /// In case the device does not support this behavior. + /// /// /// try /// { @@ -152,6 +159,7 @@ namespace Tizen.System /// { /// } /// + /// public static void Stop() { diff --git a/src/Tizen.System/Device/Power.cs b/src/Tizen.System/Device/Power.cs old mode 100644 new mode 100755 index bc0c589..4c8c526 --- a/src/Tizen.System/Device/Power.cs +++ b/src/Tizen.System/Device/Power.cs @@ -45,9 +45,11 @@ namespace Tizen.System /// When an invalid parameter value is set. /// If the privilege is not set. /// In case of any system error. + /// /// /// Tizen.System.Power.RequestCpuLock(2000); /// + /// public static void RequestCpuLock(int timeout) { @@ -63,9 +65,11 @@ namespace Tizen.System /// 3 /// If the privilege is not set. /// In case of any system error. + /// /// /// Tizen.System.Power.ReleaseCpuLock(); /// + /// public static void ReleaseCpuLock() { DeviceError res = (DeviceError)Interop.Device.DevicePowerReleaseLock(0); diff --git a/src/Tizen/Interop/Interop.CommonError.cs b/src/Tizen/Interop/Interop.CommonError.cs index 284ba22..0710d5f 100644 --- a/src/Tizen/Interop/Interop.CommonError.cs +++ b/src/Tizen/Interop/Interop.CommonError.cs @@ -19,11 +19,6 @@ using System.Runtime.InteropServices; 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")] diff --git a/src/Tizen/Interop/Interop.DotnetUtil.cs b/src/Tizen/Interop/Interop.DotnetUtil.cs new file mode 100644 index 0000000..68ba363 --- /dev/null +++ b/src/Tizen/Interop/Interop.DotnetUtil.cs @@ -0,0 +1,27 @@ +/* + * 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); + } +} diff --git a/src/Tizen/Interop/Interop.Libraries.cs b/src/Tizen/Interop/Interop.Libraries.cs new file mode 100644 index 0000000..506d911 --- /dev/null +++ b/src/Tizen/Interop/Interop.Libraries.cs @@ -0,0 +1,24 @@ +/* + * 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"; + } +} diff --git a/src/Tizen/Tizen.Common/DotnetUtil.cs b/src/Tizen/Tizen.Common/DotnetUtil.cs new file mode 100644 index 0000000..1bdd3bd --- /dev/null +++ b/src/Tizen/Tizen.Common/DotnetUtil.cs @@ -0,0 +1,44 @@ +/* + * 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 +{ + /// + /// The DotnetUtil class provides the .NET API version. + /// + public static class DotnetUtil + { + /// + /// Gets the version of Tizen .NET API. + /// + /// The Tizen .NET API version + 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; + } + } + } +} diff --git a/src/Tizen/Tizen.Common/DotnetUtilErrorFactory.cs b/src/Tizen/Tizen.Common/DotnetUtilErrorFactory.cs new file mode 100644 index 0000000..677844a --- /dev/null +++ b/src/Tizen/Tizen.Common/DotnetUtilErrorFactory.cs @@ -0,0 +1,40 @@ +/* +* 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"); + } + } + } +} diff --git a/src/Tizen/Tizen.csproj b/src/Tizen/Tizen.csproj index dbdcea4..8b42da5 100644 --- a/src/Tizen/Tizen.csproj +++ b/src/Tizen/Tizen.csproj @@ -4,4 +4,8 @@ netstandard2.0 + + + + -- 2.7.4